From 35a9c4255f1d46f4aa8e27b26ea2cd25def50ab0 Mon Sep 17 00:00:00 2001 From: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Date: Fri, 28 Jun 2019 09:08:07 +0300 Subject: Fixes unstable/muted tests (#11640) --- ...yTest-reindeerToOthers_ANY_Chrome__reindeer.png | Bin 113274 -> 113161 bytes .../combobox/ComboBoxClosePopupRetainTextTest.java | 6 +++--- .../grid/GridResizeHiddenColumnTest.java | 9 +++++---- .../components/window/WindowTwinColSelectTest.java | 15 +++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/uitest/reference-screenshots/chrome/ThemeChangeOnTheFlyTest-reindeerToOthers_ANY_Chrome__reindeer.png b/uitest/reference-screenshots/chrome/ThemeChangeOnTheFlyTest-reindeerToOthers_ANY_Chrome__reindeer.png index 4a637d1b80..6b4ff93467 100644 Binary files a/uitest/reference-screenshots/chrome/ThemeChangeOnTheFlyTest-reindeerToOthers_ANY_Chrome__reindeer.png and b/uitest/reference-screenshots/chrome/ThemeChangeOnTheFlyTest-reindeerToOthers_ANY_Chrome__reindeer.png differ diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java index be8bad5e87..ae829d080c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java @@ -1,7 +1,5 @@ package com.vaadin.tests.components.combobox; -import static org.junit.Assert.assertEquals; - import org.junit.Test; import org.openqa.selenium.WebElement; @@ -9,6 +7,8 @@ import com.vaadin.testbench.By; import com.vaadin.testbench.elements.ComboBoxElement; import com.vaadin.tests.tb3.MultiBrowserTest; +import static org.junit.Assert.assertEquals; + public class ComboBoxClosePopupRetainTextTest extends MultiBrowserTest { @Override protected Class getUIClass() { @@ -37,7 +37,7 @@ public class ComboBoxClosePopupRetainTextTest extends MultiBrowserTest { ComboBoxElement cb = $(ComboBoxElement.class).first(); cb.selectByText("Item 3"); WebElement textbox = cb.findElement(By.vaadin("#textbox")); - textbox.clear(); + cb.clear(); textbox.sendKeys("I"); // Close the open suggestions popup // Uses #clickElement instead of ComboBoxElement#openPopup() due to an diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java index 1a6a03aea1..8c2529a509 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java @@ -1,9 +1,5 @@ package com.vaadin.tests.components.grid; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - import java.util.List; import org.junit.Before; @@ -18,6 +14,10 @@ import com.vaadin.testbench.elements.GridElement.GridCellElement; import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + public class GridResizeHiddenColumnTest extends MultiBrowserTest { @Before @@ -74,6 +74,7 @@ public class GridResizeHiddenColumnTest extends MultiBrowserTest { for (GridCellElement e : headerCells) { widthSum += e.getSize().getWidth(); } + sleep(100); assertEquals("'Last Name' column should take up the remaining space", grid.getHeader().getSize().getWidth(), widthSum, 1d); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java index 829632023e..3e197d2281 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java @@ -1,9 +1,5 @@ package com.vaadin.tests.components.window; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - import org.junit.Test; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; @@ -12,6 +8,9 @@ import com.vaadin.testbench.By; import com.vaadin.testbench.elements.TwinColSelectElement; import com.vaadin.tests.tb3.MultiBrowserTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + public class WindowTwinColSelectTest extends MultiBrowserTest { @Test @@ -23,8 +22,8 @@ public class WindowTwinColSelectTest extends MultiBrowserTest { WebElement selectionsElement = twinColSelect.getSelectionsElement(); assertTrue(optionsElement.isDisplayed()); assertTrue(selectionsElement.isDisplayed()); - assertThat(selectionsElement.getLocation().getY(), - is(optionsElement.getLocation().getY())); + assertEquals("Coordinate is not matching within the tolerance", + optionsElement.getLocation().getY(), selectionsElement.getLocation().getY(), 3); } @Test @@ -41,7 +40,7 @@ public class WindowTwinColSelectTest extends MultiBrowserTest { WebElement selectionsElement = twinColSelect.getSelectionsElement(); assertTrue(optionsElement.isDisplayed()); assertTrue(selectionsElement.isDisplayed()); - assertThat(selectionsElement.getLocation().getY(), - is(optionsElement.getLocation().getY())); + assertEquals("Coordinate is not matching within the tolerance.", + optionsElement.getLocation().getY(), selectionsElement.getLocation().getY(), 3); } } -- cgit v1.2.3