diff options
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java | 38 | ||||
-rw-r--r-- | uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html | 42 |
2 files changed, 38 insertions, 42 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java b/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java new file mode 100644 index 0000000000..4a5947c145 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.table; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.testbench.elements.TableHeaderElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ColumnReorderingWithManyColumnsTest extends MultiBrowserTest { + @Test + public void testReordering() throws IOException { + openTestURL(); + TableElement table = $(TableElement.class).first(); + TableHeaderElement sourceCell = table.getHeaderCell(0); + TableHeaderElement targetCell = table.getHeaderCell(10); + drag(sourceCell, targetCell); + WebElement markedElement = table.findElement(By + .className("v-table-focus-slot-right")); + String markedColumnName = markedElement.findElement(By.xpath("..")) + .getText(); + assertEquals("col-9", markedColumnName.toLowerCase()); + } + + private void drag(WebElement source, WebElement target) { + Actions actions = new Actions(getDriver()); + actions.moveToElement(source, 10, 10); + actions.clickAndHold(source); + actions.moveToElement(target, 10, 10); + actions.perform(); + } +}
\ No newline at end of file diff --git a/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html b/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html deleted file mode 100644 index 5b5c83e629..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8068/" /> -<title>ColumnReorderingWithManyColumns</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">ColumnReorderingWithManyColumns</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/ColumnReorderingWithManyColumns?restartApplication</td> - <td></td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/</td> - <td>10,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]/domChild[2]</td> - <td>10,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]/domChild[2]</td> - <td>10,10</td> -</tr> - -</tbody></table> -</body> -</html> |