diff --git a/tests/frontend/specs/language.js b/tests/frontend/specs/language.js index 377e4a7f..254493c4 100644 --- a/tests/frontend/specs/language.js +++ b/tests/frontend/specs/language.js @@ -21,7 +21,13 @@ describe("Language select and change", function(){ $languageoption.attr('selected','selected'); $language.change(); - setTimeout(function(){ + helper.waitFor(function(){ + + var $boldButton = chrome$(".buttonicon-bold").parent(); + //get the title of the bold button + var boldButtonTitle = $boldButton[0]["title"]; + return boldButtonTitle !== undefined; + }).done(function(){ //get the value of the bold button var $boldButton = chrome$(".buttonicon-bold").parent(); @@ -33,7 +39,7 @@ describe("Language select and change", function(){ expect(boldButtonTitle).to.be("Fett (Strg-B)"); done(); - }, 1000); + }); }); it("makes text English", function(done) { @@ -52,7 +58,13 @@ describe("Language select and change", function(){ $languageoption.attr('selected','selected'); $language.change(); - setTimeout(function(){ + helper.waitFor(function(){ + + var $boldButton = chrome$(".buttonicon-bold").parent(); + //get the title of the bold button + var boldButtonTitle = $boldButton[0]["title"]; + return boldButtonTitle !== undefined; + }).done(function(){ //get the value of the bold button var $boldButton = chrome$(".buttonicon-bold").parent(); @@ -64,7 +76,7 @@ describe("Language select and change", function(){ expect(boldButtonTitle).to.be("Bold (Ctrl-B)"); done(); - }, 1000); + }); }); });