diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-01-19 18:31:00 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-20 07:30:28 +0000 |
commit | 9e4130cd53c64a3bd9a8d7f49f1d6d35799f3179 (patch) | |
tree | b169003817976ef41a9eeec868203cde46a6b503 | |
parent | b3691eae81e3b3c4d2425286ba777fac71d0d8d2 (diff) | |
download | vaadin-framework-9e4130cd53c64a3bd9a8d7f49f1d6d35799f3179.tar.gz vaadin-framework-9e4130cd53c64a3bd9a8d7f49f1d6d35799f3179.zip |
Fix NotificationDelayTest for IE8 and Chrome. (#14689)
Change-Id: I3f92722ce9832ec2b748f2bf20477244597a8912
-rw-r--r-- | uitest/src/com/vaadin/tests/components/notification/NotificationDelayTest.java | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationDelayTest.java b/uitest/src/com/vaadin/tests/components/notification/NotificationDelayTest.java index 219d44710c..903c3440cc 100644 --- a/uitest/src/com/vaadin/tests/components/notification/NotificationDelayTest.java +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationDelayTest.java @@ -15,12 +15,13 @@ */ package com.vaadin.tests.components.notification; +import com.vaadin.tests.tb3.MultiBrowserTest; import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.interactions.Actions; - -import com.vaadin.tests.tb3.MultiBrowserTest; +import org.openqa.selenium.support.ui.ExpectedCondition; /** * Test to check notification delay. @@ -34,20 +35,16 @@ public class NotificationDelayTest extends MultiBrowserTest { openTestURL(); Assert.assertTrue("No notification found", hasNotification()); - Actions actions = new Actions(getDriver()); - actions.moveByOffset(10, 10).build().perform(); - long start = System.currentTimeMillis(); - boolean hidden = false; - while (System.currentTimeMillis() <= start + 5000) { - Thread.sleep(500); - hidden = !hasNotification(); - if (hidden) { - break; - } - } - Assert.assertTrue("Notification is still visible after 5 seconds", - hidden); + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + new Actions(getDriver()).moveByOffset(10, 10).perform(); + + return !hasNotification(); + } + }); } private boolean hasNotification() { |