diff options
author | Denis <denis@vaadin.com> | 2016-12-19 10:55:05 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-19 10:55:05 +0200 |
commit | d3d8abd5383bda40b8fb6e957b50025ba761d5f0 (patch) | |
tree | 2dfb298069e2d97dfd33113b3f8a637607b90779 /uitest | |
parent | 6b51788ee7c2a8b147744bc11d220fb3ed896672 (diff) | |
download | vaadin-framework-d3d8abd5383bda40b8fb6e957b50025ba761d5f0.tar.gz vaadin-framework-d3d8abd5383bda40b8fb6e957b50025ba761d5f0.zip |
Fix Grid focusable test. (#8029)
* Fix Grid focusable test.
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java | 9 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java index 19867f9559..208f91d71d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java @@ -382,6 +382,11 @@ public class GridBasics extends AbstractTestUIWithLog { } private void createStateMenu(MenuItem stateMenu) { + MenuItem tabIndexMenu = stateMenu.addItem("Tab index", null); + addGridMethodMenu(tabIndexMenu, "0", 0, grid::setTabIndex); + addGridMethodMenu(tabIndexMenu, "-1", -1, grid::setTabIndex); + addGridMethodMenu(tabIndexMenu, "10", 10, grid::setTabIndex); + MenuItem frozenColMenu = stateMenu.addItem("Frozen column count", null); for (int i = -1; i < 3; ++i) { addGridMethodMenu(frozenColMenu, "" + i, i, @@ -463,10 +468,6 @@ public class GridBasics extends AbstractTestUIWithLog { createSelectionMenu(stateMenu); stateMenu.addItem("Set focus", item -> grid.focus()); - MenuItem tabIndexMenu = stateMenu.addItem("Tab index", null); - addGridMethodMenu(tabIndexMenu, "0", 0, grid::setTabIndex); - addGridMethodMenu(tabIndexMenu, "-1", -1, grid::setTabIndex); - addGridMethodMenu(tabIndexMenu, "10", 10, grid::setTabIndex); } private void createRowStyleMenu(MenuItem rowStyleMenu) { diff --git a/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java b/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java index 96a19902eb..85aa8bea11 100644 --- a/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java +++ b/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java @@ -1,5 +1,9 @@ package com.vaadin.tests.focusable; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; import com.vaadin.testbench.customelements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; import com.vaadin.tests.components.grid.basics.GridBasics; @@ -25,4 +29,10 @@ public class GridFocusableTest extends AbstractFocusableComponentTest { protected GridCellElement getFocusElement() { return $(GridElement.class).first().getCell(0, 0); } + + @Override + protected WebElement getMenuElement(String menuCaption) + throws NoSuchElementException { + return super.getMenuElement(menuCaption).findElement(By.xpath("..")); + } } |