-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll element into view when using .should('be.visible')
#2892
Comments
I've had this 'issue' when doing a set of asserts on multiple list/item els inside a parent container.
The question then becomes, does a @jennifer-shehane Can you advise please? |
After thinking about this some more, I realized this could be undesirable in situations where you want to assert that the app itself scrolls the content into view. I didn't know that there was a |
I hope that a similar command can be introduced in Cypress api, like |
If you have a scrollable list of items, and want to verify that one of the items is in the list, the following isn't sufficient in all cases because it doesn't cause Cypress to scroll the element into view:
However, you can work around this by triggering an event on the element, which activates the scroll algorithm documented here:
Would the Cypress team be interested in a PR making a change such that this scroll algorithm is called when
.should
is called with'be.visible'
?Current behavior:
Automatic scrolling does not occur when using
.should('be.visible')
.Desired behavior:
Automatic scrolling occurs when using
.should('be.visible')
.Versions
Cypress 3.1.1, macOS 10.13.6, Chrome 70
The text was updated successfully, but these errors were encountered: