Cross-browser testing with BrowserStack
npm install ember-cli-browserstackFacilitates automated testing using BrowserStack with ember-cli projects
--build 1. ember install ember-cli-browserstack
1. Register for a BrowserStack account
1. Set environment variables BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY
1. Add browsers to your testem.js. You can see available browsers by running ember browserstack:browsers
For example:
```
launchers: {
bs_edge: {
exe: 'npx ember-cli-browserstack',
args: ['--os', 'Windows', '--osv', '10', '--b', 'edge', '--bv', 'latest', '-t', '1200', '-p',
'my-project-name', '--u', '
protocol: 'browser'
},
bs_chrome: {
exe: 'node_modules/.bin/browserstack-launch',
args: ['--os', 'Windows', '--osv', '10', '--b', 'chrome', '--bv', 'latest', '-t', '600', '-p', 'my-project-name', '--u', '
protocol: 'browser'
}
},
launch_in_ci: [
'bs_edge',
'Chrome'
]
npx ember-cli-browserstack --help
To see available options run or see https://www.browserstack.com/automate/capabilities and https://github.com/scottgonzalez/node-browserstack#browser-objectsember browserstack:connect
Not all options are required.
1. Open a tunnel to BrowserStack using .
This will create a browserstack-local.pid file, necessary for later disconnecting the tunnel.ember test
1. Run tests ()--host 127.0.0.1
You may need to specify and --test-port=7774 to support Safariember browserstack:disconnect
1. When tests are complete, close the tunnel to BrowserStack using
The build name can be set by passing it to each launcher (--build) or by setting the environment variable BROWSERSTACK_BUILD_NAME.BROWSERSTACK_BUILD_NAME_PREFIX
If no build name is passed it will be determined by CI Environment variables, falling back to a random value.
The build name can be prefixed by setting .
The name is used for grouping runs in the BrowserStack UI and to fetch results.
_In most cases you don't need to do anything with default setup._
_However if you are building custom matrix build CI pipeline, then you need to tell Browserstack where each instance is for its routing to work._
In case you need to setup custom value for local identifier, you can set BROWSERSTACK_LOCAL_IDENTIFIER env var.BROWSERSTACK_LOCAL_ID_SUFFIX
If the env var is not set, this addon attempts to set a smart value for the local identifier based on the build name.
You can append to this smart value by setting .
See, for example, the GitHub Actions setup in this repository.
_See for more information: https://www.browserstack.com/local-testing/automate#multiple-local-testing-connections_
* git clone this repositorycd ember-cli-browserstack
* yarn install
* npm link
* npm link ember-cli-browserstack`
* In another project,
Thanks to BrowserStack for providing an open-source account for testing & development!
This addon is based on ember-cli-sauce and testem-browserstack.
It also relies upon node-browserstack and browserstack-local-nodejs.
Contributing
------------------------------------------------------------------------------
See the Contributing guide for details.
License
------------------------------------------------------------------------------
This project is licensed under the MIT License.