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

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

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
beatfactor added 3 commits Sep 4, 2019
… added new cli flags: --headless, --parallel...; added support for running chromedriver and geckodriver standalone; added unit tests
packages/@vue/cli-plugin-e2e-nightwatch/package.json Outdated Show resolved Hide resolved
Loading
@beatfactor
Copy link
Contributor Author

@beatfactor beatfactor commented Sep 5, 2019

Is it possible to upgrade Chrome in AppVeyour?

Loading

@sodatea
Copy link
Member

@sodatea sodatea commented Sep 8, 2019

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

Loading

Loading
packages/@vue/cli-plugin-e2e-nightwatch/package.json Outdated Show resolved Hide resolved
Loading
packages/@vue/cli-plugin-e2e-nightwatch/README.md Outdated Show resolved Hide resolved
Loading
@sodatea
Copy link
Member

@sodatea sodatea commented Sep 8, 2019

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!

Loading

@beatfactor
Copy link
Contributor Author

@beatfactor beatfactor commented Sep 8, 2019

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.

Loading

@sodatea
Copy link
Member

@sodatea sodatea commented Sep 8, 2019

Yeah, I think that's all.

Loading

@beatfactor beatfactor requested a review from sodatea Sep 8, 2019
packages/@vue/cli-plugin-e2e-nightwatch/package.json Outdated Show resolved Hide resolved
Loading
@beatfactor beatfactor requested a review from sodatea Sep 9, 2019
@sodatea
Copy link
Member

@sodatea sodatea commented Sep 9, 2019

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

Loading

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

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

@sodatea sodatea Sep 9, 2019

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([

Loading

sodatea
sodatea approved these changes Sep 9, 2019
@sodatea sodatea merged commit 59adbd6 into vuejs:dev Sep 9, 2019
7 checks passed
Loading
@vue-bot
Copy link

@vue-bot 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! 💚

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants