Browse Source

Fixes unstable/muted tests (#11640)

tags/8.9.0.alpha1^0
Zhe Sun 4 years ago
parent
commit
35a9c4255f
No account linked to committer's email address

BIN
uitest/reference-screenshots/chrome/ThemeChangeOnTheFlyTest-reindeerToOthers_ANY_Chrome__reindeer.png View File


+ 3
- 3
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java View File

@@ -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

+ 5
- 4
uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java View File

@@ -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);
}

+ 7
- 8
uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java View File

@@ -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);
}
}

Loading…
Cancel
Save