From e4722d0256e120eedebf857196f89e6e2a1365d8 Mon Sep 17 00:00:00 2001 From: Shawn Busolits Date: Wed, 14 Feb 2018 13:24:57 -0500 Subject: [PATCH] test: Fix error with BrowserStack tests. (#519) --- DEVELOPING.md | 30 ++++++++++++++++++-------- README.md | 8 ------- test/webdriver/basic.js | 6 ++---- test/webdriver/content/capabilities.js | 7 +----- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index 82a317e2..7f4706bc 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -17,10 +17,28 @@ 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: @@ -28,9 +46,3 @@ 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 -``` diff --git a/README.md b/README.md index afd468c1..54be855d 100644 --- a/README.md +++ b/README.md @@ -124,10 +124,6 @@ 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). @@ -135,9 +131,5 @@ Please report issues on the [issues page](../../issues). 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. diff --git a/test/webdriver/basic.js b/test/webdriver/basic.js index fffd63ac..cbe7e2b3 100644 --- a/test/webdriver/basic.js +++ b/test/webdriver/basic.js @@ -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; @@ -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); @@ -128,4 +126,4 @@ browsers.browsers.forEach(function(browser) { await driver.sleep(); }); }); -}); \ No newline at end of file +}); diff --git a/test/webdriver/content/capabilities.js b/test/webdriver/content/capabilities.js index 30362312..ce3ae8bf 100644 --- a/test/webdriver/content/capabilities.js +++ b/test/webdriver/content/capabilities.js @@ -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 = [ @@ -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 =