From 2278f678fc9d3199825399b4bd3fba6659048877 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 16 Dec 2015 14:57:58 +0200 Subject: Fix IE8 focus handling in Grid editor in unbuffered state (#19389) Change-Id: Ia77c246239cae7b0add3c4975dfa5ffaa42d08b6 --- .../server/GridEditorUnbufferedTest.java | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'uitest/src/com/vaadin') 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 eaa58254ba..c4d1893875 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 @@ -83,12 +83,17 @@ public class GridEditorUnbufferedTest extends GridEditorTest { } @Test - public void testEditorMoveWithKeyboard() { + public void testEditorMoveWithKeyboard() throws InterruptedException { selectMenuPath(EDIT_ITEM_100); assertEditorOpen(); - getGridElement().sendKeys(Keys.ENTER); + getEditorWidgets().get(0).click(); + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + + if (BrowserUtil.isIE8(getDesiredCapabilities())) { + sleep(300); + } String firstFieldValue = getEditorWidgets().get(0) .getAttribute("value"); @@ -96,11 +101,18 @@ public class GridEditorUnbufferedTest extends GridEditorTest { firstFieldValue); for (int i = 0; i < 10; i++) { - getGridElement().sendKeys(Keys.SHIFT, Keys.ENTER); - } + new Actions(getDriver()).keyDown(Keys.SHIFT).sendKeys(Keys.ENTER) + .keyUp(Keys.SHIFT).perform(); - firstFieldValue = getEditorWidgets().get(0).getAttribute("value"); - assertEquals("Editor should move to row 91", "(91, 0)", firstFieldValue); + if (BrowserUtil.isIE8(getDesiredCapabilities())) { + sleep(300); + } + + firstFieldValue = getEditorWidgets().get(0).getAttribute("value"); + int row = 100 - i; + assertEquals("Editor should move to row " + row, + "(" + row + ", 0)", firstFieldValue); + } } @Test @@ -133,7 +145,7 @@ public class GridEditorUnbufferedTest extends GridEditorTest { getGridElement().getCell(10, 0).click(); - assertEquals("Editor should not to row 10", "(10, 0)", + assertEquals("Editor should move to row 10", "(10, 0)", getEditorWidgets().get(0).getAttribute("value")); } -- cgit v1.2.3