简体   繁体   English

Cypress:检查浏览器是否处于全屏模式

[英]Cypress: check if browser is in full screen mode

Is there anyway to check if the browser is in full screen mode in Cypress?无论如何要检查浏览器是否在 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.请记住,您使用此 API 对配置所做的任何更改仅对同一规范文件中的其余测试有效。

{
  "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.要检查 Cypress 是否在全屏上运行,您可以使用Cypress.config获取视口尺寸并检查它们是否与设备的屏幕尺寸相同。

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).要在全屏上运行 Cypress,您应该能够使用cy.viewport将视口尺寸更改为屏幕cy.viewport (我还没有测试过,但它应该可以工作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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