Skip to content

Upgrade Nightwatch to v1.2 and update bundled config and generated tests #4541

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

Merged
merged 10 commits into from
Sep 9, 2019

Conversation

beatfactor
Copy link
Contributor

@beatfactor beatfactor commented Sep 4, 2019

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

Overview

This PR upgrades the Nightwatch version bundled with the cli-e2e-nightwatch plugin to latest v1.2 version. In addition, it adds several new features for running end-to-end tests with Nightwatch in a Vue application a bit more pleasant of an experience.

Improvements

  • switched to using standalone Webdriver (default with Chromedriver) instead of with Selenium server
  • added support for running tests in Firefox (via Geckodriver)
  • added built-in support for running tests in headless mode (via --headless) with Chrome and Firefox
  • updated generated tests and also updated template with example custom commands, page objects, and external globals file

New CLI flags

  • --use-selenium: allows using the Selenium standalone server instead of running Webdriver standalone
  • --parallel: enable parallel mode via test workers (only available when using chromedriver)
  • --headless: run tests with the browser (chrome/firefox) in headless mode

Other

  • added more unit tests
  • to run unit tests independently than the other packages, in the root folder do:
$ node scripts/test.js -p cli-plugin-e2e-nightwatch

… added new cli flags: --headless, --parallel...; added support for running chromedriver and geckodriver standalone; added unit tests
@beatfactor
Copy link
Contributor Author

Is it possible to upgrade Chrome in AppVeyour?

@haoqunjiang
Copy link
Member

I've added a patchChromedriver script for AppVeyor setup in the dev branch.

@haoqunjiang
Copy link
Member

The rest of this PR looks pretty cool to me. I'll merge it after the dependency issues get fixed.
Thanks for your help to make Nightwatch a breeze to use in Vue CLI!

@beatfactor
Copy link
Contributor Author

The rest of this PR looks pretty cool to me. I'll merge it after the dependency issues get fixed.

Great, so to summarise, changes required:

  • move selenium-server to optional peerDependencies and add a note in the Readme regarding the installation
  • add geckodriver inside generator/index.js as a devDependency

Anything else I might have missed?

Thanks for your help to make Nightwatch a breeze to use in Vue CLI!

My pleasure. Feel free to reach out regarding Nightwatch related bugs and/or enhancements, we'd be happy to assist.

@haoqunjiang
Copy link
Member

Yeah, I think that's all.

@haoqunjiang
Copy link
Member

Tests are failing.
So selenium-server still needs to be added to devDependencies

expect(testSettings.parallel_mode).toStrictEqual(true)
expect(testSettings.test_workers).toStrictEqual(true)

expect(Object.keys(results.modules)).toEqual([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the tests are run in parallel, the order of results.modules is nondeterministic, which could cause test failures.

Suggested change
expect(Object.keys(results.modules)).toEqual([
expect(Object.keys(results.modules.sort())).toEqual([

@haoqunjiang haoqunjiang merged commit 59adbd6 into vuejs:dev Sep 9, 2019
@vue-bot
Copy link

vue-bot commented Sep 9, 2019

Hey @beatfactor, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

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.

3 participants