diff options
author | Teemu Pòˆntelin <teemu@vaadin.com> | 2014-09-24 22:48:55 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-09-29 12:44:27 +0000 |
commit | 0404f7f5ff0c70e4d2bac6abc7d54ad1910090f8 (patch) | |
tree | 7284f5681f7af9b90d6a3bbaa2c22ec1f37091a5 /uitest | |
parent | e72678558550951dca1cab5d615d7bce8e1878c1 (diff) | |
download | vaadin-framework-0404f7f5ff0c70e4d2bac6abc7d54ad1910090f8.tar.gz vaadin-framework-0404f7f5ff0c70e4d2bac6abc7d54ad1910090f8.zip |
Fix ComboBox issue with font-based item icons (#14660)
Change-Id: I8f3de9556cc62670c28523886998f89383b76305
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java index 61a38bf552..948c3c13b2 100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java @@ -15,9 +15,14 @@ */ package com.vaadin.tests.fonticon; +import static org.junit.Assert.assertEquals; + import java.io.IOException; import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -28,4 +33,33 @@ public class FontIconsTest extends MultiBrowserTest { openTestURL(); compareScreen("all"); } + + @Test + public void comboBoxItemIconsOnKeyboardNavigation() throws Exception { + openTestURL(); + WebElement comboBoxInput = getDriver().findElement( + By.className("v-filterselect-input")); + + // No initial value. + assertEquals("", comboBoxInput.getText()); + + // Navigate to the first item with keyboard navigation. + sendKeys(comboBoxInput, Keys.ARROW_DOWN, Keys.ARROW_DOWN, + Keys.ARROW_DOWN); + + // Value must be "One" without any extra characters. + // See ticket #14660 + assertEquals("One", comboBoxInput.getAttribute("value")); + + // Check also the second item. + sendKeys(comboBoxInput, Keys.ARROW_DOWN); + assertEquals("Two", comboBoxInput.getAttribute("value")); + } + + private void sendKeys(WebElement element, Keys... keys) throws Exception { + for (Keys key : keys) { + element.sendKeys(key); + sleep(10); // For PhantomJS. + } + } } |