From ed39788d71a5cf5c88e3a58b770b3dd2985c3560 Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Sat, 24 Oct 2015 11:10:17 -0200 Subject: [PATCH] Fix flaky tests introduced by #2805 --- tests/frontend/specs/indentation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/frontend/specs/indentation.js b/tests/frontend/specs/indentation.js index 71aafc7ac..de92cc8fe 100644 --- a/tests/frontend/specs/indentation.js +++ b/tests/frontend/specs/indentation.js @@ -80,7 +80,9 @@ describe("indentation button", function(){ $firstTextElement.sendkeys("line with '{{}'{enter}"); helper.waitFor(function(){ - return inner$("div span").first().text().indexOf("line with '{'") === -1; + // wait for Etherpad to split four lines into separated divs + var $fourthLine = inner$("div").first().next().next().next(); + return $fourthLine.text().indexOf("line with '{'") === 0; }).done(function(){ // we validate bottom to top for easier implementation @@ -126,7 +128,9 @@ describe("indentation button", function(){ $firstTextElement.sendkeys("line 2{enter}"); helper.waitFor(function(){ - return inner$("div span").first().text().indexOf("line 2") === -1; + // wait for Etherpad to split two lines into separated divs + var $secondLine = inner$("div").first().next(); + return $secondLine.text().indexOf("line 2") === 0; }).done(function(){ var $lineWithColon = inner$("div").first(); $lineWithColon.sendkeys(':');