diff options
author | Anna Koskinen <anna@vaadin.com> | 2014-08-01 16:07:52 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-08-05 07:54:54 +0000 |
commit | 4466651d75bbec5339d5a5e45ed093db8d60ae84 (patch) | |
tree | 17d2b2826da834660ce09bbc716fa35efe1cd6fa /uitest/src | |
parent | f19976f1f14c83bce148618acfa29c7d5fa96c68 (diff) | |
download | vaadin-framework-4466651d75bbec5339d5a5e45ed093db8d60ae84.tar.gz vaadin-framework-4466651d75bbec5339d5a5e45ed093db8d60ae84.zip |
TableItemDescriptionGenerator test upgrade (#14292)
Change-Id: Ica328a6e68c684119b1c0c627e5e1451aaf8b391
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html | 418 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUI.java (renamed from uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java) | 15 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUITest.java | 241 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableTooltips.html | 91 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.html | 357 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUI.java (renamed from uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.java) | 8 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUITest.java | 143 |
7 files changed, 396 insertions, 877 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html deleted file mode 100644 index 4c2dec9784..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html +++ /dev/null @@ -1,418 +0,0 @@ -<?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:8888/" /> -<title>TableItemDescriptionGeneratorTest</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">TableItemDescriptionGeneratorTest</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/TableItemDescriptionGeneratorTest?restartApplication</td> - <td></td> -</tr> -<!--All on--> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Text</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Button 1 description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Textfield's own description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Cell and row tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>12,6</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Text</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Component</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Generated component</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Row and Component tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>7,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCheckBox[0]/domChild[0]</td> - <td>7,5</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Button 1 description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Textfield's own description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Row tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>7,8</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementPositionLeft</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td>-5000</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUI.java index ec81194f14..809e639448 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUI.java @@ -5,7 +5,8 @@ import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.components.TestBase; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; @@ -13,7 +14,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; -public class TableItemDescriptionGeneratorTest extends TestBase { +public class TableItemDescriptionGeneratorUI extends AbstractTestUI { private final String TEXT_PROPERTY_ID = "Text"; private final String GEN_WIDGET_PROPERTY_ID = "Generated component"; @@ -23,7 +24,7 @@ public class TableItemDescriptionGeneratorTest extends TestBase { private CheckBox tableRowItemDescription; @Override - protected void setup() { + protected void setup(VaadinRequest request) { final Table table = createTable(); table.setId("table"); componentDescription = new CheckBox("Tooltip on components"); @@ -73,7 +74,7 @@ public class TableItemDescriptionGeneratorTest extends TestBase { if (propertyId == null && tableRowItemDescription.getValue()) { return "Row description " + itemId; } else if (tableCellItemDescription.getValue()) { - return "Cell description " + itemId + "," + propertyId; + return "Cell description " + itemId + ", " + propertyId; } return null; } @@ -100,7 +101,7 @@ public class TableItemDescriptionGeneratorTest extends TestBase { } @Override - protected String getDescription() { + protected String getTestDescription() { return "Cells and rows should have tooltips"; } @@ -109,13 +110,12 @@ public class TableItemDescriptionGeneratorTest extends TestBase { return 5414; } + @SuppressWarnings("unchecked") private Container createContainer(boolean description) { IndexedContainer container = new IndexedContainer(); container.addContainerProperty(TEXT_PROPERTY_ID, String.class, ""); container.addContainerProperty(WIDGET_PROPERTY_ID, Component.class, null); - // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class, - // ""); for (int i = 0; i < 5; i++) { Item item = container.addItem("item " + i); @@ -125,7 +125,6 @@ public class TableItemDescriptionGeneratorTest extends TestBase { b.setDescription("Button " + i + " description"); } item.getItemProperty(WIDGET_PROPERTY_ID).setValue(b); - // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i); } return container; diff --git a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUITest.java b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUITest.java new file mode 100644 index 0000000000..555a38a91e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUITest.java @@ -0,0 +1,241 @@ +/* + * Copyright 2000-2014 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.table; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elements.CheckBoxElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.TooltipTest; + +/** + * Tests Table tooltips with various settings. + * + * @author Vaadin Ltd + */ +public class TableItemDescriptionGeneratorUITest extends TooltipTest { + + @Test + public void testDescriptions() throws Exception { + openTestURL(); + + checkTooltipNotPresent(); + + TableElement table = $(TableElement.class).first(); + List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all(); + assertEquals(3, checkboxes.size()); + + // check text description + TestBenchElement cell_1_0 = table.getCell(1, 0); + cell_1_0.showTooltip(); + checkTooltip("Cell description item 1, Text"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check button description + TestBenchElement cell_1_1 = table.getCell(1, 1); + cell_1_1.showTooltip(); + checkTooltip("Button 1 description"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check textfield's description + TestBenchElement cell_1_2 = table.getCell(1, 2); + cell_1_2.showTooltip(); + checkTooltip("Textfield's own description"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // uncheck component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = table.getCell(1, 0); + cell_1_0.showTooltip(); + checkTooltip("Cell description item 1, Text"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check button description + cell_1_1 = table.getCell(1, 1); + cell_1_1.showTooltip(); + checkTooltip("Cell description item 1, Component"); + + // move somewhere without a description + new Actions(getDriver()).moveToElement(checkboxes.get(2)).perform(); + sleep(1000); + checkTooltipNotPresent(); + + // check textfield's description + cell_1_2 = table.getCell(1, 2); + cell_1_2.showTooltip(); + checkTooltip("Cell description item 1, Generated component"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + // uncheck cell tooltips + checkboxes.get(1).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = table.getCell(1, 0); + cell_1_0.showTooltip(); + checkTooltip("Row description item 1"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check button description + cell_1_1 = table.getCell(1, 1); + cell_1_1.showTooltip(); + checkTooltip("Button 1 description"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check textfield's description + cell_1_2 = table.getCell(1, 2); + cell_1_2.showTooltip(); + checkTooltip("Textfield's own description"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // uncheck component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = table.getCell(1, 0); + cell_1_0.showTooltip(); + checkTooltip("Row description item 1"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check button description + cell_1_1 = table.getCell(1, 1); + cell_1_1.showTooltip(); + checkTooltip("Row description item 1"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + + // check textfield's description + cell_1_2 = table.getCell(1, 2); + cell_1_2.showTooltip(); + checkTooltip("Row description item 1"); + + // move somewhere without a description + checkboxes.get(2).showTooltip(); + checkTooltipNotPresent(); + } + + @Test + public void testPosition() throws Exception { + openTestURL(); + + TableElement table = $(TableElement.class).first(); + List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all(); + assertEquals(3, checkboxes.size()); + + TestBenchElement cell_3_0 = table.getCell(3, 0); + + // move to the center of the cell + new Actions(getDriver()).moveToElement(cell_3_0).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Cell description item 3, Text"); + clearTooltip(); + + // move outside the cell + new Actions(getDriver()).moveToElement(checkboxes.get(2)).perform(); + + // move to the corner of the cell + new Actions(getDriver()).moveToElement(cell_3_0, 0, 0).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Cell description item 3, Text"); + clearTooltip(); + + // uncheck cell tooltips + checkboxes.get(1).findElement(By.tagName("input")).click(); + + TestBenchElement cell_1_1 = table.getCell(1, 1); + + // move to the center of the cell + new Actions(getDriver()).moveToElement(cell_1_1).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Button 1 description"); + clearTooltip(); + + // move to the corner of the element, outside of the button + new Actions(getDriver()).moveToElement(cell_1_1, 0, 0).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Row description item 1"); + clearTooltip(); + + // check cell tooltips + checkboxes.get(1).findElement(By.tagName("input")).click(); + + TestBenchElement cell_4_2 = table.getCell(4, 2); + + // move to the center of the cell + new Actions(getDriver()).moveToElement(cell_4_2).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Textfield's own description"); + clearTooltip(); + + // move to the corner of the element, outside of the textfield + new Actions(getDriver()).moveToElement(cell_4_2, 0, 0).perform(); + sleep(1000); + + // ensure the tooltip is present + checkTooltip("Cell description item 4, Generated component"); + clearTooltip(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableTooltips.html b/uitest/src/com/vaadin/tests/components/table/TableTooltips.html deleted file mode 100644 index 13ceea935f..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/TableTooltips.html +++ /dev/null @@ -1,91 +0,0 @@ -<?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="" /> -<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.table.TableItemDescriptionGeneratorTest?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseMove</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td> - <td>57,5</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td>1000</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 3,Text</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>810,153</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>355,350</td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>822,249</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[1]</td> - <td>90,12</td> -</tr> -<tr> - <td>mouseMove</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td> - <td>57,12</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td>1000</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>1011,283</td> -</tr> -<tr> - <td>mouseMove</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[4]/VTextField[0]</td> - <td>58,10</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td>1000</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Textfield's own description</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.html deleted file mode 100644 index 7f2f61bfc3..0000000000 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.html +++ /dev/null @@ -1,357 +0,0 @@ -<?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/TreeTableItemDescriptionGeneratorTest?restartApplication</td> - <td></td> -</tr> -<!--All on--> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Text</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Button 1 description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Textfield's own description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Cell and row tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>12,6</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Text</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Component</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Cell description item 1,Generated component</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Row and Component tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>7,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCheckBox[0]/domChild[0]</td> - <td>7,5</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Button 1 description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Textfield's own description</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Row tooltips--> -<tr> - <td>mouseClick</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td> - <td>7,8</td> -</tr> -<!--Text tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Button tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--TextField tooltip--> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>Row description item 1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td> - <td>22,7</td> -</tr> -<tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> - <td></td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUI.java index 2864156b03..ba057f4c41 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorTest.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUI.java @@ -15,14 +15,16 @@ */ package com.vaadin.tests.components.treetable; -import com.vaadin.tests.components.table.TableItemDescriptionGeneratorTest; +import com.vaadin.tests.components.table.TableItemDescriptionGeneratorUI; import com.vaadin.ui.Table; import com.vaadin.ui.TreeTable; -public class TreeTableItemDescriptionGeneratorTest extends - TableItemDescriptionGeneratorTest { +public class TreeTableItemDescriptionGeneratorUI extends + TableItemDescriptionGeneratorUI { + @Override protected Table createTable() { return new TreeTable(); } + } diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUITest.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUITest.java new file mode 100644 index 0000000000..849d19cafa --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableItemDescriptionGeneratorUITest.java @@ -0,0 +1,143 @@ +/* + * Copyright 2000-2014 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.treetable; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import org.junit.Test; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elements.CheckBoxElement; +import com.vaadin.testbench.elements.TreeTableElement; +import com.vaadin.tests.tb3.TooltipTest; + +/** + * Tests TreeTable tooltips with various settings. + * + * @author Vaadin Ltd + */ +public class TreeTableItemDescriptionGeneratorUITest extends TooltipTest { + + @Test + public void testDescriptions() throws Exception { + openTestURL(); + + checkTooltipNotPresent(); + + TreeTableElement treeTable = $(TreeTableElement.class).first(); + List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all(); + assertEquals(3, checkboxes.size()); + + // check text description + TestBenchElement cell_1_0 = treeTable.getCell(1, 0); + checkTooltip(cell_1_0, "Cell description item 1, Text"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check button description + TestBenchElement cell_1_1 = treeTable.getCell(1, 1); + checkTooltip(cell_1_1, "Button 1 description"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check textfield's description + TestBenchElement cell_1_2 = treeTable.getCell(1, 2); + checkTooltip(cell_1_2, "Textfield's own description"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // uncheck component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = treeTable.getCell(1, 0); + checkTooltip(cell_1_0, "Cell description item 1, Text"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check button description + cell_1_1 = treeTable.getCell(1, 1); + checkTooltip(cell_1_1, "Cell description item 1, Component"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check textfield's description + cell_1_2 = treeTable.getCell(1, 2); + checkTooltip(cell_1_2, "Cell description item 1, Generated component"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + // uncheck cell tooltips + checkboxes.get(1).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = treeTable.getCell(1, 0); + checkTooltip(cell_1_0, "Row description item 1"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check button description + cell_1_1 = treeTable.getCell(1, 1); + checkTooltip(cell_1_1, "Button 1 description"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check textfield's description + cell_1_2 = treeTable.getCell(1, 2); + checkTooltip(cell_1_2, "Textfield's own description"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // uncheck component tooltips + checkboxes.get(0).findElement(By.tagName("input")).click(); + + // check text description + cell_1_0 = treeTable.getCell(1, 0); + checkTooltip(cell_1_0, "Row description item 1"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check button description + cell_1_1 = treeTable.getCell(1, 1); + checkTooltip(cell_1_1, "Row description item 1"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + + // check textfield's description + cell_1_2 = treeTable.getCell(1, 2); + checkTooltip(cell_1_2, "Row description item 1"); + + // move somewhere without a description + checkTooltip(checkboxes.get(2), null); + } + +} |