diff options
author | Henri Sara <hesara@vaadin.com> | 2016-01-08 14:48:03 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-01-08 13:26:21 +0000 |
commit | 4f8504dda08d74d21945117110664821cbca76ee (patch) | |
tree | e5e988675de8083a66130640dd67808f1c6ace21 /uitest | |
parent | c390b386ad0da0e0eac29665f0db77bd30cb5e5f (diff) | |
download | vaadin-framework-4f8504dda08d74d21945117110664821cbca76ee.tar.gz vaadin-framework-4f8504dda08d74d21945117110664821cbca76ee.zip |
Convert TableContextMenuAndIcons test to TB4
Change-Id: I510617c5cd728a3bf0b27d706e11c6c3f12ee19e
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableContextMenuAndIconsTest.java | 64 | ||||
-rw-r--r-- | uitest/tb2/com/vaadin/tests/components/table/TableContextMenuAndIcons.html | 187 |
2 files changed, 64 insertions, 187 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableContextMenuAndIconsTest.java b/uitest/src/com/vaadin/tests/components/table/TableContextMenuAndIconsTest.java new file mode 100644 index 0000000000..558098e2f1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableContextMenuAndIconsTest.java @@ -0,0 +1,64 @@ +package com.vaadin.tests.components.table; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TableContextMenuAndIconsTest extends MultiBrowserTest { + @Override + protected Class<?> getUIClass() { + return com.vaadin.tests.components.table.Tables.class; + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + return getBrowsersSupportingContextMenu(); + } + + @Test + public void tableContextMenuWithIcons() throws Exception { + openTestURL(); + /* Hide event log */ + selectMenuPath("Settings", "Show event log"); + /* Simple context menu */ + selectMenuPath("Component", "Features", "Context menu", + "Item without icon"); + contextClickCell(1, 1); + compareScreen("contextmenu-noicon"); + /* Two actions, without and with icon */ + selectMenuPath("Component", "Features", "Context menu", + "With and without icon"); + contextClickCell(4, 2); + compareScreen("caption-only-and-has-icon"); + /* Large icon */ + selectMenuPath("Component", "Features", "Context menu", + "Only one large icon"); + contextClickCell(4, 2); + compareScreen("large-icon"); + /* + * Simple context menu again to ensure it is properly updated (icons + * removed) + */ + selectMenuPath("Component", "Features", "Context menu", + "Item without icon"); + contextClickCell(1, 1); + compareScreen("contextmenu-noicon"); + /* Empty context menu */ + selectMenuPath("Component", "Features", "Context menu", "Empty"); + contextClickCell(3, 3); + compareScreen("contextmenu-empty"); + } + + private void contextClickCell(int row, int column) { + TestBenchElement cell = $(TableElement.class).first().getCell(row, + column); + new Actions(driver).contextClick(cell).perform(); + } + +}
\ No newline at end of file diff --git a/uitest/tb2/com/vaadin/tests/components/table/TableContextMenuAndIcons.html b/uitest/tb2/com/vaadin/tests/components/table/TableContextMenuAndIcons.html deleted file mode 100644 index 82f1e63d6b..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/table/TableContextMenuAndIcons.html +++ /dev/null @@ -1,187 +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>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.Tables?restartApplication</td> - <td></td> -</tr> -<!--Hide event log--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item1</td> - <td>19,7</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item0</td> - <td>32,7</td> -</tr> -<!--Simple context menu--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> - <td>28,7</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> - <td>57,11</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td> - <td>68,4</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item1</td> - <td>69,7</td> -</tr> -<tr> - <td>contextMenuAt</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[1]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>contextmenu-noicon</td> -</tr> -<!--Two actions, without and with icon--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> - <td>42,7</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> - <td>52,6</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td> - <td>53,3</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item2</td> - <td>31,4</td> -</tr> -<tr> - <td>contextMenuAt</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[2]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>caption-only-and-has-icon</td> -</tr> -<!--Large icon--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> - <td>42,7</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> - <td>52,6</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td> - <td>53,3</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item3</td> - <td>31,4</td> -</tr> -<tr> - <td>contextMenuAt</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[2]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>large-icon</td> -</tr> -<!--Simple context menu again to ensure it is properly updated (icons removed)--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> - <td>28,7</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> - <td>57,11</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td> - <td>68,4</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item1</td> - <td>69,7</td> -</tr> -<tr> - <td>contextMenuAt</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[1]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>contextmenu-noicon</td> -</tr> -<!--Empty context menu--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> - <td>25,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> - <td>72,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td> - <td>77,2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item4</td> - <td>48,5</td> -</tr> -<tr> - <td>contextmenu</td> - <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[3]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>contextmenu-empty</td> -</tr> -</tbody></table> -</body> -</html> |