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

All browsers when run via cypress run should run headless by default. #16832

Closed
jennifer-shehane opened this issue Jun 7, 2021 · 2 comments · Fixed by #17309
Closed

All browsers when run via cypress run should run headless by default. #16832

jennifer-shehane opened this issue Jun 7, 2021 · 2 comments · Fixed by #17309
Assignees
Labels
type: breaking change Requires a new major release version

Comments

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jun 7, 2021

What would you like?

All browsers when run via cypress run should run headless by default.

Currently, whether a browser is run headless or headed by default is not consistent. It depends on the browser. We originally made this decision in order to not introduce a breaking change when Chrome headless was delivered. #5676 We intended to change this behavior in the next breaking change, but clearly didn't prioritize this work.

  • cypress run --browser electron - defaults to headless
  • cypress run --browser chrome - defaults to headed
  • cypress run --browser firefox - defaults to headed
  • cypress run --browser edge - defaults to headed

Why is this needed?

The larger reason this is necessary (besides maintaining consistency in our app) is because the browser size when Chrome is opened in headed mode is unpredictable.

This causes a lot of unexpected video/screenshot sizes when someone wants to run their browser in chrome, not considering the (undocumented) differences between headed and headless screen sizes.

People might additionally believe that passing browser flags for the size will fix the Chrome headed browser to a specific size when in reality it does absolutely nothing.

Chrome video sizes (browser size) during headed:

  • Screensize: 2880x1800 at 2dpi = 2560x1050
  • Screensize: 1024x768 at 1dpt = 896x528
  • Xvfb size: 1280x1024 = 1050x838
  • Xvfb size: 1024x768 = 1004x582
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 19, 2021

The code for this is done in cypress-io/cypress#17309, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 20, 2021

Released in 8.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.0.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: breaking change Requires a new major release version
Projects
None yet
2 participants