Run selenium tests on BrowserStack using our node.js integration.
npm install browserstack-automatePatches for Selenium scripts and test suites to run on BrowserStack when RUN_ON_BSTACK=true is set in environment.
Currently supports Nightwatch.js.
npm install browserstack-automatenpm link && cd examples/simple_sample/ && npm install && npm link browserstack-automateRUN_ON_BSTACK=true node sample.jsrequire('browserstack-automate').Nightwatch();
- To run locally, run npm link && cd examples/nightwatch/ && npm install && npm link browserstack-automate
- To run on BrowserStack, run RUN_ON_BSTACK=true ./node_modules/.bin/nightwatch -c conf.js
The following environment variables are supported,
``
RUN_ON_BSTACK - Boolean. To run your tests on BrowserStack
BSTACK_LOCAL - Boolean. Whether to start/stop BrowserStackLocal for your tests
BROWSERSTACK_USERNAME - your BrowserStack username
BROWSERSTACK_ACCESS_KEY - your BrowserStack accesskey
`
* Export the environment variables for the Username and Access Key of your BrowserStack account
`
export BROWSERSTACK_USERNAME=
export BROWSERSTACK_ACCESS_KEY=
`To run tests
`node
npm test
`To integrate with your nightwatch framework
- Add the following to
conf.js file.`node
require('browserstack-automate').Nightwatch();
``