Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
Refactor create-hoa test to avoid timing failures (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourcelf committed Apr 15, 2014
1 parent 0d0f2ee commit 1d264b7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/test.create-hoa.selenium.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,15 @@ describe("CREATE HOA", function() {
browser.switchTo().window(handles[0]);
});

browser.waitForSelector(".join-hoa");

// Wait for the hangout broadcast video to be embedded.
browser.waitForScript("$");
browser.waitForSelector(".join-hoa");
var embedSrcScript = "return $('.video-player iframe').attr('src');";
browser.executeScript(embedSrcScript).then(function(src) {
expect(src).to.not.be(null);
expect(src.indexOf("http://www.youtube.com/embed/" +
event.get("hoa").get("hangout-broadcast-id"))
).to.be(0);
browser.wait(function() {
return browser.executeScript(embedSrcScript).then(function(src) {
return src && src.indexOf("http://www.youtube.com/embed/" +
event.get("hoa").get("hangout-broadcast-id")) === 0;
});
});
browser.executeScript("return $('.join-hoa').attr('href');").then(function(href) {
expect(href).to.eql(event.get("hoa").getParticipationLink());
Expand Down

0 comments on commit 1d264b7

Please sign in to comment.