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

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
feat: Upgraded Nightwatch to version 1.2; updated distributed config;…
… added new cli flags: --headless, --parallel...; added support for running chromedriver and geckodriver standalone; added unit tests
@beatfactor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2019

Is it possible to upgrade Chrome in AppVeyour?

@sodatea

This comment has been minimized.

Copy link
Member

commented Sep 8, 2019

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

@sodatea

This comment has been minimized.

Copy link
Member

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!

@beatfactor

This comment has been minimized.

Copy link
Contributor Author

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.

@sodatea

This comment has been minimized.

Copy link
Member

commented Sep 8, 2019

Yeah, I think that's all.

@beatfactor beatfactor requested a review from sodatea Sep 8, 2019

@beatfactor beatfactor requested a review from sodatea Sep 9, 2019

@sodatea

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

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

beatfactor added 2 commits Sep 9, 2019
expect(testSettings.parallel_mode).toStrictEqual(true)
expect(testSettings.test_workers).toStrictEqual(true)

expect(Object.keys(results.modules)).toEqual([

This comment has been minimized.

Copy link
@sodatea

sodatea Sep 9, 2019

Member

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([
@sodatea
sodatea approved these changes Sep 9, 2019

@sodatea sodatea merged commit 59adbd6 into vuejs:dev Sep 9, 2019

7 checks passed

ci/circleci: cli-ui Your tests passed on CircleCI!
Details
ci/circleci: group-1 Your tests passed on CircleCI!
Details
ci/circleci: group-2 Your tests passed on CircleCI!
Details
ci/circleci: group-3 Your tests passed on CircleCI!
Details
ci/circleci: group-4 Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@vue-bot

This comment has been minimized.

Copy link

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! 💚

@beatfactor beatfactor deleted the beatfactor:feat/nightwatch-upgrade-v1.2 branch Sep 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.