diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2018-02-02 12:25:35 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-02-02 12:25:35 +0200 |
commit | d2ef29e5b41d45f291d087760b02e212c75ff9eb (patch) | |
tree | f13c6e19627f96c11a8edce9d49e72e6867f3ed6 /uitest/src/test | |
parent | 875c98972e9c3da25a7c9c54cb267871921d4804 (diff) | |
download | vaadin-framework-d2ef29e5b41d45f291d087760b02e212c75ff9eb.tar.gz vaadin-framework-d2ef29e5b41d45f291d087760b02e212c75ff9eb.zip |
Add flush() implementation to DateField (#10518)
Fixes #10488
Diffstat (limited to 'uitest/src/test')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldShortcutTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldShortcutTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldShortcutTest.java new file mode 100644 index 0000000000..3e01a41b43 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldShortcutTest.java @@ -0,0 +1,39 @@ +package com.vaadin.tests.components.datefield; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.DateFieldElement; +import com.vaadin.testbench.elements.NotificationElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +import static org.junit.Assert.assertEquals; + +public class DateFieldShortcutTest extends SingleBrowserTest { + + private static final String DATEFIELD_VALUE_ORIGINAL = "11/01/2018"; + private static final String DATEFIELD_VALUE_MODIFIED = "21/01/2018"; + + @Test + public void modifyValueAndPressEnter() { + openTestURL(); + + DateFieldElement dateField = $(DateFieldElement.class).first(); + WebElement dateFieldText = dateField.findElement(By.tagName("input")); + + assertEquals("DateField value should be \"" + DATEFIELD_VALUE_ORIGINAL + + "\"", DATEFIELD_VALUE_ORIGINAL, dateField.getValue()); + + dateFieldText.click(); + dateFieldText.sendKeys(Keys.HOME, Keys.DELETE, "2"); + dateFieldText.sendKeys(Keys.ENTER); + + assertEquals("DateField value should be \"" + DATEFIELD_VALUE_MODIFIED + + "\"", DATEFIELD_VALUE_MODIFIED, dateField.getValue()); + + assertEquals(DATEFIELD_VALUE_MODIFIED, + $(NotificationElement.class).first().getCaption()); + } +} |