aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-05-05 09:58:40 +0300
committerVaadin Code Review <review@vaadin.com>2015-05-05 09:38:46 +0000
commit23111dbd7003be2cca56f9686bfb8f40ea08b2bc (patch)
tree5ed84d053a942dd1ce2abd99d52749fa2aacc4ff /uitest/src
parentc1dd73a6b9530482713475a1b5eb7c77bff23084 (diff)
downloadvaadin-framework-23111dbd7003be2cca56f9686bfb8f40ea08b2bc.tar.gz
vaadin-framework-23111dbd7003be2cca56f9686bfb8f40ea08b2bc.zip
Convert MenuBarNavigationMouse test from TB2 to TB4
Change-Id: Ie6780b20fa4cf046a9adec6d550160b84d15e422
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/menubar/MenuBarNavigationMouseTest.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuBarNavigationMouseTest.java b/uitest/src/com/vaadin/tests/components/menubar/MenuBarNavigationMouseTest.java
new file mode 100644
index 0000000000..a4f8023ea2
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/menubar/MenuBarNavigationMouseTest.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.components.menubar;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elementsbase.ServerClass;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class MenuBarNavigationMouseTest extends MultiBrowserTest {
+
+ @ServerClass("com.vaadin.ui.MenuBar")
+ public static class MenuBarElement extends
+ com.vaadin.testbench.elements.MenuBarElement {
+
+ public void openMenuPath(String... captions) {
+ for (String c : captions) {
+ findElement(By.vaadin("#" + c)).click();
+ }
+ }
+ }
+
+ @Override
+ protected Class<?> getUIClass() {
+ return MenuBarNavigation.class;
+ }
+
+ @Test
+ public void testMenuBarMouseNavigation() throws Exception {
+ openTestURL();
+ MenuBarElement menuBar = $(MenuBarElement.class).first();
+ menuBar.openMenuPath("File", "Export..", "As PDF...");
+ Assert.assertEquals("1. MenuItem File/Export../As PDF... selected",
+ getLogRow(0));
+ menuBar.openMenuPath("Edit", "Copy");
+ Assert.assertEquals("2. MenuItem Edit/Copy selected", getLogRow(0));
+ menuBar.openMenuPath("Help");
+ Assert.assertEquals("3. MenuItem Help selected", getLogRow(0));
+ menuBar.openMenuPath("File", "Exit");
+ Assert.assertEquals("4. MenuItem File/Exit selected", getLogRow(0));
+ }
+}