summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-05-13 17:05:26 +0300
committerVaadin Code Review <review@vaadin.com>2014-05-13 14:50:49 +0000
commitdd8528b5ce83aee4e9b4d44cad4ce3ad8d92d88d (patch)
treea31aadd8fc6d384589a72c0be7af1af3747696a2 /uitest
parentaa8761cc6338f48b4fa53025f0c8b02db15b9491 (diff)
downloadvaadin-framework-dd8528b5ce83aee4e9b4d44cad4ce3ad8d92d88d.tar.gz
vaadin-framework-dd8528b5ce83aee4e9b4d44cad4ce3ad8d92d88d.zip
Fix DateFieldFastForwardTest to close browser context menu
Change-Id: Ib8c6e45a8f77630e71b6f5264d6d42dc5efe922d
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java
index 028160cc5d..63d96e9bf9 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java
@@ -17,11 +17,13 @@ package com.vaadin.tests.components.datefield;
import static org.junit.Assert.assertEquals;
+import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
+import com.vaadin.testbench.elements.VerticalLayoutElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class DateFieldFastForwardTest extends MultiBrowserTest {
@@ -29,21 +31,28 @@ public class DateFieldFastForwardTest extends MultiBrowserTest {
@Test
public void testFastForwardOnRightMouseClick() throws Exception {
openTestURL();
-
+ String firstMonth = getSelectedMonth();
WebElement nextMonthButton = driver.findElement(By
.className("v-button-nextmonth"));
// Click and hold left mouse button to start fast forwarding.
new Actions(driver).clickAndHold(nextMonthButton).perform();
- Thread.sleep(1000);
+ sleep(1000);
// Right click and release the left button.
+
new Actions(driver).contextClick(nextMonthButton)
.release(nextMonthButton).perform();
// Now the fast forwarding should be ended, get the expected month.
String expectedMonth = getSelectedMonth();
+ // Make browser context menu disappear, since it will crash IE
+ $(VerticalLayoutElement.class).first().click();
+
+ Assert.assertFalse("Month did not change during fast forward",
+ firstMonth.equals(expectedMonth));
+
// Wait for a while.
Thread.sleep(1000);