aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java
index 08094b57e3..0b84d3470f 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java
@@ -26,6 +26,7 @@ import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
+import com.vaadin.testbench.TestBenchElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
public class GridEditorUnbufferedTest extends GridEditorTest {
@@ -220,4 +221,25 @@ public class GridEditorUnbufferedTest extends GridEditorTest {
assertEditorClosed();
}
+
+ @Test
+ public void testEditorSaveOnRowChange() {
+ // Double click sets the focus programmatically
+ getGridElement().getCell(5, 2).doubleClick();
+
+ TestBenchElement editor = getGridElement().getEditor().getField(2);
+ editor.clear();
+ // Click to ensure IE focus...
+ editor.click(5, 5);
+ editor.sendKeys("Foo", Keys.ENTER);
+
+ assertEquals("Editor did not move.", "(6, 0)", getGridElement()
+ .getEditor().getField(0).getAttribute("value"));
+ assertEquals("Editor field value did not update from server.",
+ "(6, 2)", getGridElement().getEditor().getField(2)
+ .getAttribute("value"));
+
+ assertEquals("Edited value was not saved.", "Foo", getGridElement()
+ .getCell(5, 2).getText());
+ }
} \ No newline at end of file