diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2019-10-25 10:41:51 +0300 |
---|---|---|
committer | Tatu Lund <tatu@vaadin.com> | 2019-10-25 10:41:51 +0300 |
commit | 1e764045e3b013a1944f07be16986d61472deacd (patch) | |
tree | 6d0676e72072ecfb9dffd162ac2cd06f6ecb72f5 | |
parent | 7f5fd0b1737d54afb5e2d79cb29f2905319c7417 (diff) | |
download | vaadin-framework-1e764045e3b013a1944f07be16986d61472deacd.tar.gz vaadin-framework-1e764045e3b013a1944f07be16986d61472deacd.zip |
Tweak a test to open Grid details row by clicking cell instead of row. (#11764)
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java index 0e0e21a424..ae92382ae2 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java @@ -1,5 +1,10 @@ package com.vaadin.tests.components.grid; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.number.IsCloseTo.closeTo; +import static org.junit.Assert.fail; + import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -7,6 +12,7 @@ import java.util.Map.Entry; import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridRowElement; @@ -14,11 +20,6 @@ import com.vaadin.testbench.elements.RadioButtonGroupElement; import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.number.IsCloseTo.closeTo; -import static org.junit.Assert.fail; - /** * Tests that Grid gets correct height based on height mode, and resizes * properly with details row if height is undefined. @@ -85,7 +86,9 @@ public class GridHeightTest extends MultiBrowserTest { } GridRowElement row = grid.getRow(2); - row.click(getXOffset(row, 5), getYOffset(row, 5)); + WebElement cell = row.findElements(By.className("v-grid-cell")) + .get(0); + cell.click(); waitForElementPresent(By.id("lbl1")); int openHeight = grid.getSize().getHeight(); @@ -98,7 +101,7 @@ public class GridHeightTest extends MultiBrowserTest { detailsRowHeight, "opened" }); } - row.click(5, 5); + cell.click(); waitForElementNotPresent(By.id("lbl1")); int afterHeight = grid.getSize().getHeight(); |