Nightwatch Integration with BrowserStack.
-
Clone the repo
-
Install the dependencies using
npm install
-
Export the environment variables for the Username and Access Key of your BrowserStack account, which you can get directly from the app automate dashboard
export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
-
Upload the apps provided in resources folder using this command
curl -u "<username>:<access-key>" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@/path/to/app/file/application-debug.apk"
- Please note the value of app_url in the API response and set the app capbility in the
nightwatch.conf.js
,nightwatch-local.conf.js
andnightwatch-suite.conf.js
in conf folder for the respective apps.- android_app_url in
browserstack.android_01
andbrowserstack.android_02
capability set in nightwatch-suite.conf.js - android_app_url in
browserstack.android_01
capability set in nightwatch.conf.js - ios_app_url in
browserstack.ios_01
capability set in nightwatch.conf.js - android_local_app_url in
browserstack.local_01
andbrowserstack.local_02
capability set in nightwatch-local.conf.js
- android_app_url in
- Please go through this documentation for better understanding.
- To run a single android test, run
npm run single-android
- To run a single ios test, run
npm run single-ios
- To run parallel tests, run
npm run parallel
- To run parallel tests on different devices, run
npm run parallel-devices
- To run test suite, run
npm run suite
- To run local tests, run
npm run local
- To run parallel local tests, run
npm run parallel-local
Understand how many parallel sessions you need by using our Parallel Test Calculator
- You can view your test results on the BrowserStack app automate dashboard
- To test on a different set of browsers, check out our capabilities generator
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"
}
}
}