diff options
author | Stephen Wellington <steve@stevewellington.co.uk> | 2017-04-03 09:18:21 +0100 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-04-03 11:18:21 +0300 |
commit | 4c9b6745f098244535bfe065f2d85ae900ed9752 (patch) | |
tree | 7aa65f344b6f8089c86c10a10bcf773ea503940d /uitest/src | |
parent | eef6e0bb507546619abb01ca1b58c0a442940565 (diff) | |
download | vaadin-framework-4c9b6745f098244535bfe065f2d85ae900ed9752.tar.gz vaadin-framework-4c9b6745f098244535bfe065f2d85ae900ed9752.zip |
Fix Editor not saving values by pressing Enter (#8946)
Fixes #8945
Diffstat (limited to 'uitest/src')
2 files changed, 44 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorBufferedTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorBufferedTest.java index 17411c5a77..d6ee3e16a0 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorBufferedTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorBufferedTest.java @@ -64,6 +64,28 @@ public class GridEditorBufferedTest extends GridEditorTest { } @Test + public void testKeyboardSaveWithHiddenColumn() { + selectMenuPath("Component", "Columns", "Column 0", "Hidden"); + editRow(100); + + WebElement textField = getEditor().getField(5); + + textField.click(); + // without this, the click in the middle of the field might not be after + // the old text on some browsers + new Actions(getDriver()).sendKeys(Keys.END).perform(); + + textField.sendKeys(" changed"); + + // Save from keyboard + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + + assertEditorClosed(); + assertEquals("100 changed", + getGridElement().getCell(100, 4).getText()); + } + + @Test public void testKeyboardSaveWithInvalidEdition() { makeInvalidEdition(); diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java index e41ace4a1f..b408308f7b 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java @@ -64,6 +64,28 @@ public class GridEditorBufferedTest extends GridEditorTest { } @Test + public void testKeyboardSaveWithHiddenColumn() { + selectMenuPath("Component", "Columns", "Column 0", "Hidden"); + selectMenuPath(EDIT_ITEM_100); + + WebElement textField = getEditorWidgets().get(1); + + textField.click(); + // without this, the click in the middle of the field might not be after + // the old text on some browsers + new Actions(getDriver()).sendKeys(Keys.END).perform(); + + textField.sendKeys(" changed"); + + // Save from keyboard + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + + assertEditorClosed(); + assertEquals("(100, 2) changed", + getGridElement().getCell(100, 1).getText()); + } + + @Test public void testKeyboardSaveWithInvalidEdition() { makeInvalidEdition(); |