Is there a way to test for viewport overflow in Cypress? (Also why doesn't scrollTo(x) work?) #15663
Unanswered
LandGod
asked this question in
Questions and Help
Replies: 1 comment
-
Reviving this. I'm having the same trouble with scrolling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to rig up a test for detecting if any of the elements on a given page are overflowing the viewport, but I'm running into a ton of roadblocks. I'm not sure if this is a case of me just misunderstanding functionality, an actual bug in Cypress, or a functionality that is simply not implemented in Cypress.
I'm running Cypress version
6.8.0
Here is the code that I've tried so far:
I've tried a number of iterations of trying to scroll horizontally but nothing ever happens. No matter what argument I give to
cy.scrollTo
it never does any horizontal scrolling and then of course it will happily report that window.scrollX is 0 and report success despite not actually doing anything.As you can see I also tried adding some
wait
s to make sure I wasn't having async issues, but that doesn't seem to make any difference either.So here are my two questions:
Thank you.
PS: I can see the horizontal scrollbar on the window after setting
overflow-x: auto
on the body, so I know that the scroll is possible and I can even do with my mouse when running in dashboard mode.Beta Was this translation helpful? Give feedback.
All reactions