diff options
author | Dmitrii Rogozin <dmitrii@vaadin.com> | 2014-06-17 14:43:34 +0300 |
---|---|---|
committer | Dmitrii Rogozin <dmitrii@vaadin.com> | 2014-06-18 16:10:13 +0300 |
commit | dd8cf12dde433198070f77d97d9220dd66a7e7d5 (patch) | |
tree | 81370b0bc8b0c6355967c9ad221b93af92e36a46 /uitest/src | |
parent | 54329d37c882a3b1b4e916258a40fafde5fc34c8 (diff) | |
download | vaadin-framework-dd8cf12dde433198070f77d97d9220dd66a7e7d5.tar.gz vaadin-framework-dd8cf12dde433198070f77d97d9220dd66a7e7d5.zip |
Bug fix menu navigation with space (#14041)
Change-Id: I1466381b12a147fea90240420d3f6c05cd156a1b
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java index 3e0053d0d1..a32a611d9a 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java +++ b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java @@ -1,12 +1,12 @@ /* * 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 @@ -23,10 +23,11 @@ import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.MenuBarElement; import com.vaadin.tests.tb3.MultiBrowserTest; /** - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -36,19 +37,21 @@ public class SpaceMenuBarNavigationTest extends MultiBrowserTest { public void testEnableParentLayout() { openTestURL(); - WebElement menu = driver.findElement(By.className("menu-bar")); + MenuBarElement menu = $(MenuBarElement.class).get(0); + menu.focus(); menu.sendKeys(Keys.ARROW_RIGHT); - menu.sendKeys(Keys.SPACE); + menu.sendKeys(Keys.ENTER); List<WebElement> captions = driver.findElements(By .className("v-menubar-menuitem-caption")); boolean found = false; + for (WebElement caption : captions) { if ("subitem".equals(caption.getText())) { found = true; } } - Assert.assertTrue("Sub menu is not opened on SPACE key", found); + Assert.assertTrue("Sub menu is not opened on ENTER key", found); menu.sendKeys(Keys.SPACE); |