aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAnastasia Smirnova <anasmi@utu.fi>2018-04-09 10:56:46 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-04-09 10:56:46 +0300
commitfb712d074ce91f743d74623021566c1e999d5b62 (patch)
tree7672bc8bdc17c2e6de027c505a46f906617908c4 /uitest
parent8d0afd8690239688514db52e16d37ef77fd5ed1a (diff)
downloadvaadin-framework-fb712d074ce91f743d74623021566c1e999d5b62.tar.gz
vaadin-framework-fb712d074ce91f743d74623021566c1e999d5b62.zip
Ensure that popup is closed in Tabsheet (#10738)
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheet.java34
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheetTest.java29
2 files changed, 63 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheet.java b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheet.java
new file mode 100644
index 0000000000..ab1ce3bc28
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheet.java
@@ -0,0 +1,34 @@
+package com.vaadin.tests.components.popupview;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.*;
+
+public class PopUpViewInTabsheet extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ CssLayout layout = new CssLayout();
+ addComponent(layout);
+
+ VerticalLayout popupContent = new VerticalLayout();
+ popupContent.setId("content");
+ PopupView popup = new PopupView("Pop it up", popupContent);
+ popupContent.addComponent(new Button("Button"));
+
+ popup.setHideOnMouseOut(false);
+ popup.setId("popupId");
+ popup.setHeight("40px");
+
+ TabSheet tabsheet = new TabSheet();
+
+ VerticalLayout tab1 = new VerticalLayout();
+ tab1.addComponent(popup);
+ tabsheet.addTab(tab1, "Mercury").setId("tab0");
+ VerticalLayout tab2 = new VerticalLayout();
+ tab2.addComponent(new TextField("Enter"));
+ tab2.setCaption("Venus");
+ tabsheet.addTab(tab2).setId("tab1");
+ layout.addComponent(tabsheet);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheetTest.java b/uitest/src/test/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheetTest.java
new file mode 100644
index 0000000000..eefd6b2f6c
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/popupview/PopUpViewInTabsheetTest.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.components.popupview;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class PopUpViewInTabsheetTest extends MultiBrowserTest {
+
+ @Before
+ public void testPopupView() {
+ openTestURL();
+ }
+
+ @Test
+ public void testPopUpNotVisisble() {
+ WebElement view = findElement(By.className("v-popupview"));
+ view.click();
+ assertTrue(
+ findElement(By.className("v-popupview-popup")).isDisplayed());
+ findElement(By.id("tab1")).click();
+ findElement(By.id("tab0")).click();
+ assertTrue(findElements(By.className("v-popupview-popup")).isEmpty());
+ }
+}