aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2020-04-08 12:17:11 +0300
committerGitHub <noreply@github.com>2020-04-08 12:17:11 +0300
commita486f6480979e93812cb1236e89e41d03f79d448 (patch)
treea271c0dfcbb6ba3be88553ca1ca77baf400b5840 /uitest
parent368f350c98053f75a317c3430929e9eb0a388f23 (diff)
downloadvaadin-framework-a486f6480979e93812cb1236e89e41d03f79d448.tar.gz
vaadin-framework-a486f6480979e93812cb1236e89e41d03f79d448.zip
Set DateField value only if it passes range check (#11887)
Fixes #11108
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldBinderCrossValidationTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFaultyInputNotValidTest.java5
2 files changed, 6 insertions, 1 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldBinderCrossValidationTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldBinderCrossValidationTest.java
index efbbf3f999..4a47f3786a 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldBinderCrossValidationTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldBinderCrossValidationTest.java
@@ -30,6 +30,8 @@ public class DateFieldBinderCrossValidationTest extends SingleBrowserTest {
fromFieldText.sendKeys("2019/01/01", Keys.ENTER);
toFieldText.sendKeys("2018/02/02", Keys.ENTER);
+ sleep(200);
+
assertEquals("Error message should contain the information",
EXPECTED_ERROR, label.getText());
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFaultyInputNotValidTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFaultyInputNotValidTest.java
index 3a3b6cd069..87cb115ae5 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFaultyInputNotValidTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFaultyInputNotValidTest.java
@@ -6,7 +6,9 @@ import java.time.LocalDate;
import org.junit.Test;
import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.WebElement;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.DateFieldElement;
@@ -46,6 +48,7 @@ public class DateFieldFaultyInputNotValidTest extends SingleBrowserTest {
public void testDateOutOfRange() {
openTestURL();
DateFieldElement dateField = $(DateFieldElement.class).first();
+ WebElement dateFieldText = dateField.findElement(By.tagName("input"));
dateField.setDate(LocalDate.now());
$(ButtonElement.class).first().click();
@@ -53,7 +56,7 @@ public class DateFieldFaultyInputNotValidTest extends SingleBrowserTest {
$(NotificationElement.class).first().getText());
$(NotificationElement.class).first().close();
- dateField.setDate(LocalDate.now().minusDays(7));
+ dateFieldText.sendKeys(LocalDate.now().minusDays(7).toString(), Keys.ENTER);
$(ButtonElement.class).first().click();
assertEquals("Last week should not be ok", "Fail",