aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2016-01-08 14:48:03 +0200
committerVaadin Code Review <review@vaadin.com>2016-01-08 13:26:21 +0000
commit4f8504dda08d74d21945117110664821cbca76ee (patch)
treee5e988675de8083a66130640dd67808f1c6ace21 /uitest/src/com/vaadin
parentc390b386ad0da0e0eac29665f0db77bd30cb5e5f (diff)
downloadvaadin-framework-4f8504dda08d74d21945117110664821cbca76ee.tar.gz
vaadin-framework-4f8504dda08d74d21945117110664821cbca76ee.zip
Convert TableContextMenuAndIcons test to TB4
Change-Id: I510617c5cd728a3bf0b27d706e11c6c3f12ee19e
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableContextMenuAndIconsTest.java64
1 files changed, 64 insertions, 0 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