diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-05-19 16:30:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-19 16:30:14 +0300 |
commit | d4e66c2c3a33461ecfbc44cc2d0b7254e2567f82 (patch) | |
tree | f33d3c83306c5e813fb04e933fa66952d2e8f37c | |
parent | fbf5ec3561a25dfd3d27f52de1fe3b8a37b1f89a (diff) | |
download | vaadin-framework-d4e66c2c3a33461ecfbc44cc2d0b7254e2567f82.tar.gz vaadin-framework-d4e66c2c3a33461ecfbc44cc2d0b7254e2567f82.zip |
Fix menu item selection in tests (#9387)
When the parent span was not used, the size of the wrong span was used
in the calculation of mouse locations for activating a menu item. This
occasionally leads to the wrong submenu being opened on IE as the
cursor passed over the corner of the next item.
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java | 10 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java | 3 |
2 files changed, 2 insertions, 11 deletions
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 7079352912..0f074cf375 100644 --- a/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java +++ b/uitest/src/test/java/com/vaadin/tests/focusable/GridFocusableTest.java @@ -1,9 +1,5 @@ package com.vaadin.tests.focusable; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.By; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; import com.vaadin.tests.components.grid.basics.GridBasics; @@ -29,10 +25,4 @@ 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("..")); - } } diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java index c151e57e9c..8447e1e4d5 100644 --- a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -1080,8 +1080,9 @@ public abstract class AbstractTB3Test extends ParallelTest { */ protected WebElement getMenuElement(String menuCaption) throws NoSuchElementException { + // Need the parent span to obtain the correct size return getDriver().findElement( - By.xpath("//span[text() = '" + menuCaption + "']")); + By.xpath("//span[text() = '" + menuCaption + "']/..")); } /** |