diff options
author | Matti Tahvonen <matti@vaadin.com> | 2015-11-04 21:36:39 +0200 |
---|---|---|
committer | elmot <elmot@vaadin.com> | 2016-08-01 16:32:24 +0300 |
commit | b5e8654eaba15cb611ac74395d813d10cc6fedb1 (patch) | |
tree | efd6e28a45fd5c5b4e262d4133322d692f05284d /uitest | |
parent | 6688e6617275120bfc39cd31c464fd9b2a594a79 (diff) | |
download | vaadin-framework-b5e8654eaba15cb611ac74395d813d10cc6fedb1.tar.gz vaadin-framework-b5e8654eaba15cb611ac74395d813d10cc6fedb1.zip |
Fix disappearing ComboBox value (#19221)
Without the fix, when selecting a value from page n+1 and re-opening the
ComboBox popup, the content of the text box may disappear.
Change-Id: I5fb57c0e5a068645f4b11fb1c392e682dd04b06a
Diffstat (limited to 'uitest')
2 files changed, 17 insertions, 8 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java index f94306d2fa..a8a66b64ec 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java @@ -63,7 +63,7 @@ public class ComboBoxScrollingToPageDisabled extends protected String getDescription() { return "Test that selected value appears on the client " + "side even though setScrollToSelectedItem(false) " - + "has been called. Textbox should containe 'Item 50'."; + + "has been called. Textbox should contain 'Item 50'."; } @Override diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java index 8c09279b87..698a5fb49f 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java @@ -16,10 +16,10 @@ package com.vaadin.tests.components.combobox; import org.junit.Test; -import org.openqa.selenium.WebElement; -import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.LabelElement; import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.newelements.ComboBoxElement; /** * When pressed down key, while positioned on the last item - should show next @@ -34,11 +34,20 @@ public class ComboBoxScrollingToPageDisabledTest extends MultiBrowserTest { } @Test - public void checkValueIsVidinlr() throws InterruptedException { - WebElement input = driver.findElement(By - .className("v-filterselect-input")); - String value = input.getAttribute("value"); - org.junit.Assert.assertEquals("Item 50", value); + public void checkValueIsVisible() throws InterruptedException { + ComboBoxElement combo = $(ComboBoxElement.class).first(); + org.junit.Assert.assertEquals("Item 50", combo.getText()); } + @Test + public void checkLastValueIsVisible() throws InterruptedException { + ComboBoxElement combo = $(ComboBoxElement.class).first(); + combo.selectByText("Item 99"); + // this shouldn't clear the selection + combo.openPopup(); + // close popup + $(LabelElement.class).first().click(); + + org.junit.Assert.assertEquals("Item 99", combo.getText()); + } } |