An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# nightwatch-browserstack

[Nightwatch](http://nightwatchjs.org/) Integration with BrowserStack.

![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)

## 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)