summaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java21
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java14
2 files changed, 35 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
index c98ee5c53b..a9cc528ac0 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
@@ -127,6 +127,14 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> {
}
};
+ private ItemClickListener editorOpeningItemClickListener = new ItemClickListener() {
+
+ @Override
+ public void itemClick(ItemClickEvent event) {
+ grid.editItem(event.getItemId());
+ }
+ };
+
private ColumnReorderListener columnReorderListener = new ColumnReorderListener() {
@Override
@@ -643,6 +651,19 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> {
}
});
+ createBooleanAction("EditorOpeningItemClickListener", "State", false,
+ new Command<Grid, Boolean>() {
+
+ @Override
+ public void execute(Grid c, Boolean value, Object data) {
+ if (!value) {
+ c.removeItemClickListener(editorOpeningItemClickListener);
+ } else {
+ c.addItemClickListener(editorOpeningItemClickListener);
+ }
+ }
+
+ });
createBooleanAction("ColumnReorderListener", "State", false,
new Command<Grid, Boolean>() {
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java
index 0a6d884251..ba6c29522b 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java
@@ -162,6 +162,20 @@ public abstract class GridEditorTest extends GridBasicFeaturesTest {
}
@Test
+ public void testFocusOnProgrammaticOpenOnItemClick() {
+ selectMenuPath("Component", "State", "EditorOpeningItemClickListener");
+
+ GridCellElement cell = getGridElement().getCell(4, 2);
+
+ cell.click();
+
+ WebElement focused = getFocusedElement();
+
+ assertEquals("", "input", focused.getTagName());
+ assertEquals("", cell.getText(), focused.getAttribute("value"));
+ }
+
+ @Test
public void testNoFocusOnProgrammaticOpen() {
selectMenuPath(EDIT_ITEM_5);