Skip to content

Commit

Permalink
test: Fix error with BrowserStack tests. (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbuso committed Feb 14, 2018
1 parent d6b6b28 commit e4722d0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
30 changes: 21 additions & 9 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,32 @@ the JavaScript and you can refresh the page to see your changes.
For information on submitting your changes, please take a look at
[CONTRIBUTING.md](https://github.com/googleads/videojs-ima/blob/master/CONTRIBUTING.md).

## Testing
Testing can be done by running the following:
```
npm test
```
If you're a member of our BrowserStack group and want to run tests on
BrowserStack, you must:
- Set your BROWSERSTACK_USER and BROWSERSTACK_ACCESS_KEY environment variables.
These values are available under "Automate" on the
[BrowserStack account settings page](https://www.browserstack.com/accounts/settings).
- Set the BROWSERSTACK_LOCAL_IDENTIFIER environment variable to a string of your
choice.
- Download the
[BrowserStackLocal binary](https://www.browserstack.com/automate/node) and run
`./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --local-identifier $BROWSERSTACK_LOCAL_IDENTIFIER`.

The BrowserStack tests will be skipped if the environment variables listed above are not set.

## Releasing
Releases should only be created by the repository owners. If you think we're in
need of a new release, please open an issue in our [issue
tracker](https://github.com/googleads/videojs-ima/issues).
Releases should only be created by the repository owners. If you're not an owner
and think we're in need of a new release, please open an issue in our
[issue tracker](https://github.com/googleads/videojs-ima/issues).

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
```
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,12 @@ ad break to play. To do so:
3. Call ```player.ima.playAdBreak()``` in your ad break ready listener when
you're ready to play the ads.

## API Docs
For a list of methods exposed by the plugin, see our full [API
Docs](https://github.com/googleads/videojs-ima/wiki/API-Docs).

## Where do I report issues?
Please report issues on the [issues page](../../issues).

## Terms of Service
The IMA SDK plugin for Video.js uses the IMA SDK, and as such is subject to the
[IMA SDK Terms of Service](https://developers.google.com/interactive-media-ads/terms).

## Support
If you have questions about the framework, you can ask them at
https://groups.google.com/d/forum/google-media-framework

## How do I contribute?
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
6 changes: 2 additions & 4 deletions test/webdriver/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ browsers.browsers.forEach(function(browser) {
describe('Basic Tests ' + browser.name, function() {

this.timeout(0);
this.slow(15000);

var webdriver = require('selenium-webdriver'),
until = webdriver.until;
Expand Down Expand Up @@ -57,9 +58,6 @@ browsers.browsers.forEach(function(browser) {
await driver.get('http://localhost:8080/test/webdriver/index.html?ad=linear');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
log.getText().then( (text) => {
console.log(text);
});
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementIsNotVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 14000);
Expand Down Expand Up @@ -128,4 +126,4 @@ browsers.browsers.forEach(function(browser) {
await driver.sleep();
});
});
});
});
7 changes: 1 addition & 6 deletions test/webdriver/content/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var browserstackCapabilities = {
'browserstack.local' : 'true',
'browserstack.localIdentifier' : process.env.BROWSERSTACK_LOCAL_IDENTIFIER,
'browserstack.user' : process.env.BROWSERSTACK_USER,
'browserstack.key' : process.env.BROWSERSTACK_KEY
'browserstack.key' : process.env.BROWSERSTACK_ACCESS_KEY
}

var browsers = [
Expand Down Expand Up @@ -67,11 +67,6 @@ 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 =
Expand Down

0 comments on commit e4722d0

Please sign in to comment.