From ea179b1a676a12d153878860a74055fac5dc6922 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 28 Sep 2012 21:41:08 +0300 Subject: [PATCH] Merged tests for height recalculation issue for TabSheet in TabSheet (#9275) Fix is not needed for Vaadin 7 Change-Id: Ib3f3c0abf91fdab7ccdb23344d5ab0bcb92806d5 --- .../tabsheet/TabsheetShouldUpdateHeight.html | 46 +++++++++++++++ .../tabsheet/TabsheetShouldUpdateHeight.java | 59 +++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html new file mode 100644 index 0000000000..2536ed50f6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html @@ -0,0 +1,46 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/TabsheetShouldUpdateHeight?restartApplication
mouseClickvaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]12,8
mouseClickvaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]21,4
clickvaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]18,3
screenCapturetab3
+ + diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java new file mode 100644 index 0000000000..af0cd8b49b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java @@ -0,0 +1,59 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Component; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class TabsheetShouldUpdateHeight extends TestBase { + + @Override + public void setup() { + final TabSheet tabsOuter = new TabSheet(); + final TabSheet tabsInner = new TabSheet(); + + final Component tab2; + + tabsInner.addTab(tab2 = getLayoutWithComponents(6, "tab2"), "Tab 2"); + tabsInner.addTab(getLayoutWithComponents(8, "tab3"), "Tab 3"); + + tabsOuter.addTab(tabsInner, "Inner tabs"); + tabsOuter.addTab(getLayoutWithComponents(10, "tab1"), "Tab 1"); + + final Button btnSwitch = new Button("switch to Tab2", + new Button.ClickListener() { + + public void buttonClick(final ClickEvent inEvent) { + tabsOuter.setSelectedTab(tabsInner); + tabsInner.setSelectedTab(tab2); + } + }); + + addComponent(tabsOuter); + addComponent(btnSwitch); + } + + private VerticalLayout getLayoutWithComponents(final int inAmount, String id) { + final VerticalLayout v = new VerticalLayout(); + v.setDebugId(id); + v.setSpacing(true); + v.setMargin(true); + for (int i = 0; i < inAmount; i++) { + v.addComponent(new TextField("Text field:")); + } + return v; + } + + @Override + protected String getDescription() { + return "click with mouse first on tab 3 and then on tab 1. now click on the button 'switch to tab2'. then click on tab 3 again and the scrollbars appear"; + } + + @Override + protected Integer getTicketNumber() { + return 9275; + } +} \ No newline at end of file -- 2.39.5