简体   繁体   中英

Cypress: check if browser is in full screen mode

Is there anyway to check if the browser is in full screen mode in Cypress?

More than that I think that when I run my tests, the full screen functionality does not work. Do you know if it's something supported by Cypress?

Remember, any changes that you make to configuration using this API will only be in effect for the remainder of the tests in the same spec file.

{
  "viewportWidth": 1280,
  "viewportHeight": 720
}

To check if Cypress is running on fullscreen you can get the viewport dimensions using Cypress.config and check if those are the same as the device's screen size.

To run Cypress on fullscreen, you should be able to change the viewport dimensions to the size of the screen usingcy.viewport (I haven't tested this out, but it should work).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM