Vue-cli 4 plugin for adding nightwatch + browserstack e2e tests
npm install vue-cli-plugin-e2e-nightwatch-browserstack@vue/cli plugin for automated testing with Vue + Nightwatch + BrowserStack


Note: this depends on @vue/cli-plugin-e2e-nightwatch
From an existing Vue cli application run:
vue add e2e-nightwatch-browserstack
This will install a /browserstack_config folder
with a nightwatch.conf.js file
and adds several scripts to the package.json
to run the tests in different browsers.
This differs from npm:vue-cli-plugin-e2e-nightwatch-browserstack
by integrating better with the e2e-nightwatch plugin.
This package assumes that @vue/cli-plugin-e2e-nightwatch
has already been installed.
If you installed this one first,
I advise deleting all traces of this and installing the nightwatch plugin first.
As a fallback, if the normal Vue installation does not work, try:
npm install -save-dev vue-cli-plugin-e2e-nightwatch-browserstack
and
vue invoke e2e-nightwatch-browserstack
- delete node_modules
- delete the folder browserstack_config
- remove vue-cli-plugin-e2e-nightwatch-browserstack from
package.json
- remove all test:browserstack... commands from package.json.
If the expected files are not created (or you installed through npm install),
try vue invoke e2e-nightwatch-browserstack
#### Required ENV Vars
BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY are required to be set.
These can be retrieved from your account settings at:
BROWSERSTACK_PROJECT can be configured to split tests by project.
The default name is "default_project"
This setting is unique and uses an ENV var so CircleCI can build this
to the correct project for BrowserStack's Open Source project requirements.
#### File and Config Structure
This plugin uses its own Nightwatch config file.
It does not inherit from package.json or from any other
Nightwatch config files in the root directory.
All BrowserStack and NightwatchJS configurations can be set in thebrowserstack_config/nightwatch.conf.js file.
npm run test:browserstack:chrome
or replace chrome with firefox, safari, ie, android, ios
--url flag is used to specify a url. This flag skips the dev server
and passes the url to browserstack as part of the config.
Further Nightwatch commands could change the starting URL,
but this is the one which will show up in the Browserstack UI.
asset.elementCount() is a sample custom-assertion.
Make sure you set the custom assertions path in whichever nightwatch.conf.js
you are using
If you are using a previous version of @vue/cli such as"@vue/cli-plugin-e2e-nightwatch": "^3.8.0",
which uses a version of Nightwatch
before the Nightwatch CLI was implemented in 1.0.0, then there will be issues
such as test runner inconsistencies or critical vulnerabilities.
- Pull requests are welcome.
- For major changes,
please open an issue first to discuss what you would like to change.
- Please make sure to update tests as appropriate.
- Creation of additional tests are always appreciated too.
Follow the instructions here.
Most of this information will be
required to fully understand how Vue plugins work
For committing, you may be required to be logged into docker for changes to the hello-world image.