From 93a42883a47908b573e27947a0f55ef77ed27aee Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 13 Mar 2017 16:14:42 +0200 Subject: [PATCH] Fix some tests for 7.7 --- tests/screenshots | 2 +- .../basicfeatures/GridColumnResizeModeTest.java | 11 +++++++---- .../treetable/TreeTablePartialUpdatesTest.java | 16 +++++++++++----- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/screenshots b/tests/screenshots index 17fe3eb960..3f7397e946 160000 --- a/tests/screenshots +++ b/tests/screenshots @@ -1 +1 @@ -Subproject commit 17fe3eb960b74fd5c36fc19fc8ae91347009abd7 +Subproject commit 3f7397e946b0aba1c0e1857547fc05cc2d512735 diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java index 8e767eb033..d24fe19639 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java @@ -39,17 +39,20 @@ public class GridColumnResizeModeTest extends GridBasicFeaturesTest { CustomGridElement grid = getGridElement(); + selectMenuPath("Component", "Columns", "Simple resize mode"); + sleep(250); + List handles = grid.findElements(By.className("v-grid-column-resize-handle")); WebElement handle = handles.get(1); - Actions drag1 = new Actions(getDriver()).moveToElement(handle).clickAndHold(); + // add 1px because of a glitch on IE9 and IE10 in our testing + // environment + Actions drag1 = new Actions(getDriver()).moveToElement(handle) + .moveByOffset(1, 0).clickAndHold(); Actions drag2 = new Actions(getDriver()).moveByOffset(-50, 0); Actions drag3 = new Actions(getDriver()).moveByOffset(100, 0); Actions dragEndAction = new Actions(getDriver()).release().moveToElement(grid); - selectMenuPath("Component", "Columns", "Simple resize mode"); - sleep(250); - drag1.perform(); sleep(500); drag2.perform(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesTest.java b/uitest/src/test/java/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesTest.java index d3eae2e653..e2abf4cef7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesTest.java @@ -28,6 +28,7 @@ import org.openqa.selenium.support.ui.ExpectedConditions; import com.vaadin.testbench.By; import com.vaadin.testbench.commands.TestBenchElementCommands; import com.vaadin.testbench.elements.TreeTableElement; +import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserTest; /** @@ -49,7 +50,7 @@ public class TreeTablePartialUpdatesTest extends MultiBrowserTest { // expand the first root element treeTable.getCell(0, 0) - .findElement(By.className("v-treetable-treespacer")).click(); + .findElement(By.className("v-treetable-treespacer")).click(); treeTable = $(TreeTableElement.class).first(); // wait for the scrollposition element to disappear @@ -67,7 +68,12 @@ public class TreeTablePartialUpdatesTest extends MultiBrowserTest { // scroll far enough down to drop the first row from the cache // but not far enough to reach the last row - scrollable.scroll(1692); + if (BrowserUtil.isChrome(getDesiredCapabilities())) { + // Chrome 56 requires different scroll position + scrollable.scroll(846); + } else { + scrollable.scroll(1692); + } // wait for the scrollposition element to disappear waitUntilNot(ExpectedConditions.visibilityOfElementLocated( @@ -119,7 +125,7 @@ public class TreeTablePartialUpdatesTest extends MultiBrowserTest { // expand the first root element treeTable.getCell(0, 0) - .findElement(By.className("v-treetable-treespacer")).click(); + .findElement(By.className("v-treetable-treespacer")).click(); // wait for the scrollposition element to disappear waitUntilNot(ExpectedConditions.visibilityOfElementLocated( @@ -151,7 +157,7 @@ public class TreeTablePartialUpdatesTest extends MultiBrowserTest { // expand the second root element treeTable.getCell(201, 0) - .findElement(By.className("v-treetable-treespacer")).click(); + .findElement(By.className("v-treetable-treespacer")).click(); // wait for the scrollposition element to disappear waitUntilNot(ExpectedConditions.visibilityOfElementLocated( @@ -168,7 +174,7 @@ public class TreeTablePartialUpdatesTest extends MultiBrowserTest { // collapse the second root element treeTable.getCell(201, 0) - .findElement(By.className("v-treetable-treespacer")).click(); + .findElement(By.className("v-treetable-treespacer")).click(); // wait for the scrollposition element to disappear waitUntilNot(ExpectedConditions.visibilityOfElementLocated( -- 2.39.5