diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2018-03-08 14:04:54 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-03-08 14:04:54 +0200 |
commit | ead24c18282f793231c4ef5015851731693153a8 (patch) | |
tree | 80b7000a61d6df473a9c13797c6e508cd989525b /uitest/src/test | |
parent | 9c54c201a3baa215857c97394c3d331b0cd7e993 (diff) | |
download | vaadin-framework-ead24c18282f793231c4ef5015851731693153a8.tar.gz vaadin-framework-ead24c18282f793231c4ef5015851731693153a8.zip |
Clear VComboBox selection fields when updated on server (#10692)
Fixes #10660
Diffstat (limited to 'uitest/src/test')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxMixedUpdateTest.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxMixedUpdateTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxMixedUpdateTest.java new file mode 100644 index 0000000000..8644f829e3 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxMixedUpdateTest.java @@ -0,0 +1,51 @@ +package com.vaadin.tests.components.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ComboBoxMixedUpdateTest extends MultiBrowserTest { + + private ComboBoxElement comboBox; + private ButtonElement reset; + private ButtonElement show; + + @Override + public void setup() throws Exception { + super.setup(); + + openTestURL(); + waitForElementPresent(By.className("v-filterselect")); + comboBox = $(ComboBoxElement.class).first(); + reset = $(ButtonElement.class).id("reset"); + show = $(ButtonElement.class).id("show"); + } + + private void sendKeysToInput(CharSequence... keys) { + comboBox.clear(); + // ensure mouse is located over the ComboBox to avoid hover issues + new Actions(getDriver()).moveToElement(comboBox).perform(); + comboBox.sendKeys(keys); + } + + @Test + public void testMixedUpdateWorks() { + comboBox.focus(); + sendKeysToInput("2", Keys.TAB); + show.click(); + assertEquals("1. Bean value = 2 - ComboBox value = 2", getLogRow(0)); + reset.click(); + show.click(); + assertEquals("2. Bean value = 0 - ComboBox value = 0", getLogRow(0)); + sendKeysToInput("2", Keys.TAB); + show.click(); + assertEquals("3. Bean value = 2 - ComboBox value = 2", getLogRow(0)); + } +} |