]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed focus issue in TableMoveFocusWithSelectionTest (#12540)
authorJohn Ahlroos <john@vaadin.com>
Mon, 21 Oct 2013 13:12:09 +0000 (16:12 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 21 Oct 2013 15:14:26 +0000 (15:14 +0000)
Change-Id: I40dbc81b6aa4eaf0a235ae2cc7f04025011445c9

uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java

index b38705eeb68f24ee7ea4b88ae179feba66d430e5..5075e22f1b495499e87d88ca989fa263dd58cb29 100644 (file)
@@ -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;
-    }
 }