aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java
new file mode 100644
index 0000000000..abbc7ddac0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownTest.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.components.window;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.WindowElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ExtraWindowShownTest extends MultiBrowserTest {
+
+ @Test
+ public void testNoExtraWindowAfterClosing() throws Exception {
+ openTestURL();
+
+ openWindow();
+ closeWindow();
+ assertNoWindow();
+
+ openWindow();
+ closeWindow();
+ assertNoWindow();
+ }
+
+ private void openWindow() {
+ $(ButtonElement.class).first().click();
+ }
+
+ private void closeWindow() {
+ $(WindowElement.class).$(ButtonElement.class).first().click();
+ }
+
+ private void assertNoWindow() {
+ Assert.assertFalse("Window found when there should be none.",
+ $(WindowElement.class).exists());
+ }
+}