Reputation: 11
The ionic app I'm testing makes it so Cypress's default scroll attempt does not work. The only way I can actually scroll is by targeting a specific element like:
cy.get('ion-content').shadow().find('main').scrollTo('bottom')
Attempts to scroll with more generic methods such as 'cy.scrollTo('bottom')' are met with the error:
Timed out retrying after 4000ms: cy.scrollTo() failed because this element is not scrollable: Make sure you're targeting the correct element or use {ensureScrollable: false} to disable the scrollable check.
So my question is, does this mean I am unable to ever use
cy.get('element').scrollIntoView()
My understanding is that the 'scrollIntoView()' method attempts to scroll using the default scrolling element, which doesn't work for the ionic app I'm testing. Is there a way to make 'scrollIntoView()' scroll using a specific scroll element?
Thanks
Upvotes: 1
Views: 7363
Reputation: 61
I had the same issue. The solution was to set the focus inside the ion-content for example by clicking on an element inside the ion-content then the .scrollIntoView()
worked.
Upvotes: 2