summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-28 09:15:01 +0200
committerArtur Signell <artur@vaadin.com>2012-11-28 09:23:51 +0200
commit268b3ca88dec3869562ff4129b99212f139f2233 (patch)
treee50b5b1750fd1383fb49ce33158e4811c0ac9a89 /uitest
parentd7fa318bfd22f4274bec57d09bb74d98e458fc1a (diff)
downloadvaadin-framework-268b3ca88dec3869562ff4129b99212f139f2233.tar.gz
vaadin-framework-268b3ca88dec3869562ff4129b99212f139f2233.zip
Always mark child hierarchy dirty when switching tabs (#10404)
Change-Id: Id6a0b23efb500d2c94bd696cc6eebfe5b5ffd60b
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.html77
-rw-r--r--uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.java113
2 files changed, 190 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.html
new file mode 100644
index 0000000000..19eff4f8b7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.html
@@ -0,0 +1,77 @@
+<?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://arturwin.office.itmill.com:8888/" />
+<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/com.vaadin.tests.components.tabsheet.TabSheetWithHasComponent?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VPopupView[0]</td>
+ <td>foo</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/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>24,5</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[1]/domChild[0]</td>
+ <td>2</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>66,3</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>A button</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/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>9,12</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td>5</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>24,8</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VPopupView[0]</td>
+ <td>13,10</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VPopupView[0]/VPopupView$CustomPopup[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>54,28</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithHasComponent::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VPopupView[0]/VPopupView$CustomPopup[0]/VTabsheet[0]/VTabsheetPanel[0]/VNativeButton[0]</td>
+ <td>Tab 2 inside popup</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.java
new file mode 100644
index 0000000000..2dd4993aca
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithHasComponent.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2012 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.tabsheet;
+
+import com.vaadin.data.Item;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.PopupView;
+import com.vaadin.ui.PopupView.Content;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.VerticalLayout;
+
+public class TabSheetWithHasComponent extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ TabSheet ts = new TabSheet();
+ ts.addComponent(createPopupView(createSmallTabSheet()));
+ ts.addComponent(createTable());
+ ts.addComponent(createPanel());
+ ts.addComponent(new CustomComponent(new Panel(
+ "Panel in custom component", new Button("In panel"))));
+
+ addComponent(ts);
+ }
+
+ private PopupView createPopupView(final Component content) {
+ PopupView pv = new PopupView(new Content() {
+
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return "foo";
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return content;
+ }
+
+ });
+ pv.setCaption("A popup view");
+ return pv;
+ }
+
+ protected TabSheet createSmallTabSheet() {
+ return new TabSheet(new Button("Tab1 inside popup"), new NativeButton(
+ "Tab 2 inside popup"));
+ }
+
+ private Panel createPanel() {
+ return new Panel("Panel containing stuff", new VerticalLayout(
+ new Label("A Label"), new Button("A button")));
+ }
+
+ private Table createTable() {
+ Table t = new Table("A table");
+ t.addContainerProperty("Column 1", String.class, "");
+ t.addContainerProperty("Column 2", Integer.class, null);
+ t.addGeneratedColumn("Generated", new ColumnGenerator() {
+
+ @Override
+ public Object generateCell(Table source, Object itemId,
+ Object columnId) {
+ if ("Item 2".equals(itemId)) {
+ return createPopupView(createSmallTabSheet());
+ } else {
+ return createPopupView(createPanel());
+ }
+ }
+ });
+ t.setPageLength(5);
+ for (int i = 1; i <= 5; i++) {
+ Item item = t.addItem("Item " + i);
+ item.getItemProperty("Column 1").setValue("Item " + i + " col 1");
+ item.getItemProperty("Column 2").setValue(i);
+ }
+ return t;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}