-
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 respecting the viewport size on Firefox. #15481
Comments
@aayknija can you provide what screenshot size you're seeing with those options in firefox? It's possible the window size for firefox includes the ~74 pixels of titlebar/menu, so the screenshots may be 1680x950. If that's the case you can try adding 74px to the height argument. We haven't normalized this for users since it's unclear how stable it would be. if (browser.name === 'firefox') {
launchOptions.args.push('--width=1680');
launchOptions.args.push('--height=1098');
return launchOptions;
} |
@bkucera Apologies for the delayed response. I did try the above option as well. The issue was it was not respecting the width and height provided in launch options. I was getting an image with a resolution of 1680x950 and size did vary in the docker image. Finally, after some google search, I found one solution where I have to define MOZ_HEADLESS_WIDTH and MOZ_HEADLESS_HEIGHT in the environment variable and that worked for me. |
The code for this is done in cypress-io/cypress#15686, but has yet to be released. |
Released in v7.0.0 |
Using: Cypress package version: 6.6.0, OS-Windows 10 , Firefox -86.0.1 (64-bit)
As per the documentation, I have added the below code snippet in plugins/index.js still it is not working as expected. The expectation is to take the screenshot in provided resolution.
Command: cypress run --browser firefox --headless
P.S: It works perfectly on chrome with the below code snippet in plugins/index.js
I tried adding
--disable-dev-shm-usage
and--disable-gpu
for firefox also but it did not work.The text was updated successfully, but these errors were encountered: