From 79eef54a5435f4df8ab6c0fb65efd2497f298b8d Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 6 May 2015 14:03:22 +0300 Subject: Fix ComboBoxMouseSelectEnterTest to work with old ComboBox Change-Id: Ida5e8ecbde47246cf4f282855ee38a32b71a9915 --- .../combobox/ComboBoxMouseSelectEnterTest.java | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxMouseSelectEnterTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxMouseSelectEnterTest.java index d24f6dc28f..7336b5112f 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxMouseSelectEnterTest.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxMouseSelectEnterTest.java @@ -35,30 +35,31 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class ComboBoxMouseSelectEnterTest extends MultiBrowserTest { - private ComboBoxElement comboBoxElement; + @Test + public void enterSetsValueSelectedByMouseOver() { + openTestURL(); + WebElement textBoxElement = $(ComboBoxElement.class).first() + .findElement(By.vaadin("#textbox")); + textBoxElement.click(); - @Override - public void setup() throws Exception { + /* Open popup */ + new Actions(getDriver()).sendKeys(Keys.ARROW_DOWN).perform(); + /* Move focus */ + new Actions(getDriver()).sendKeys(Keys.ARROW_DOWN).perform(); - super.setup(); - openTestURL(); - waitForElementPresent(By.className("v-filterselect")); - comboBoxElement = $(ComboBoxElement.class).first(); - } + /* Move to wanted item */ + new Actions(getDriver()).sendKeys(Keys.ARROW_DOWN).perform(); + new Actions(getDriver()).sendKeys(Keys.ARROW_DOWN).perform(); - @Test - public void enterSetsValueSelectedByMouseOver() { - comboBoxElement.openPopup(); - comboBoxElement.sendKeys(Keys.DOWN, Keys.DOWN); String selectedItemText = findElement( By.className("gwt-MenuItem-selected")).getText(); assertThat("Item selected by arrows should be a1", selectedItemText, is("a1")); new Actions(driver).moveToElement(getWebElementForItem("a5")).build() .perform(); - comboBoxElement.sendKeys(getReturn()); + new Actions(getDriver()).sendKeys(getReturn()).perform(); assertThat("Item selected by mouse should be a5", - comboBoxElement.getText(), is("a5")); + textBoxElement.getAttribute("value"), is("a5")); checkLabelValue("a5"); } -- cgit v1.2.3