Skip to content

Nightwatch plugin --use-selenium parameter does not take effect #5015

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

Closed
weihongyu12 opened this issue Dec 31, 2019 · 1 comment · Fixed by #5016
Closed

Nightwatch plugin --use-selenium parameter does not take effect #5015

weihongyu12 opened this issue Dec 31, 2019 · 1 comment · Fixed by #5016

Comments

@weihongyu12
Copy link

Version

4.1.2

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.18363
    CPU: (4) x64 Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
  Binaries:
    Node: 10.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.11.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 (1.1.2)
    @vue/babel-preset-app:  4.1.2 (3.12.0)
    @vue/babel-preset-jsx:  1.1.2 (1.1.1)
    @vue/babel-sugar-functional-vue:  1.1.2 (1.0.0)
    @vue/babel-sugar-inject-h:  1.1.2 (1.0.0)
    @vue/babel-sugar-v-model:  1.1.2 (1.1.1)
    @vue/babel-sugar-v-on:  1.1.2 (1.1.0)
    @vue/cli-overlay:  4.1.2
    @vue/cli-plugin-babel: ^4.1.2 => 4.1.2
    @vue/cli-plugin-e2e-nightwatch: ^4.1.2 => 4.1.2
    @vue/cli-plugin-eslint: ^4.1.2 => 4.1.2
    @vue/cli-plugin-pwa: ^4.1.2 => 4.1.2
    @vue/cli-plugin-router: ^4.1.2 => 4.1.2
    @vue/cli-plugin-unit-mocha: ^4.1.2 => 4.1.2
    @vue/cli-plugin-vuex: ^4.1.2 => 4.1.2
    @vue/cli-service: ^4.1.2 => 4.1.2
    @vue/cli-shared-utils:  4.1.2
    @vue/component-compiler-utils:  3.1.0 (3.0.0)
    @vue/eslint-config-airbnb: ^5.0.0 => 5.0.0
    @vue/preload-webpack-plugin: ^1.1.1 => 1.1.1
    @vue/test-utils: 1.0.0-beta.30 => 1.0.0-beta.30
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^6.1.1 => 6.1.1
    typescript:  3.6.4
    vue: ^2.6.11 => 2.6.11 (2.6.10)
    vue-docgen-api:  4.2.2
    vue-eslint-parser:  7.0.0 (2.0.3)
    vue-hot-reload-api:  2.3.4
    vue-inbrowser-compiler:  4.2.2
    vue-inbrowser-compiler-utils:  4.0.1
    vue-loader:  15.7.1 (15.8.3)
    vue-router: ^3.1.3 => 3.1.3
    vue-server-renderer:  2.6.10
    vue-style-loader:  4.1.2
    vue-styleguidist: ^4.2.3 => 4.2.3
    vue-template-compiler: ^2.6.11 => 2.6.11 (2.6.10)
    vue-template-es2015-compiler:  1.9.1
    vuepress: ^1.2.0 => 1.2.0
    vuepress-html-webpack-plugin:  3.2.0
    vuepress-plugin-container:  2.0.2
    vuepress-plugin-smooth-scroll:  0.0.3
    vuex: ^3.1.2 => 3.1.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Create a project using @vue/cli, select "Nightwatch" in E2E testing
  2. Modify the E2E test command to vue-cli-service test: e2e --use-selenium
  3. In /node_modules/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js file, find useSelenium and make a breakpoint for debugging
  4. Run yarn run test: e2e

What is expected?

Through breakpoints, although the --use-selenium parameter has been passed on the command line, we can still see that useSelenium return false. The --use-selenium parameter does not take effect and you cannot use Selenium Server.

图片

What is actually happening?

Actually, I have been exploring E2E testing on GitLab CI recently. Unexpectedly found this problem. In the CI environment, Selenium Server is more useful than WebDriver, but it can't be used now

LinusBorg added a commit that referenced this issue Jan 1, 2020
flag is documented as `--use-selenium` but we checked for `args['with-selenium']`
fix #5015
@LinusBorg
Copy link
Member

LinusBorg commented Jan 1, 2020

It seems we have a simple typo in the code where we check for the flag's presence.

I submitted a PR.

In the meantime, running tests with --with-selenium should do what you want. But be careful, the next minor might break this as my PR switches this to the correct --use-selenium again.

haoqunjiang pushed a commit that referenced this issue Jan 3, 2020
* fix(e2e-nightwatch): check for correct flag name

flag is documented as `--use-selenium` but we checked for `args['with-selenium']`
fix #5015

* test(e2e-nightwatch): selenium test
uses correct flag now
mactanxin pushed a commit to mactanxin/vue-cli that referenced this issue Feb 11, 2020
* fix(e2e-nightwatch): check for correct flag name

flag is documented as `--use-selenium` but we checked for `args['with-selenium']`
fix vuejs#5015

* test(e2e-nightwatch): selenium test
uses correct flag now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants