diff options
author | Teemu Pöntelin <teemu@vaadin.com> | 2014-09-24 22:48:55 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-10-13 09:52:59 +0300 |
commit | fbdbd0cf1e078034890fdd75379716648af1706c (patch) | |
tree | 86ab94cf9cbe2339e787cd4deb62ca6c2522705f /uitest | |
parent | 10d26786290ad8efcffbbee714bc182ccfc691c7 (diff) | |
download | vaadin-framework-fbdbd0cf1e078034890fdd75379716648af1706c.tar.gz vaadin-framework-fbdbd0cf1e078034890fdd75379716648af1706c.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. + } + } } |