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

fix(e2e-cypress): make --headless work with --browser chrome #5108

Merged
merged 2 commits into from Feb 1, 2020

Conversation

LinusBorg
Copy link
Member

@LinusBorg LinusBorg commented Jan 24, 2020

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

When running vue-cli-service test:e2e,w e currently use the -headless flag to distinguish wether to run cypress run (headless) or cypress open (interactive mode). Therefore, we remove the --headless flag from the args before passing them on to cypress: we expect cypress run to run headless anyway by default.

Since then, Cypress.io added the possibility to have cypress run execute with a Chrome window open, but not in interactive mode like cypress open.

So now when you run cypress run --browser chrome (b< calling vue-ci-service test:e2e --browser chrome) the tests run automatically, but not headless anymore. To make cypress run chrome truly headless, we have to pass the --headless flag explictily.

This PR allows for that but at the same time, it prevents users from running with an open chrome window (except in interactive mode of course).

It think this makes sense as a fix for now nontheless, as it ensures that people running --headless get that behaviour wether or not they have defined --browser chrome.

But for the next major version, we should consider changing this plugin's cli API to allow to get all posible cypress behaviours.

@sodatea
Copy link
Member

sodatea commented Jan 30, 2020

Seems the minimum required version of Cypress should be bumped as well?

@LinusBorg
Copy link
Member Author

good point

this version onwards supports using --browser chrome --headless
@sodatea sodatea merged commit f7ad307 into dev Feb 1, 2020
@sodatea sodatea deleted the fix-cypress-headless-5103 branch February 1, 2020 07:24
mactanxin pushed a commit to mactanxin/vue-cli that referenced this pull request Feb 11, 2020
)

* fix(e2e-cypress): make —headless work with —browser chrome

fix vuejs#5103

* fix: increase cypress minimum version to 3.8

this version onwards supports using --browser chrome --headless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants