diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-11-05 13:22:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 13:22:28 +0200 |
commit | db5e6c20a2c976abec73b5ed237da20e4abb4536 (patch) | |
tree | 757e34b5d0cd6b48d6ce1eedd4faf7ec5a3afcae /uitest | |
parent | 907c222e55b0fcd7c9f28f6206dbe742b93eb233 (diff) | |
download | vaadin-framework-db5e6c20a2c976abec73b5ed237da20e4abb4536.tar.gz vaadin-framework-db5e6c20a2c976abec73b5ed237da20e4abb4536.zip |
GridThemeUITest fix (#12470) (#12473)
Attempt to stabilize the screenshot comparison by ensuring that the
editor is fully opened.
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java index ccb5f10df2..519a012414 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java @@ -3,8 +3,10 @@ package com.vaadin.v7.tests.components.grid; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.support.ui.ExpectedCondition; import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.DateFieldElement; @@ -76,7 +78,25 @@ public class GridThemeUITest extends MultiBrowserThemeTest { new Actions(getDriver()).doubleClick(targetCell).perform(); waitForElementPresent(By.className("v-grid-editor")); } - + WebElement editor = findElement(By.className("v-grid-editor")); + waitUntil(new ExpectedCondition<Boolean>() { + @Override + public Boolean apply(WebDriver arg0) { + int current = editor.getSize().getHeight(); + // it's actually expected to be the height of two rows plus one + // pixel, but giving it 2 pixels of leeway + int expected = targetCell.getSize().getHeight() * 2 - 1; + return current >= expected; + } + + @Override + public String toString() { + // Expected condition failed: waiting for ... + return "editor to become visible, current height: " + + editor.getSize().getHeight() + ", row height: " + + targetCell.getSize().getHeight(); + } + }); } private void selectPage(String string) { |