Created
June 13, 2016 12:42
-
-
Save chris-gunawardena/a17fd303bf45c6245fbe4e21e11c2818 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global browser */ | |
var assert = require('assert'); | |
describe('Viraliaze video player', function () { | |
it('should load ad and start playing', function () { | |
browser.url('/'); | |
browser.waitForExist('#ima-ad-container iframe', 10000); | |
// http://imasdk.googleapis.com/js/core/bridge3.130.0_en.html#goog_96574024 | |
browser.frame(0); | |
browser.waitForExist('iframe[src*="vpaid.js"]', 10000); | |
// iframe needs a name or a id for frame() to work | |
// http://tpc.googlesyndication.com/pagead/js/loader12.html?http://localhost:9000/scripts/vpaid.js | |
browser.execute(function () { | |
var iframe = document.querySelector('iframe[src*="vpaid.js"]') | |
iframe.id = "vpaid_js"; | |
iframe.name = "vpaid_js"; | |
}); | |
browser.frame('vpaid_js'); | |
browser.waitForExist('#viralize-player-iframe', 10000); | |
// javascript:false | |
browser.frame(0); | |
assert.equal(browser.isExisting('.vr-ad-logo'), true, 'Viraliaze player was loaded'); | |
assert.equal(browser.isExisting('.vr-ad-progress-bar'), true, 'Viraliaze ad started playing'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment