diff options
Diffstat (limited to 'uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java b/uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java index acbd022be4..3c5f52a38a 100644 --- a/uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java @@ -2,9 +2,13 @@ package com.vaadin.tests.application; import static org.junit.Assert.assertEquals; +import java.util.concurrent.TimeUnit; + import org.junit.Test; +import org.openqa.selenium.TimeoutException; import com.vaadin.testbench.By; +import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserTest; public class RefreshFragmentChangeTest extends MultiBrowserTest { @@ -15,9 +19,19 @@ public class RefreshFragmentChangeTest extends MultiBrowserTest { @Test public void testFragmentChange() throws Exception { + getDriver().manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS); openTestURL(); assertLogText("1. Initial fragment: null"); - getDriver().get(getTestUrl() + "#asdf"); + + try { + getDriver().get(getTestUrl() + "#asdf"); + } catch (TimeoutException e) { + // Chrome throws timeout exception even when loading is successful + if (!BrowserUtil.isChrome(getDesiredCapabilities())) { + throw e; + } + } + assertLogText("2. Fragment changed to asdf"); openTestURL(); assertLogText("3. Fragment changed to null"); |