[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')

 

posted @ 2020-05-19 03:09  Zhentiw  阅读(197)  评论(0编辑  收藏  举报