-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cy.screenshot() not reflecting viewportWidth and viewportHeight settings, resulting in offset #28541
Comments
@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). #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
The text was updated successfully, but these errors were encountered: