]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merged tests for height recalculation issue for TabSheet in TabSheet (#9275) 19/19/2
authorArtur Signell <artur@vaadin.com>
Fri, 28 Sep 2012 18:41:08 +0000 (21:41 +0300)
committerVaadin Code Review <review@vaadin.com>
Sat, 29 Sep 2012 07:45:14 +0000 (07:45 +0000)
Fix is not needed for Vaadin 7

Change-Id: Ib3f3c0abf91fdab7ccdb23344d5ab0bcb92806d5

uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java [new file with mode: 0644]

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 (file)
index 0000000..2536ed5
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:9999/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/TabsheetShouldUpdateHeight?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=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]</td>
+       <td>12,8</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=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]</td>
+       <td>21,4</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=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]</td>
+       <td>18,3</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>tab3</td>
+</tr>
+</tbody></table>
+</body>
+</html>
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 (file)
index 0000000..af0cd8b
--- /dev/null
@@ -0,0 +1,59 @@
+package com.vaadin.tests.components.tabsheet;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+import com.vaadin.ui.Component;\r
+import com.vaadin.ui.TabSheet;\r
+import com.vaadin.ui.TextField;\r
+import com.vaadin.ui.VerticalLayout;\r
+\r
+public class TabsheetShouldUpdateHeight extends TestBase {\r
+\r
+    @Override\r
+    public void setup() {\r
+        final TabSheet tabsOuter = new TabSheet();\r
+        final TabSheet tabsInner = new TabSheet();\r
+\r
+        final Component tab2;\r
+\r
+        tabsInner.addTab(tab2 = getLayoutWithComponents(6, "tab2"), "Tab 2");\r
+        tabsInner.addTab(getLayoutWithComponents(8, "tab3"), "Tab 3");\r
+\r
+        tabsOuter.addTab(tabsInner, "Inner tabs");\r
+        tabsOuter.addTab(getLayoutWithComponents(10, "tab1"), "Tab 1");\r
+\r
+        final Button btnSwitch = new Button("switch to Tab2",\r
+                new Button.ClickListener() {\r
+\r
+                    public void buttonClick(final ClickEvent inEvent) {\r
+                        tabsOuter.setSelectedTab(tabsInner);\r
+                        tabsInner.setSelectedTab(tab2);\r
+                    }\r
+                });\r
+\r
+        addComponent(tabsOuter);\r
+        addComponent(btnSwitch);\r
+    }\r
+\r
+    private VerticalLayout getLayoutWithComponents(final int inAmount, String id) {\r
+        final VerticalLayout v = new VerticalLayout();\r
+        v.setDebugId(id);\r
+        v.setSpacing(true);\r
+        v.setMargin(true);\r
+        for (int i = 0; i < inAmount; i++) {\r
+            v.addComponent(new TextField("Text field:"));\r
+        }\r
+        return v;\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        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";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 9275;\r
+    }\r
+}
\ No newline at end of file