Facilitates automated testing using BrowserStack with ember-cli projects
As of October 21, 2019, version 0.0.8 is the minimum version that will work with BrowserStack, due to API host changes.
- Opens a local tunnel to BrowserStack
- Closes the local tunnel to BrowserStack
- Optional argument
--build <buildName>
- Returns results for a particular build, with links to the build data on BrowserStack
- Returns the list of available browsers
-
ember install ember-cli-browserstack
-
Register for a BrowserStack account
-
Set environment variables
BROWSERSTACK_USERNAME
andBROWSERSTACK_ACCESS_KEY
-
Add browsers to your
testem.js
. You can see available browsers by runningember 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', '<url>'], 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', '<url>'], protocol: 'browser' } }, launch_in_ci: [ 'bs_edge', 'Chrome' ]
To see available options, run
npx browserstack-launch --help
, with more info about what those options do available here: https://www.browserstack.com/automate/capabilities and https://github.com/scottgonzalez/node-browserstack#browser-objects Not all options are required. -
Open a tunnel to BrowserStack using
ember browserstack:connect
.This will create a
browserstack-local.pid
file, necessary for later disconnecting the tunnel. -
Run tests (
ember test
) You may need to specify--host 127.0.0.1
to support Safari -
When tests are complete, close the tunnel to BrowserStack using
ember browserstack:disconnect
When running on TravisCI, this addon will use the TRAVIS_JOB_NUMBER
environment variable to group the browsers run in that job.
There is a helper command ember browserstack:results
that will return links to each of the test runs in BrowserStack.
When running on Bitbucket Pipelines, this addon will use the BITBUCKET_BUILD_NUMBER
environment variable to group the browsers run in that job.
There is a helper command ember browserstack:results
that will return links to each of the test runs in BrowserStack.
The above will be prefixed with the env var BROWSERSTACK_BUILD_NAME_PREFIX, if set.
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.
See for more information: https://www.browserstack.com/local-testing/automate#multiple-local-testing-connections
git clone <repository-url>
this repositorycd ember-cli-browserstack
yarn install
npm link
- In another project,
npm link ember-cli-browserstack
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.
See the Contributing guide for details.
This project is licensed under the MIT License.