aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-08-19 11:36:41 +0300
committerHenrik Paul <henrik@vaadin.com>2014-08-21 12:54:19 +0000
commitd9ff10864bc17bfd6e83725a293065b91d234904 (patch)
treec257a987aad1a6b3d81a641d6a193559133398eb /uitest/src/com
parent5a244a40683246c44b0c036720676e1a808694bc (diff)
downloadvaadin-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.java28
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");
}