Closed Silencesnow closed 11 months ago
@Silencesnow This is due to the screenshot always being restricted by the screen size. In --headless mode in Cypress, we set the screen size to 1280x720 by default (it will show as 2x in retina screens). https://github.com/cypress-io/cypress/issues/3324
I completely agree that it is confusing. You can override the screen size by following these directions. https://docs.cypress.io/api/plugins/browser-launch-api#Set-screen-size-when-running-headless
Closing as duplicate.
The screenshots taken within the Cypress Test Runner also experience offset. What I expect is for them to accurately reflect the viewportWidth and viewportHeight.
Current behavior
when using cy.screenshot(), the settings for viewportWidth and viewportHeight are not being reflected, leading to offset related issues.
Desired behavior
The images generated by cy.screenshot() should match the dimensions set by viewportWidth and viewportHeight, and should have no offset.
Test code to reproduce
My config:
my test:
the screenshot:
Cypress Version
13.5.0
Node version
v16.15.1
Operating System
macOS 13.4
Debug Logs
Other
No response