From 8edf63c6446a5750e8f25423f57127577f451080 Mon Sep 17 00:00:00 2001 From: Seva Lotoshnikov Date: Thu, 10 Apr 2014 18:47:05 -0700 Subject: [PATCH] Deflaking tests Signed-off-by: Andreas Tolfsen --- java/client/test/org/openqa/selenium/PageLoadingTest.java | 4 ++-- javascript/atoms/test/click_link_test.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/java/client/test/org/openqa/selenium/PageLoadingTest.java b/java/client/test/org/openqa/selenium/PageLoadingTest.java index afbef83c45105..0240ef8c98fe1 100644 --- a/java/client/test/org/openqa/selenium/PageLoadingTest.java +++ b/java/client/test/org/openqa/selenium/PageLoadingTest.java @@ -398,7 +398,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() { start = System.currentTimeMillis(); driver.get(pages.xhtmlTestPage); - assertThat(driver.getTitle(), equalTo("XHTML Test Page")); + wait.until(titleIs("XHTML Test Page")); end = System.currentTimeMillis(); duration = (int) (end - start); assertThat(duration, lessThan(2000)); @@ -478,7 +478,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() { start = System.currentTimeMillis(); driver.get(pages.xhtmlTestPage); - assertThat(driver.getTitle(), equalTo("XHTML Test Page")); + wait.until(titleIs("XHTML Test Page")); end = System.currentTimeMillis(); duration = (int) (end - start); assertThat(duration, lessThan(2000)); diff --git a/javascript/atoms/test/click_link_test.html b/javascript/atoms/test/click_link_test.html index 4d5c40a21bef2..45e0f59f6db18 100644 --- a/javascript/atoms/test/click_link_test.html +++ b/javascript/atoms/test/click_link_test.html @@ -561,8 +561,10 @@ asyncTestCase = goog.testing.AsyncTestCase.createAndInstall(); // Android needs a longer timeout due to emulator slowness. // Opera 12, IE9+, Firefox 10 are sometimes slow to load new iframe pages. - if (goog.userAgent.product.ANDROID || bot.userAgent.IE_DOC_9) { + if (goog.userAgent.product.ANDROID) { asyncTestCase.stepTimeout = 5000; + } else if (bot.userAgent.IE_DOC_9) { + asyncTestCase.stepTimeout = 50000; } else if ((goog.userAgent.product.OPERA && bot.userAgent.isEngineVersion(12)) || (goog.userAgent.GECKO &&