]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix Grid focusable test. (#8029)
authorDenis <denis@vaadin.com>
Mon, 19 Dec 2016 08:55:05 +0000 (10:55 +0200)
committerPekka Hyvönen <pekka@vaadin.com>
Mon, 19 Dec 2016 08:55:05 +0000 (10:55 +0200)
* Fix Grid focusable test.

uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java
uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java

index 19867f9559800b37b98a7862afa566290fb35284..208f91d71d1f510ef9eccf77c3d4661feb2a7fb9 100644 (file)
@@ -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) {
index 96a19902eb53822fad0b12ea9573fb49750ce962..85aa8bea11fc64a40eef24c8cda603fd367754ac 100644 (file)
@@ -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(".."));
+    }
 }