https://github.com/browserstack/nightwatch-browserstack
Selenium examples for Nightwatch and BrowserStack Automate
https://github.com/browserstack/nightwatch-browserstack
Last synced: 12 months ago
JSON representation
Selenium examples for Nightwatch and BrowserStack Automate
- Host: GitHub
- URL: https://github.com/browserstack/nightwatch-browserstack
- Owner: browserstack
- Created: 2016-03-01T08:30:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-09T00:30:18.000Z (about 1 year ago)
- Last Synced: 2025-03-29T00:09:54.348Z (12 months ago)
- Language: JavaScript
- Homepage: https://www.browserstack.com
- Size: 325 KB
- Stars: 78
- Watchers: 20
- Forks: 63
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# nightwatch-browserstack
[Nightwatch](http://nightwatchjs.org/) Integration with BrowserStack.


## Setup
- Clone the repo
- Install dependencies `npm install`
- You can export the environment variables for the Username and Access Key of your BrowserStack account
```
export BROWSERSTACK_USERNAME= &&
export BROWSERSTACK_ACCESS_KEY=
```
## Running your tests
- To run tests, run `npm run sample-test`
- To run local tests, run `npm run sample-local-test`
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
## Notes
- You can view your test results on the [BrowserStack automate dashboard](https://automate.browserstack.com)
- To test on a different set of browsers, check out our [capabilities generator](https://www.browserstack.com/automate/capabilities)
## Connecting to BrowserStack via a proxy server
You can specify proxy settings in Nightwatch by adding the `proxy` key in your `*.conf.js`
```javascript
test_settings: {
default: {
desiredCapabilities: {
// Your capabilities
},
proxy: {
"host": "", // "127.0.0.1"
"port": "", // "8081"
"protocol": "" // "http"
}
}
}
```
## Additional Resources
- [Documentation for writing automate test scripts in Node](https://www.browserstack.com/docs/automate/selenium/getting-started/nodejs)
- [Customizing your tests on BrowserStack](https://www.browserstack.com/automate/capabilities)
- [Browsers & mobile devices for selenium testing on BrowserStack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate)
- [Using REST API to access information about your tests via the command-line interface](https://www.browserstack.com/docs/automate/api-reference/selenium/introduction)
- [Example to update the Browserstack session status based on the test results](https://github.com/blueimp/nightwatch-browserstack)