Skip to content
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

Screenshots taken in 1000px viewport are 800px wide in Docker + Chrome + Headless #6246

Closed
steveharrison opened this issue Jan 27, 2020 · 1 comment

Comments

@steveharrison
Copy link

steveharrison commented Jan 27, 2020

Current behavior:

When I set the viewport to 1000x600px and then take a screenshot, the resulting screenshot is 800x600px wide. This only happens when running inside Docker.

Desired behavior:

I expect the screenshot to be 1000px wide.

I've read @brian-mann's post about issues with taking screenshots larger than 1280x720px, but 1000x600px is within these dimensions.

Test code to reproduce

  1. Checkout this repository: https://github.com/steveharrison/cypress-viewport-test/.
  2. Install dependencies with npm i.
  3. Start the test server with npm start, which will fire up a server at http://localhost:9000.
  4. Ensure Docker for Mac is running and then run npm run test-d (which runs docker run -it -v $PWD:/cypress -w /cypress --entrypoint=cypress cypress/included:3.8.2 run --config baseUrl=http://host.docker.internal:9000 --headless --browser chrome).
  5. Check the resolution of screenshots/main.spec.js/Cypress Viewport Test -- works.png.

Versions

  • Cypress 3.8.2 (running in Docker using cypress/included:3.8.2)
  • Docker for Mac 2.2.0.0
  • macOS 10.12.6
  • Node 13.6.0 (running in nvm and used for the project, not in Docker)
@steveharrison steveharrison changed the title 1000px becomes 800px-wide in Docker + Chrome + Headless Screenshots taken in 1000px viewport are 800px wide in Docker + Chrome + Headless Jan 27, 2020
@jennifer-shehane
Copy link
Member

Duplicate of #6210

@jennifer-shehane jennifer-shehane marked this as a duplicate of #6210 Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants