diff options
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java | 44 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java | 27 |
2 files changed, 71 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java new file mode 100644 index 0000000000..c21c702bd0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java @@ -0,0 +1,44 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.*; + +import javax.servlet.annotation.WebServlet; + +@SuppressWarnings("serial") +public class FirstTabNotVisibleInTabsheet extends AbstractTestUI { + + private TabSheet.Tab firstTab; + + @Override + protected void setup(VaadinRequest request) { + TabSheet tabSheet = new TabSheet(); + tabSheet.setWidth("600px"); + + firstTab = tabSheet.addTab(new Label("first visible tab"), "first visible tab"); + + for (int i = 2; i < 10; i++) { + tabSheet.addTab(new Label("visible tab " + i), "visible tab " + i); + } + + addComponent(new VerticalLayout(tabSheet, new Button("Toggle first tab", new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + firstTab.setVisible(!firstTab.isVisible()); + } + }))); + } + + @Override + protected Integer getTicketNumber() { + return 14644; + } + + @Override + protected String getTestDescription() { + return "First tabsheet tab is not set visible back once it gets invisible"; + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java new file mode 100644 index 0000000000..e57651ba03 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java @@ -0,0 +1,27 @@ +package com.vaadin.tests.components.tabsheet; + + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TabSheetElement; +import com.vaadin.tests.tb3.MultiBrowserTest; +import junit.framework.Assert; +import org.junit.Test; + +public class FirstTabNotVisibleInTabsheetTest extends MultiBrowserTest { + @Test + public void testFirstTabIsVisibleAfterBeingInvisible() { + openTestURL(); + + toggleFirstTabVisibility(); + toggleFirstTabVisibility(); + + TabSheetElement tabSheet = $(TabSheetElement.class).first(); + + Assert.assertTrue("TabSheet should have first tab visible", + tabSheet.getTabCaptions().contains("first visible tab")); + } + + private void toggleFirstTabVisibility() { + $(ButtonElement.class).caption("Toggle first tab").first().click(); + } +} |