diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-05-05 09:58:40 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-05-05 09:38:46 +0000 |
commit | 23111dbd7003be2cca56f9686bfb8f40ea08b2bc (patch) | |
tree | 5ed84d053a942dd1ce2abd99d52749fa2aacc4ff | |
parent | c1dd73a6b9530482713475a1b5eb7c77bff23084 (diff) | |
download | vaadin-framework-23111dbd7003be2cca56f9686bfb8f40ea08b2bc.tar.gz vaadin-framework-23111dbd7003be2cca56f9686bfb8f40ea08b2bc.zip |
Convert MenuBarNavigationMouse test from TB2 to TB4
Change-Id: Ie6780b20fa4cf046a9adec6d550160b84d15e422
-rw-r--r-- | uitest/src/com/vaadin/tests/components/menubar/MenuBarNavigationMouseTest.java | 42 | ||||
-rw-r--r-- | uitest/tb2/com/vaadin/tests/components/menubar/MenuBarNavigationMouse.html | 81 |
2 files changed, 42 insertions, 81 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)); + } +} diff --git a/uitest/tb2/com/vaadin/tests/components/menubar/MenuBarNavigationMouse.html b/uitest/tb2/com/vaadin/tests/components/menubar/MenuBarNavigationMouse.html deleted file mode 100644 index 421966876b..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/menubar/MenuBarNavigationMouse.html +++ /dev/null @@ -1,81 +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.menubar.MenuBarNavigation?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]#item0</td> - <td>13,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::Root/VOverlay[0]/VMenuBar[0]#item4</td> - <td>41,4</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::Root/VOverlay[1]/VMenuBar[0]#item0</td> - <td>32,2</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>1. MenuItem File/Export../As PDF... selected</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]#item1</td> - <td>13,11</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::Root/VOverlay[0]/VMenuBar[0]#item0</td> - <td>18,11</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>2. MenuItem Edit/Copy selected</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]#item2</td> - <td>6,5</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>3. MenuItem Help selected</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]#item0</td> - <td>8,13</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::Root/VOverlay[0]/VMenuBar[0]#item6</td> - <td>18,9</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>4. MenuItem File/Exit selected</td> -</tr> -</tbody></table> -</body> -</html> |