Cypress · Method
cy.viewport
Changes the Cypress application viewport to custom dimensions or a named device preset. It can also switch the viewport between portrait and landscape.
Last updated
- Since
- 0.9.0
Syntax
cy.viewport(width, height)
cy.viewport(preset, orientation)
cy.viewport(width, height, options)
cy.viewport(preset, orientation, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
viewportWidthviewportHeightCypress.config()describecontextit