aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-01-08 09:48:49 +0200
committerAnna Koskinen <anna@vaadin.com>2015-02-26 17:21:19 +0200
commitacb889336f80227d609b194e56ac6ae3ead0d338 (patch)
treeb41488f3b5b6f31b19ed7a10841b05fb043394bb /uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
parent5830a1f96b24186a68023258630ef1d89590d31e (diff)
downloadvaadin-framework-acb889336f80227d609b194e56ac6ae3ead0d338.tar.gz
vaadin-framework-acb889336f80227d609b194e56ac6ae3ead0d338.zip
Redesign ComboBox filtering, highlighting and selection behaviour.
(#15502, #9369) Changes: - When opening the popup, the first suggestion is always highlighted by default unless adding new items is allowed. - When filter matches currently selected item, that item will be highlighted instead of the first item. - Hitting enter or tab will always select the highlighted item. - Closing the suggestions list by clicking outside the list no longer selects an item to prevent accidental selections. Test changes: - Extended ComboBoxElement to help test filtering. - Updated and tweaked ComboBoxResetValueTest, ComboBoxIdenticalItemsTest and ComboboxScrollableWindowTest. - Added ComboBoxSelectingTest and ComboBoxSelectingWithNewItemsAllowedTest. - Updated some tests that were using keyboard navigation. Change-Id: Ia7745b624bdb0b1a1bb498157ebcb37bee219d76
Diffstat (limited to 'uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java25
1 files changed, 8 insertions, 17 deletions
diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
index 948c3c13b2..4cfcd8fa59 100644
--- a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
+++ b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java
@@ -20,11 +20,10 @@ 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;
+import com.vaadin.tests.tb3.newelements.ComboBoxElement;
public class FontIconsTest extends MultiBrowserTest {
@@ -37,29 +36,21 @@ public class FontIconsTest extends MultiBrowserTest {
@Test
public void comboBoxItemIconsOnKeyboardNavigation() throws Exception {
openTestURL();
- WebElement comboBoxInput = getDriver().findElement(
- By.className("v-filterselect-input"));
+
+ ComboBoxElement comboBox = $(ComboBoxElement.class).first();
// No initial value.
- assertEquals("", comboBoxInput.getText());
+ assertEquals("", comboBox.getText());
// Navigate to the first item with keyboard navigation.
- sendKeys(comboBoxInput, Keys.ARROW_DOWN, Keys.ARROW_DOWN,
- Keys.ARROW_DOWN);
+ comboBox.sendKeys(400, Keys.ARROW_DOWN, Keys.ARROW_DOWN);
// Value must be "One" without any extra characters.
// See ticket #14660
- assertEquals("One", comboBoxInput.getAttribute("value"));
+ assertEquals("One", comboBox.getText());
// 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.
- }
+ comboBox.sendKeys(Keys.ARROW_DOWN);
+ assertEquals("Two", comboBox.getText());
}
}