diff options
author | Artur Signell <artur@vaadin.com> | 2016-09-30 23:30:42 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-10-26 22:11:19 +0300 |
commit | 44603b49f80b4191eca8f82a8cc17243820aa2c4 (patch) | |
tree | 8bbf711428687c8903fb1528598797d88f872310 /uitest | |
parent | ece3ac4f2fc3db486796df8c70e9381349a8c091 (diff) | |
download | vaadin-framework-44603b49f80b4191eca8f82a8cc17243820aa2c4.tar.gz vaadin-framework-44603b49f80b4191eca8f82a8cc17243820aa2c4.zip |
Allow defining a focus delegate component for CustomField (#20336)
Change-Id: I1160e7a384b1816204eb7f4b0f52f83ed9e230c0
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java | 2 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java index b1c6ee57c1..978f582478 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java @@ -73,6 +73,8 @@ public class GridEditorCustomField extends AbstractTestUIWithLog { Button addCountryButton = new Button("New"); fieldLayout.addComponent(addCountryButton); + setFocusDelegate(cityComboBox); + return fieldLayout; } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java index 2acc554154..9e276f04b8 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java @@ -17,13 +17,14 @@ package com.vaadin.tests.components.grid; import org.junit.Assert; import org.junit.Test; +import org.openqa.selenium.Keys; import com.vaadin.testbench.TestBenchElement; -import com.vaadin.testbench.elements.ComboBoxElement; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridEditorElement; import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.newelements.ComboBoxElement; @TestCategory("grid") public class GridEditorCustomFieldTest extends MultiBrowserTest { @@ -43,4 +44,18 @@ public class GridEditorCustomFieldTest extends MultiBrowserTest { Assert.assertEquals("Oslo", grid.getCell(0, 2).getText()); } + + @Test + public void tabReachesCustomField() { + openTestURL(); + GridElement grid = $(GridElement.class).first(); + grid.getCell(0, 1).doubleClick(); + GridEditorElement editor = grid.getEditor(); + editor.getField(0).sendKeys(Keys.TAB, Keys.TAB); + + ComboBoxElement comboBoxInCustomField = editor.getField(2) + .$(ComboBoxElement.class).first(); + assertElementsEquals(comboBoxInCustomField.getInputField(), + getActiveElement()); + } } |