Nightwatch end-to-end testing framework for KeystoneJS applications
npm install keystone-nightwatch-e2enpm install keystone-nightwatch-e2e --save-dev var keystoneNightwatchE2e = require('keystone-nightwatch-e2e');
keystoneNightwatchE2e.startE2E(options, done);
where options is:
{
keystone:
}
| Option Name | Description |
| ------------------------- | --------------|
| --selenium-in-background | This option tells KNE to start the selenium server manually, instead of letting Nightwatch start it. Some users in some unix-based platforms have had issues with Nightwatch starting selenium. |
| --browser-name | Locally on "firefox" and "chrome" are supported. Please see SauceLab's Platform Configurator for supported browser names. |
| --browser-version | Applies to SauceLabs runs only. Locally it will run whatever browser version is installed. Please see SauceLab's Platform Configurator for supported versions. You may also specify "latest". |
| --env | The nightwatch context to use. Should be one of: default, saucelabs-local, saucelabs-travis. If not specified, default is used. For local dev testing either default or saucelabs-local should be used. saucelabs-travis should be reserved for travis builds. |
| --sauce-username | The SauceLabs user name to create a secured tunnel with SauceLabs. Should be used in combination with --env saucelabs-local or --env saucelabs-travis to perform testing against SauceLabs. You need a SauceLabs account to use this option. |
| --sauce-access-key | The SauceLabs access key to create a secured tunnel with SauceLabs. Should be used in combination with --env saucelabs-local or --env saucelabs-travis to perform testing against SauceLabs. You need a SauceLabs account to use this option. |
| --group | The test group to run. This is nightwatch terminology. Please see NightwatchJS Test Runner for on this and other options. |
| --test | The test to run. This is nightwatch terminology. Please see NightwatchJS Test Runner for on this and other options. |
Examples:
- node test/e2e/testApp.js --browser-name chrome --group test/e2e/group000
- node test/e2e/testApp.js --browser-name firefox --test test/e2e/group000/test1.js
- node test/e2e/testApp.js --env saucelabs-local --browser-name chrome --sauce-username MYUSERNAME --sauce-access-key MYACCESSKEY --group test/e2e/group000
- node test/e2e/testApp.js --env saucelabs-local --browser-name firefox --browser-version 50 --sauce-username MYUSERNAME --sauce-access-key MYACCESSKEY
NOTES on examples:
- The first example, runs the group000 tests in chrome in your localhost
- The second example, runs the group000/test1 test in firefox in your localhost
- The third example, runs the group000/test1 test in the latest version of chrome in SauceLabs
- The fourth example, runs all the e2e tests in version 50 of firefox in SauceLabs
test/e2e
testApp.js => your main test app server (requires and starts KNE)
adminUI => adminUI e2e test suite
tests => directory to group all e2e tests
group000 => a test group (000 is the group number)
test1.js => first test in test group 000
test2.js => second test in test group 000
test3.js => third test in test group 000
...
testMMM.js
...
groupNNN
modelTestConfig => describe your application models to the test framework
... => use the KeystoneJS e2e test ones as a guide
models => test application models
...