diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-07-17 14:08:30 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-07-17 14:08:30 +0300 |
commit | 01a453649e1c4ace5ea1e2b8dcf18102a639d0f1 (patch) | |
tree | 62121fcbb1f3627801286876f778fec36f9173b4 /uitest | |
parent | 6c61a9797ce364cc706eb468605512b7d6d537cd (diff) | |
download | vaadin-framework-01a453649e1c4ace5ea1e2b8dcf18102a639d0f1.tar.gz vaadin-framework-01a453649e1c4ace5ea1e2b8dcf18102a639d0f1.zip |
Fix combobox adding new items on blur (#9660)
Fixes #9071
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java index 0765c2781a..d61bb26dad 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java @@ -21,6 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.junit.Test; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedCondition; import com.vaadin.testbench.By; @@ -65,6 +66,14 @@ public class ComboBoxSelectingWithNewItemsAllowedTest extends MultiBrowserTest { } @Test + public void itemIsAddedWithClickOut() { + typeInputAndClickOut("a"); + + assertOneMoreThanInitial(); + assertThatSelectedValueIs("a"); + } + + @Test public void matchingSuggestionIsSelectedWithEnter() { typeInputAndHitEnter("a0"); @@ -204,6 +213,13 @@ public class ComboBoxSelectingWithNewItemsAllowedTest extends MultiBrowserTest { sendKeysToInput(Keys.TAB); } + private void typeInputAndClickOut(String input) { + clearInputAndType(input); + new Actions(getDriver()).moveToElement(comboBoxElement, 10, 10) + .moveByOffset(comboBoxElement.getSize().getWidth(), 0).click() + .perform(); + } + private void clearInputAndType(String input) { comboBoxElement.clear(); sendKeysToInput(input); |