Nightwatch Integration with BrowserStack.
Documentation update will follow but for now just use
npm run test-testnet
And make sure you have your .env
set up correctly (see example file).
- running tests on localhost
npm run test-local chrome
npm run test-local chrome,firefox,safari
npm run test-local chrome,firefox,safari -f tests/evan/login
- running tests on dashboard.test.evan.network
npm run test-testnet chrome
npm run test-testnet chrome,firefox,safari
Add @evan.network/ui-tests
as a dependency to your project and add the following scripts to your package.json (do not forget to adjust the testname
§ parameter):
"scripts": {
...
"test-local": "node node_modules/@evan.network/ui-tests/scripts/local.runner.js --config node_modules/@evan.network/ui-tests/conf/evan.conf.js --testname 'my-cool-test' --type localhost --env ",
"test-testnet": "./node_modules/.bin/nightwatch --config node_modules/@evan.network/ui-tests/conf/evan.conf.js --testname 'my-cool-test' --type testnet --env "
...
}
Now you can use the same commands from Running your Tests
.
const setupEvan = require('@evan.network/ui-tests').setupEvan;
module.exports = {
'evan.network login': function (browser) {
// apply the evan functions to the browser context
setupEvan(browser);
browser
.evan.login('...', '...')
.end();
}
};
-
You can view your test results on the BrowserStack automate dashboard
-
To test on a different set of browsers, check out our platform configurator
-
You can export the environment variables for the Username and Access Key of your BrowserStack account
export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
You can specify proxy settings in Nightwatch by adding the proxy
key in your *.conf.js
test_settings: {
default: {
desiredCapabilities: {
// Your capabilities
},
proxy: {
"host": "", // "127.0.0.1"
"port": "", // "8081"
"protocol": "" // "http"
}
}
}
- Documentation for writing automate test scripts in Node
- Customizing your tests on BrowserStack
- Browsers & mobile devices for selenium testing on BrowserStack
- Using REST API to access information about your tests via the command-line interface
- Example to update the Browserstack session status based on the test results