Is there a way to get the viewport from inside the test? #14818
Unanswered
dariuszteooh
asked this question in
Questions and Help
Replies: 0 comments
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'm dynamically setting the viewport for some of the tests and want to be able to do different actions in my pages depending on what the viewport size is. Something like
cy.getCurrentViewport
?And since I'm setting it using
cy.viewport('macbook-15')
it doesn't overwrite the config, soCypress.config('viewportWidth')
still returns the default values.Any ideas?
I don't think I can use
Cypress.config('viewportWidth')
as it doesn't seem to work exactly in the same way.Beta Was this translation helpful? Give feedback.
All reactions