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

Vue cli not passing --headless to cypress #5103

Closed
borisgdodo opened this issue Jan 23, 2020 · 2 comments
Closed

Vue cli not passing --headless to cypress #5103

borisgdodo opened this issue Jan 23, 2020 · 2 comments

Comments

@borisgdodo
Copy link

Version

4.1.2

Reproduction link

https://github.com/borisgdodo/sreda

Environment info

System:
    OS: macOS High Sierra 10.13.2
    CPU: (4) x64 Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
  Binaries:
    Node: 13.6.0 - /usr/local/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 79.0.3945.130
    Firefox: 72.0.1
    Safari: 11.0.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.1.2
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.1.2
    @vue/cli-plugin-babel: ^4.1.0 => 4.1.2
    @vue/cli-plugin-e2e-cypress: ^4.1.2 => 4.1.2
    @vue/cli-plugin-eslint: ^4.1.0 => 4.1.2
    @vue/cli-plugin-router:  4.1.2
    @vue/cli-plugin-vuex:  4.1.2
    @vue/cli-service: ^4.1.0 => 4.1.2
    @vue/cli-shared-utils:  4.1.2
    @vue/component-compiler-utils:  3.1.1
    @vue/preload-webpack-plugin:  1.1.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3
    vue: ^2.6.10 => 2.6.11
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.8.3
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.11
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

yarn install

yarn test:e2e --headless --browser chrome

It will run chrome but not in headless mode.

What is expected?

Browser should be run headless.

What is actually happening?

Specifying --browser and --headless does not start the browser in headless mode.


In packages/@vue/cli-plugin-e2e-cypress/index.js

removeArg(rawArgs, 'headless', 0)

removes the argument sent and the test does not run in headless mode when --browser is specified.

@LinusBorg
Copy link
Member

LinusBorg commented Jan 24, 2020

The plugin removes the flag as its relys on the cypress run command's (default) behaviour of running headlessly.

I'm not sure if the --browser flag was an addition to cypress that we missed and which now allows for situations that need a --headless flag even for cypress run.

The solution should indeed be simple enough.

Edit: Seems the combination of --headless --browser chrome wasn't supported until 3.8.0, released 12.12.2019:

https://docs.cypress.io/guides/references/changelog.html#3-8-0

@LinusBorg LinusBorg self-assigned this Jan 24, 2020
@borisgdodo
Copy link
Author

Thanks a lot @LinusBorg

LinusBorg added a commit that referenced this issue Jan 24, 2020
when calling `cypress run`

fix #5103
@LinusBorg LinusBorg removed their assignment Jan 24, 2020
@sodatea sodatea closed this as completed in f7ad307 Feb 1, 2020
mactanxin pushed a commit to mactanxin/vue-cli that referenced this issue 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

No branches or pull requests

2 participants