summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-01-19 16:02:15 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-01-19 16:02:15 +0200
commit1adb7cea6a553274800e385483e2378e8c5b2802 (patch)
tree4ae0bc580b8f6f3c1f40fad68341273cc73215b7 /uitest
parent066c1ca542716a5bc9fabb8cc57ce3f6319ae956 (diff)
downloadvaadin-framework-1adb7cea6a553274800e385483e2378e8c5b2802.tar.gz
vaadin-framework-1adb7cea6a553274800e385483e2378e8c5b2802.zip
Fix closing of modal window curtains while dragging and resizing (#8281)
Fixes #7496
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java54
1 files changed, 48 insertions, 6 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
index 11b98174ba..c1f4d83e5d 100644
--- a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
@@ -1,14 +1,19 @@
package com.vaadin.tests.themes.valo;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.tests.ModalWindow;
import com.vaadin.tests.tb3.SingleBrowserTest;
-import org.junit.Test;
-import org.openqa.selenium.WebElement;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
public class ModalWindowTest extends SingleBrowserTest {
@@ -30,7 +35,44 @@ public class ModalWindowTest extends SingleBrowserTest {
is("none"));
}
+ @Test
+ public void modal_curtains_close_correctly() {
+ openTestURL();
+
+ openModalWindow();
+ new Actions(getDriver())
+ .moveToElement(findHeaderElement())
+ .clickAndHold().moveByOffset(1, 1).perform();
+ assertTrue(isElementPresent(By.className("v-window-draggingCurtain")));
+ new Actions(getDriver()).sendKeys(findHeaderElement(), Keys.ESCAPE)
+ .release().perform();
+ verifyCurtainsNotPresent();
+
+ openModalWindow();
+ new Actions(getDriver())
+ .moveToElement(findResizingElement())
+ .clickAndHold().moveByOffset(1, 1).perform();
+ assertTrue(isElementPresent(By.className("v-window-resizingCurtain")));
+ new Actions(getDriver()).sendKeys(findResizingElement(), Keys.ESCAPE)
+ .release().perform();
+ verifyCurtainsNotPresent();
+ }
+
private void openModalWindow() {
$(ButtonElement.class).get(1).click();
}
-} \ No newline at end of file
+
+ private WebElement findHeaderElement() {
+ return findElement(By.className("v-window-header"));
+ }
+
+ private WebElement findResizingElement() {
+ return findElement(By.className("v-window-resizebox"));
+ }
+
+ private void verifyCurtainsNotPresent() {
+ assertFalse(isElementPresent(By.className("v-window-modalitycurtain")));
+ assertFalse(isElementPresent(By.className("v-window-draggingCurtain")));
+ assertFalse(isElementPresent(By.className("v-window-resizingCurtain")));
+ }
+}