aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-07-03 12:45:53 +0300
committerHenri Sara <henri.sara@gmail.com>2017-07-03 12:45:53 +0300
commite8e8b62dfbfd8769c3b63ca78c5dd535613322dd (patch)
tree4ace36230e57109110aa7c671db09cb4926c6185 /uitest/src
parentdde0f91af4a21ae9a1d141bed46e3030abc2c2d9 (diff)
downloadvaadin-framework-e8e8b62dfbfd8769c3b63ca78c5dd535613322dd.tar.gz
vaadin-framework-e8e8b62dfbfd8769c3b63ca78c5dd535613322dd.zip
Add editor open event to Grid Editor (#9623)
Fixes #9596
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorEvents.java1
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorEventsTest.java12
2 files changed, 7 insertions, 6 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorEvents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorEvents.java
index bd799a9925..41da1cc9fa 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorEvents.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorEvents.java
@@ -50,6 +50,7 @@ public class GridEditorEvents extends AbstractTestUIWithLog {
Person::getFirstName, Person::setFirstName);
column.setEditorBinding(binding);
+ grid.getEditor().addOpenListener(event -> log("editor is opened"));
grid.getEditor().addCancelListener(event -> log("editor is canceled"));
grid.getEditor().addSaveListener(event -> log("editor is saved"));
addComponent(grid);
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorEventsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorEventsTest.java
index 43cfd66c34..753bd656d6 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorEventsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorEventsTest.java
@@ -25,10 +25,6 @@ import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridEditorElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
-/**
- * @author Vaadin Ltd
- *
- */
public class GridEditorEventsTest extends MultiBrowserTest {
@Test
@@ -45,13 +41,17 @@ public class GridEditorEventsTest extends MultiBrowserTest {
GridEditorElement editor = updateField(index, grid, "foo");
editor.save();
- Assert.assertEquals((index * 2 + 1) + ". editor is saved",
+ Assert.assertEquals((index * 4 + 1) + ". editor is opened",
+ getLogRow(1));
+ Assert.assertEquals((index * 4 + 2) + ". editor is saved",
getLogRow(0));
editor = updateField(index, grid, "bar");
editor.cancel();
- Assert.assertEquals((index * 2 + 2) + ". editor is canceled",
+ Assert.assertEquals((index * 4 + 3) + ". editor is opened",
+ getLogRow(1));
+ Assert.assertEquals((index * 4 + 4) + ". editor is canceled",
getLogRow(0));
}