summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhe Sun <31067185+ZheSun88@users.noreply.github.com>2019-06-27 07:58:21 +0300
committerTatu Lund <tatu@vaadin.com>2019-06-27 07:58:21 +0300
commit4c4d0375c1efdf5d943ee2112bdd2160e0045af7 (patch)
tree9d03e0b627c99b48a67122d4392897b03a03c30c
parent487e450c61dd2eeaa32da3ec048dd0efb8fc7aa2 (diff)
downloadvaadin-framework-4c4d0375c1efdf5d943ee2112bdd2160e0045af7.tar.gz
vaadin-framework-4c4d0375c1efdf5d943ee2112bdd2160e0045af7.zip
Add Delay to unstable tests (#11638)
* Add Delay to unstable tests * Add sleep time
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldEventOrderTest.java1
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldWeekDaysTest.java13
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java3
3 files changed, 12 insertions, 5 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldEventOrderTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldEventOrderTest.java
index cead7d6f2b..e8496a37a3 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldEventOrderTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldEventOrderTest.java
@@ -29,6 +29,7 @@ public class DateTimeFieldEventOrderTest extends SingleBrowserTest {
new Select(timeSelects.get(0)).selectByValue("09");
findElement(By.id("test-button")).click();
+ sleep(100);
assertEquals("The button click event should come second.",
"2. Button Click Event", getLogRow(0));
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldWeekDaysTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldWeekDaysTest.java
index d46c737610..7b79b1b161 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldWeekDaysTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldWeekDaysTest.java
@@ -1,8 +1,5 @@
package com.vaadin.tests.components.datefield;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
@@ -13,6 +10,9 @@ import com.vaadin.testbench.elements.CheckBoxElement;
import com.vaadin.testbench.elements.DateTimeFieldElement;
import com.vaadin.tests.tb3.SingleBrowserTest;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
@Test
@@ -55,6 +55,7 @@ public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
openPopupAndValidateNoWeeknumbers();
+
$(ButtonElement.class).id("finnish").click();
openPopupAndValidateWeekNumbers();
@@ -65,7 +66,8 @@ public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
.findElement(By.className("v-datefield-button"));
// Open date popup
popupButton.click();
-
+ sleep(100);
+
waitUntil(ExpectedConditions.visibilityOfElementLocated(
org.openqa.selenium.By.className("v-datefield-popup")));
@@ -75,6 +77,7 @@ public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
.isEmpty());
// Close popup
popupButton.click();
+ sleep(100);
}
private void openPopupAndValidateNoWeeknumbers() {
@@ -82,6 +85,7 @@ public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
.findElement(By.className("v-datefield-button"));
// Open date popup
popupButton.click();
+ sleep(100);
waitUntil(ExpectedConditions.visibilityOfElementLocated(
org.openqa.selenium.By.className("v-datefield-popup")));
@@ -92,5 +96,6 @@ public class DateTimeFieldWeekDaysTest extends SingleBrowserTest {
.isEmpty());
// Close popup
popupButton.click();
+ sleep(100);
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java b/uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java
index d2b0eae6f5..2ba5cfa28f 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java
@@ -56,9 +56,10 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
builder2.click(textField);
builder2.sendKeys("third line");
+ sleep(100);
builder2.sendKeys(Keys.ENTER);
+ sleep(100);
builder2.sendKeys(Keys.ESCAPE);
-
builder2.perform();
assertEquals("1. Enter button pressed", getLogRow(1));