[Cypress] Change a viewport width and height in a cypress test

Long time ago, frontend developers (or as we called them back then - webmasters) could get away with supporting only one or two resolutions.

Those days are long gone.

In this lesson we're going to learn how to change a viewport width and height in a cypress test in order to ensure that our app works as intended on a given resolution.

https://docs.cypress.io/api/commands/viewport.html#Usage

cy.viewport('ipad-2', 'landspace')
原文地址:https://www.cnblogs.com/Answer1215/p/12914363.html