Skip to content

Commit

Permalink
test: Re-enable browserstack tests, 2nd attempt. (#657)
Browse files Browse the repository at this point in the history
* test: increased browserstack test timeout values

* test: upped first tests time
  • Loading branch information
ypavlotsky authored Jun 13, 2018
1 parent 8dab561 commit 02b9852
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
30 changes: 15 additions & 15 deletions test/webdriver/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,79 +49,79 @@ browsers.browsers.forEach(function(browser) {
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=linear');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.wait(until.elementIsVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 10000);
By.id('content_video_ima-controls-div'))), 25000);
});

it( 'Hides controls when ad ends ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=linear');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.wait(until.elementIsNotVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 14000);
By.id('content_video_ima-controls-div'))), 24000);
await driver.sleep();
});

it( 'Plays content when ad ends ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=linear');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.wait(until.elementIsNotVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 14000);
await driver.wait(until.elementTextContains(log, 'playing'), 10000);
By.id('content_video_ima-controls-div'))), 24000);
await driver.wait(until.elementTextContains(log, 'playing'), 20000);
await driver.sleep();
});

it( 'Displays skip ad button ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=skippable');
await driver.findElement(By.id('content_video')).click();
let log = driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.switchTo().frame(driver.findElement(
By.css('#content_video_ima-ad-container > div:nth-child(1) > iframe')));
let skipButton = await driver.findElement(
By.css('body > div.videoAdUi > div.videoAdUiSkipContainer.html5-stop-propagation > button'));
await driver.wait(until.elementIsVisible(skipButton), 10000);
await driver.wait(until.elementIsVisible(skipButton), 20000);
await driver.sleep();
});

it( 'VMAP: Preroll ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=vmap_preroll');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.wait(until.elementIsVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 10000);
By.id('content_video_ima-controls-div'))), 20000);
await driver.sleep();
});

it( 'VMAP: Midroll ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=vmap_midroll');
await driver.findElement(By.id('content_video')).click();
await driver.wait(until.elementIsVisible(driver.findElement(
By.id('content_video_ima-controls-div'))), 10000);
By.id('content_video_ima-controls-div'))), 20000);
await driver.sleep();
});

it( 'Nonlinear ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=nonlinear');
await driver.findElement(By.id('content_video')).click();
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, 'start'), 10000);
await driver.wait(until.elementTextContains(log, 'start'), 20000);
await driver.switchTo().frame(driver.findElement(
By.css('#content_video_ima-ad-container > div:nth-child(1) > iframe')));
await driver.wait(until.elementIsVisible(driver.findElement(
By.id('GDFP'))), 10000);
By.id('GDFP'))), 20000);
await driver.sleep();
});

it( 'Handles ad error 303: wrappers ' + browser.name, async function(){
await driver.get('http://localhost:8000/test/webdriver/index.html?ad=error_303');
let log = await driver.findElement(By.id('log'));
await driver.wait(until.elementTextContains(log, '303'), 10000);
await driver.wait(until.elementTextContains(log, '303'), 20000);
await driver.sleep();
});
});
Expand Down
3 changes: 2 additions & 1 deletion test/webdriver/content/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ var options = {
disableFlagAds: true,
adTagUrl: adTags[adTagName],
adsManagerLoadedCallback: onAdsManagerLoaded,
debug: true
debug: true,
vastLoadTimeout: 15000
};

player.ima(options);
Expand Down
4 changes: 2 additions & 2 deletions test/webdriver/content/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var browsers = [
'moz:firefoxOptions' : {args: ['-headless']}
}
},
/*{
{
name: 'browserstack-win10-chrome',
server: 'http://hub-cloud.browserstack.com/wd/hub',
capabilities: {
Expand All @@ -66,7 +66,7 @@ var browsers = [
'os_version' : '10',
'resolution' : '1024x768',
}
},*/
},
];

for (let browser of browsers) {
Expand Down

0 comments on commit 02b9852

Please sign in to comment.