From 361ad179ebbe5f25e157497394d3d1fb5aaee506 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 21 Oct 2013 16:12:09 +0300 Subject: [PATCH] Fixed focus issue in TableMoveFocusWithSelectionTest (#12540) Change-Id: I40dbc81b6aa4eaf0a235ae2cc7f04025011445c9 --- .../TableMoveFocusWithSelectionTest.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java index b38705eeb6..5075e22f1b 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java @@ -57,19 +57,25 @@ public class TableMoveFocusWithSelectionTest extends MultiBrowserTest { // Click on row 7 getDriver().findElement(By.id("row-7")).click(); + // Clicking a row should get the row focus + WebElement row7TableRow = getDriver().findElement( + By.xpath("//div[@id='row-7']/../../..")); + String row7StyleName = row7TableRow.getAttribute("class"); + assertTrue(row7StyleName.contains("v-table-focus")); + // Select row 5-10 server side getDriver().findElement(By.id("select-510")).click(); + /* + * Focus the table again (some browsers steal focus when performing + * button click, other don't) + */ + getDriver().findElement(By.id("test-table")).click(); + // Ensure row 7 is still focused - WebElement row7TableRow = getDriver().findElement( + row7TableRow = getDriver().findElement( By.xpath("//div[@id='row-7']/../../..")); - String row7StyleName = row7TableRow.getAttribute("class"); + row7StyleName = row7TableRow.getAttribute("class"); assertTrue(row7StyleName.contains("v-table-focus")); } - - @Override - protected Class getUIClass() { - // FIXME Remove when this is done automatically - return TableMoveFocusWithSelection.class; - } } -- 2.39.5