summaryrefslogtreecommitdiffstats
path: root/uitest/src/test
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2018-03-27 14:53:15 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-03-27 14:53:15 +0300
commit98be8f19d046f8f0fd7fe5a753bff2c67efed9fd (patch)
treeb7f9a91abdc40c2c791414c80b12e7cdee22f728 /uitest/src/test
parent8b2da456bdbda7cd493bd9dc11bbb1dead368d5c (diff)
downloadvaadin-framework-98be8f19d046f8f0fd7fe5a753bff2c67efed9fd.tar.gz
vaadin-framework-98be8f19d046f8f0fd7fe5a753bff2c67efed9fd.zip
Add row index to ItemClickEvent in Grid (#10754)
Diffstat (limited to 'uitest/src/test')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEventListenersTest.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEventListenersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEventListenersTest.java
new file mode 100644
index 0000000000..9682b31251
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEventListenersTest.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.components.grid.basics;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+
+public class GridEventListenersTest extends GridBasicsTest {
+
+ @Test
+ public void testItemClickListener() {
+ selectMenuPath("Component", "State", "Item click listener");
+ selectMenuPath("Component", "State", "Selection model", "none");
+ checkItemClickOnRow(0);
+ checkItemClickOnRow(2);
+ GridElement grid = getGridElement();
+ grid.getHeaderCell(0, 7);
+ checkItemClickOnRow(0);
+ checkItemClickOnRow(2);
+ }
+
+ private void checkItemClickOnRow(int row) {
+ GridElement grid = getGridElement();
+ grid.getCell(row, 2).click();
+ String logRow = getLogRow(0);
+ Assert.assertTrue(
+ "Log row '" + logRow + "' did not contain index " + row,
+ logRow.endsWith("Index " + row));
+ }
+}