summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-10-10 22:43:03 +0300
committerPekka Hyvönen <pekka@vaadin.com>2016-12-09 09:39:00 +0200
commit16c54b33c4c66edfc20f42b09e1726de67931c96 (patch)
tree16d78c91af5a249ca62eb6dbffc915ad748854ea /uitest
parent97a75f1abcbd1c9001a7ff5b75713e3a913748cb (diff)
downloadvaadin-framework-16c54b33c4c66edfc20f42b09e1726de67931c96.tar.gz
vaadin-framework-16c54b33c4c66edfc20f42b09e1726de67931c96.zip
Make modal window block shortcuts for underlying components (#20366)
Change-Id: Ibb3b52b652d77a1bfa786417b1c92fd0a578035f
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java b/uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java
index a10721136d..7c14ae0864 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java
@@ -17,7 +17,9 @@ package com.vaadin.tests.components.ui;
import org.junit.Assert;
import org.junit.Test;
+import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.TextFieldElement;
@@ -41,4 +43,19 @@ public class WindowAndUIShortcutsTest extends SingleBrowserTest {
Assert.assertTrue(
$(ButtonElement.class).caption("Close page").exists());
}
+
+ @Test
+ public void modalCurtainShouldNotTriggerShortcuts() {
+ openTestURL();
+ $(ButtonElement.class).caption("Show page").first().click();
+ $(ButtonElement.class).caption("Open dialog window").first().click();
+
+ WebElement curtain = findElement(
+ By.className("v-window-modalitycurtain"));
+ curtain.sendKeys(Keys.ESCAPE);
+ // "Close page" should not have been clicked
+ Assert.assertTrue(
+ $(ButtonElement.class).caption("Close page").exists());
+
+ }
}