diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-08-19 11:36:41 +0300 |
---|---|---|
committer | Henrik Paul <henrik@vaadin.com> | 2014-08-21 12:54:19 +0000 |
commit | d9ff10864bc17bfd6e83725a293065b91d234904 (patch) | |
tree | c257a987aad1a6b3d81a641d6a193559133398eb /uitest/src/com | |
parent | 5a244a40683246c44b0c036720676e1a808694bc (diff) | |
download | vaadin-framework-d9ff10864bc17bfd6e83725a293065b91d234904.tar.gz vaadin-framework-d9ff10864bc17bfd6e83725a293065b91d234904.zip |
Implement selection with keyboard (#13334)
Change-Id: I29a2ac38dfd613e952fd2f939ee8670271255aa3
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java index c190f7d0ec..6e2ac91df2 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java @@ -19,6 +19,8 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; import com.vaadin.testbench.TestBenchElement; import com.vaadin.tests.components.grid.GridElement; @@ -123,6 +125,32 @@ public class GridSelectionTest extends GridBasicFeaturesTest { assertTrue("First row was not selected.", getRow(0).isSelected()); } + @Test + public void testKeyboardSelection() { + openTestURL(); + setSelectionModelMulti(); + + GridElement grid = getGridElement(); + grid.getCell(3, 1).click(); + new Actions(getDriver()).sendKeys(Keys.SPACE).perform(); + + assertTrue("Grid row 3 was not selected with space key.", grid + .getRow(3).isSelected()); + + new Actions(getDriver()).sendKeys(Keys.SPACE).perform(); + + assertTrue("Grid row 3 was not deselected with space key.", !grid + .getRow(3).isSelected()); + + grid.scrollToRow(500); + + new Actions(getDriver()).sendKeys(Keys.SPACE).perform(); + + assertTrue("Grid row 3 was not selected with space key.", grid + .getRow(3).isSelected()); + + } + private void setSelectionModelMulti() { selectMenuPath("Component", "State", "Selection mode", "multi"); } |