|
|
@@ -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()); |
|
|
|
|
|
|
|
} |
|
|
|
} |