summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-06-21 13:31:33 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-06-21 13:31:33 +0300
commitbc296c69a3cf0cefd9f0b40be7eaf71c23923778 (patch)
treed1790e67ebcf81e8211126f3a6e5dcfae357bf73 /uitest
parenta0171e7cde3c50d5fbf7df548b0bd4de6f1ea3f0 (diff)
downloadvaadin-framework-bc296c69a3cf0cefd9f0b40be7eaf71c23923778.tar.gz
vaadin-framework-bc296c69a3cf0cefd9f0b40be7eaf71c23923778.zip
Fix Grid Editor in TabSheet test for Firefox (#10991)
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java
index 5b277f729f..53680699b6 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java
@@ -10,8 +10,10 @@ import org.openqa.selenium.Keys;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.testbench.elements.TabSheetElement;
+import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.testbench.parallel.TestCategory;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -93,7 +95,7 @@ public class GridInTabSheetTest extends MultiBrowserTest {
GridElement grid = $(GridElement.class).first();
- grid.getCell(0, 1).doubleClick();
+ editRow(grid, 0);
assertEquals("Editor should be open", "0",
grid.getEditor().getField(1).getAttribute("value"));
@@ -105,20 +107,30 @@ public class GridInTabSheetTest extends MultiBrowserTest {
assertFalse("Editor should be closed.",
grid.isElementPresent(By.vaadin("#editor")));
- grid.getCell(1, 1).doubleClick();
+ editRow(grid, 1);
assertEquals("Editor should open after tab switch", "1",
grid.getEditor().getField(1).getAttribute("value"));
// Close the current editor and reopen on a different row
grid.sendKeys(Keys.ESCAPE);
- grid.getCell(0, 1).doubleClick();
+ editRow(grid, 0);
assertEquals("Editor should move", "0",
grid.getEditor().getField(1).getAttribute("value"));
assertNoErrorNotifications();
}
+ protected void editRow(GridElement grid, int row) {
+ GridCellElement cell = grid.getCell(row, 1);
+ if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ cell.click();
+ grid.sendKeys(Keys.RETURN);
+ } else {
+ cell.doubleClick();
+ }
+ }
+
private void removeGridRow() {
$(ButtonElement.class).caption("Remove row from Grid").first().click();
}