Skip to content

Commit

Permalink
test: Added Travis CI credentials for browserstack. (#511)
Browse files Browse the repository at this point in the history
* test: Added Travis CI credentials for browserstack.

* test: check for Travis pull request

* docs: updated DEVELOPING.md

* docs: added note about npm test
  • Loading branch information
ypavlotsky committed Feb 13, 2018
1 parent d7d7939 commit 6b6f124
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ env:
addons:
chrome: stable
firefox: latest
browserstack:
username: "adsdevrel1"
access_key:
secure: "KJVna2yQYeX9dwNLzNSTjMxjCxLa8d5wuxlq414TP+gKPlMjcLohi05C0nno73qlsYkPw+w7leG9tSP3gPFfylCKKGUqX6oXPEjo59SysTz+MQMnwglvdiAB5kVW5/AGdhWfnOGM5bsDHYVoDKe5M+xANOxIsQA3tMgUdV+gVVs="
scripts:
- npm run lint
- npm test

6 changes: 6 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ To create a new release, run the following:
npm version [major|minor|patch]
npm publish
```
Be sure to run the tests with Browserstack. To do so you'll need to set the
`BROWSERSTACK_USER` and `BROWSERSTACK_ACCESS_KEY` environment variables. Then run:

```
npm test
```
13 changes: 10 additions & 3 deletions test/webdriver/content/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var browserstackCapabilities = {
'build' : '1.0.5',
'project' : 'videojs_ima',
'browserstack.local' : 'true',
'browserstack.localIdentifier' : 'Test001',
'browserstack.localIdentifier' : process.env.BROWSERSTACK_LOCAL_IDENTIFIER,
'browserstack.user' : process.env.BROWSERSTACK_USER,
'browserstack.key' : process.env.BROWSERSTACK_KEY
}
Expand Down Expand Up @@ -67,15 +67,22 @@ var browsers = [
},
];

// For running locally.
if (process.env.BROWSERSTACK_LOCAL_IDENTIFIER === undefined) {
browserstackCapabilities['browserstack.localIdentifier'] = "Test001";
}

for (let browser of browsers) {
if (browser.server == 'http://hub-cloud.browserstack.com/wd/hub') {
browser.capabilities =
Object.assign(browser.capabilities, browserstackCapabilities);
}
}

if (process.env.BROWSERSTACK_USER === undefined ||
process.env.BROWSERSTACK_KEY === undefined) {
// Remove if we don't have browserstack credentials.
if (process.env.TRAVIS_PULL_REQUEST ||
process.env.BROWSERSTACK_USER === undefined ||
process.env.BROWSERSTACK_ACCESS_KEY === undefined) {
browsers = browsers.filter(browser =>
browser.server != 'http://hub-cloud.browserstack.com/wd/hub');
}
Expand Down

0 comments on commit 6b6f124

Please sign in to comment.