From 9dc69b25e4599077c0f743b04237c09fad29ecde Mon Sep 17 00:00:00 2001 From: Mika Murtojarvi Date: Fri, 12 Jun 2015 11:20:49 +0300 Subject: [PATCH] Replace a TB2 test of Table column reordering. Change-Id: I31649d5bf5a5463bea5f8f1689100ad8b69b5205 --- .../ColumnReorderingWithManyColumnsTest.java | 38 +++++++++++++++++ .../ColumnReorderingWithManyColumns.html | 42 ------------------- 2 files changed, 38 insertions(+), 42 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java delete mode 100644 uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html 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 @@ - - - - - - -ColumnReorderingWithManyColumns - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ColumnReorderingWithManyColumns
open/run/ColumnReorderingWithManyColumns?restartApplication
dragvaadin=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]/10,10
mouseMoveAtvaadin=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]10,10
screenCapture
dropvaadin=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]10,10
- - -- 2.39.5