diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2015-03-30 14:15:52 +0300 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2015-03-31 07:34:34 +0000 |
commit | 3eb8110f13d51a859d40da9dfcb9ae2edb890f8c (patch) | |
tree | 35f2a1e7de61ea386a25ee51a37be8d98e207544 | |
parent | eeb5e8c89df6e043d20c4e0ac6b094334970b2b4 (diff) | |
download | vaadin-framework-3eb8110f13d51a859d40da9dfcb9ae2edb890f8c.tar.gz vaadin-framework-3eb8110f13d51a859d40da9dfcb9ae2edb890f8c.zip |
Refactored fragile column reorder tests for Grid
Change-Id: I72fd2b09269d5dfc689d8b1f213f46989adf8bfe
4 files changed, 122 insertions, 87 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java index 7fae3bf8cf..ca8ea9fd75 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java @@ -36,6 +36,10 @@ import com.vaadin.tests.tb3.MultiBrowserTest; @TestCategory("grid") public abstract class GridBasicFeaturesTest extends MultiBrowserTest { + public enum CellSide { + LEFT, RIGHT; + } + @Override protected boolean requireWindowFocusForIE() { return true; @@ -172,25 +176,52 @@ public abstract class GridBasicFeaturesTest extends MultiBrowserTest { } protected void dragAndDropDefaultColumnHeader(int draggedColumnHeaderIndex, - int onTopOfColumnHeaderIndex, int xOffsetFromColumnTopLeftCorner) { + int onTopOfColumnHeaderIndex, CellSide cellSide) { + GridCellElement columnHeader = getDefaultColumnHeader(onTopOfColumnHeaderIndex); new Actions(getDriver()) .clickAndHold(getDefaultColumnHeader(draggedColumnHeaderIndex)) .moveToElement( - getDefaultColumnHeader(onTopOfColumnHeaderIndex), - xOffsetFromColumnTopLeftCorner, 0).release().perform(); + columnHeader, + getHorizontalOffsetForDragAndDrop(columnHeader, + cellSide), 0).release().perform(); + } + + private int getHorizontalOffsetForDragAndDrop(GridCellElement columnHeader, + CellSide cellSide) { + if (cellSide == CellSide.LEFT) { + return 5; + } else { + int half = columnHeader.getSize().getWidth() / 2; + return half + (half / 2); + } } protected void dragAndDropColumnHeader(int headerRow, int draggedColumnHeaderIndex, int onTopOfColumnHeaderIndex, - int xOffsetFromColumnTopLeftCorner) { + CellSide cellSide) { + GridCellElement headerCell = getGridElement().getHeaderCell(headerRow, + onTopOfColumnHeaderIndex); new Actions(getDriver()) .clickAndHold( getGridElement().getHeaderCell(headerRow, draggedColumnHeaderIndex)) .moveToElement( + headerCell, + getHorizontalOffsetForDragAndDrop(headerCell, cellSide), + 0).release().perform(); + } + + protected void dragAndDropColumnHeader(int headerRow, + int draggedColumnHeaderIndex, int onTopOfColumnHeaderIndex, + int horizontalOffset) { + GridCellElement headerCell = getGridElement().getHeaderCell(headerRow, + onTopOfColumnHeaderIndex); + new Actions(getDriver()) + .clickAndHold( getGridElement().getHeaderCell(headerRow, - onTopOfColumnHeaderIndex), - xOffsetFromColumnTopLeftCorner, 0).release().perform(); + draggedColumnHeaderIndex)) + .moveToElement(headerCell, horizontalOffset, 0).release() + .perform(); } protected void assertColumnIsSorted(int index) { diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java index c12c769c63..ac04ed1a56 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java @@ -390,16 +390,16 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { clickSidebarOpenButton(); toggleColumnReorder(); - dragAndDropColumnHeader(0, 3, 0, 5); + dragAndDropColumnHeader(0, 3, 0, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); clickSidebarOpenButton(); verifyColumnHidingTogglesOrder(3, 0, 1, 4); clickSidebarOpenButton(); - dragAndDropColumnHeader(0, 1, 3, 100); - dragAndDropColumnHeader(0, 4, 0, 5); - dragAndDropColumnHeader(0, 3, 0, 5); + dragAndDropColumnHeader(0, 1, 3, CellSide.RIGHT); + dragAndDropColumnHeader(0, 4, 0, CellSide.LEFT); + dragAndDropColumnHeader(0, 3, 0, CellSide.LEFT); assertColumnHeaderOrder(2, 4, 3, 1, 0); clickSidebarOpenButton(); @@ -413,7 +413,7 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { toggleHideColumnAPI(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); - dragAndDropColumnHeader(0, 1, 0, 5); + dragAndDropColumnHeader(0, 1, 0, CellSide.LEFT); assertColumnHeaderOrder(2, 1, 3, 4, 5); toggleHideColumnAPI(0); @@ -423,7 +423,7 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 2, 3, 4, 5); // right side of hidden column - dragAndDropColumnHeader(0, 0, 2, 5); + dragAndDropColumnHeader(0, 0, 2, CellSide.LEFT); assertColumnHeaderOrder(2, 0, 3, 4, 5); toggleHideColumnAPI(1); @@ -433,7 +433,7 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(2, 1, 3, 4, 5); // left side of hidden column - dragAndDropColumnHeader(0, 0, 1, 100); + dragAndDropColumnHeader(0, 0, 1, CellSide.RIGHT); assertColumnHeaderOrder(1, 2, 3, 4, 5); toggleHideColumnAPI(0); @@ -448,7 +448,7 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { toggleHideColumnAPI(3); assertColumnHeaderOrder(0, 1, 4, 5, 6); - dragAndDropDefaultColumnHeader(0, 2, 5); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); assertColumnHeaderOrder(1, 0, 4, 5, 6); toggleHideColumnAPI(3); @@ -461,10 +461,10 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest { toggleHideColumnAPI(4); assertColumnHeaderOrder(1, 2, 3, 5, 6); - dragAndDropDefaultColumnHeader(4, 3, 2); + dragAndDropDefaultColumnHeader(4, 3, CellSide.LEFT); assertColumnHeaderOrder(1, 2, 3, 6, 5); - dragAndDropDefaultColumnHeader(4, 2, 100); + dragAndDropDefaultColumnHeader(4, 2, CellSide.RIGHT); assertColumnHeaderOrder(1, 2, 3, 5, 6); toggleHideColumnAPI(0); diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java index 20f6847f51..68ba5f5c54 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java @@ -130,7 +130,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { sortColumn(0); // when - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); // then assertColumnIsSorted(1); @@ -157,7 +157,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { focusDefaultHeader(0); // when - dragAndDropDefaultColumnHeader(0, 3, 10); + dragAndDropDefaultColumnHeader(0, 3, CellSide.LEFT); // then WebElement defaultColumnHeader = getDefaultColumnHeader(2); @@ -172,7 +172,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { focusCell(2, 2); // when - dragAndDropDefaultColumnHeader(2, 0, 10); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then assertFocusedCell(2, 0); @@ -187,13 +187,13 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertFocusedCell(2, 2); // when - dragAndDropDefaultColumnHeader(1, 0, 10); + dragAndDropDefaultColumnHeader(1, 0, CellSide.LEFT); // then assertFocusedCell(2, 2); // when - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); // then assertFocusedCell(2, 2); @@ -206,7 +206,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { focusCell(1, 3); // when - dragAndDropDefaultColumnHeader(4, 1, 10); + dragAndDropDefaultColumnHeader(4, 1, CellSide.LEFT); // then assertFocusedCell(1, 4); @@ -219,7 +219,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { focusCell(4, 2); // when - dragAndDropDefaultColumnHeader(0, 4, 10); + dragAndDropDefaultColumnHeader(0, 4, CellSide.LEFT); // then assertFocusedCell(4, 1); @@ -234,7 +234,9 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(1, 3, 1, 80); + int horizontalOffset = (getGridElement().getHeaderCell(1, 1).getSize() + .getWidth() / 2) - 10; + dragAndDropColumnHeader(1, 3, 1, horizontalOffset); // then assertColumnHeaderOrder(0, 3, 1, 2, 4); @@ -249,7 +251,9 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(0, 0, 2, 20); + int horizontalOffset = (getGridElement().getHeaderCell(1, 1).getSize() + .getWidth() / 2) + 10; + dragAndDropColumnHeader(0, 0, 2, horizontalOffset); // then assertColumnHeaderOrder(1, 2, 0, 3, 4); @@ -264,7 +268,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(0, 2, 0, 20); + dragAndDropColumnHeader(0, 2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(0, 2, 1, 3, 4); @@ -278,11 +282,11 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join column cells 0, 1"); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); - dragAndDropColumnHeader(0, 3, 0, 10); + dragAndDropColumnHeader(0, 3, 0, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); // when - dragAndDropColumnHeader(0, 2, 0, 10); + dragAndDropColumnHeader(0, 2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(3, 0, 1, 2, 4); @@ -296,17 +300,17 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join column cells 0, 1"); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); - dragAndDropColumnHeader(0, 3, 0, 10); + dragAndDropColumnHeader(0, 3, 0, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); // when then - dragAndDropColumnHeader(0, 1, 3, 10); + dragAndDropColumnHeader(0, 1, 3, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); - dragAndDropColumnHeader(1, 2, 1, 10); + dragAndDropColumnHeader(1, 2, 1, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); - dragAndDropColumnHeader(2, 1, 3, -10); + dragAndDropColumnHeader(2, 1, 2, CellSide.RIGHT); assertColumnHeaderOrder(3, 0, 1, 2, 4); } @@ -318,33 +322,33 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(0, 0, 4, 120); + dragAndDropColumnHeader(0, 0, 4, CellSide.RIGHT); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); // when then - dragAndDropColumnHeader(0, 1, 4, 10); + dragAndDropColumnHeader(0, 1, 4, CellSide.LEFT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); - dragAndDropColumnHeader(0, 2, 4, 10); + dragAndDropColumnHeader(0, 2, 4, CellSide.LEFT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); - dragAndDropColumnHeader(0, 3, 4, 100); + dragAndDropColumnHeader(0, 3, 4, CellSide.RIGHT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 5, 4); - dragAndDropColumnHeader(0, 4, 2, 100); + dragAndDropColumnHeader(0, 4, 2, CellSide.RIGHT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); - dragAndDropColumnHeader(2, 3, 4, 100); + dragAndDropColumnHeader(2, 3, 4, CellSide.RIGHT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 5, 4); - dragAndDropColumnHeader(2, 4, 2, 100); + dragAndDropColumnHeader(2, 4, 2, CellSide.RIGHT); scrollGridHorizontallyTo(0); assertColumnHeaderOrder(1, 2, 3, 4, 5); } @@ -357,21 +361,21 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(0, 0, 4, 120); + dragAndDropColumnHeader(0, 0, 4, CellSide.RIGHT); scrollGridHorizontallyTo(0); - dragAndDropColumnHeader(0, 1, 4, 100); + dragAndDropColumnHeader(0, 1, 4, CellSide.RIGHT); scrollGridHorizontallyTo(0); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); assertColumnHeaderOrder(1, 3, 4, 5, 2); // when then - dragAndDropColumnHeader(0, 1, 3, 80); + dragAndDropColumnHeader(0, 1, 3, CellSide.RIGHT); assertColumnHeaderOrder(1, 4, 3, 5, 2); - dragAndDropColumnHeader(0, 2, 4, 10); + dragAndDropColumnHeader(0, 2, 4, CellSide.LEFT); assertColumnHeaderOrder(1, 4, 3, 5, 2); - dragAndDropColumnHeader(0, 2, 0, 10); + dragAndDropColumnHeader(0, 2, 0, CellSide.LEFT); assertColumnHeaderOrder(1, 3, 4, 5, 2); } @@ -384,7 +388,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(0, 3, 1, 80); + dragAndDropColumnHeader(0, 3, 1, CellSide.RIGHT); // then assertColumnHeaderOrder(0, 3, 1, 2, 4); @@ -399,7 +403,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(0, 2, 0, 20); + dragAndDropColumnHeader(0, 2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(0, 2, 1, 3, 4); @@ -413,11 +417,11 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Footer", "Append row"); selectMenuPath("Component", "Footer", "Row 1", "Join column cells 0, 1"); selectMenuPath("Component", "Footer", "Row 2", "Join columns 1, 2"); - dragAndDropColumnHeader(0, 3, 0, 10); + dragAndDropColumnHeader(0, 3, 0, CellSide.LEFT); assertColumnHeaderOrder(3, 0, 1, 2, 4); // when - dragAndDropColumnHeader(0, 2, 0, 10); + dragAndDropColumnHeader(0, 2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(3, 0, 1, 2, 4); @@ -431,21 +435,21 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Footer", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(0, 0, 5, 2); + dragAndDropColumnHeader(0, 0, 5, CellSide.LEFT); scrollGridHorizontallyTo(0); - dragAndDropColumnHeader(0, 1, 5, 2); + dragAndDropColumnHeader(0, 1, 5, CellSide.LEFT); scrollGridHorizontallyTo(0); selectMenuPath("Component", "Footer", "Row 1", "Join columns 1, 2"); assertColumnHeaderOrder(1, 3, 4, 5, 2); // when then - dragAndDropColumnHeader(0, 1, 3, 80); + dragAndDropColumnHeader(0, 1, 3, CellSide.RIGHT); assertColumnHeaderOrder(1, 4, 3, 5, 2); - dragAndDropColumnHeader(0, 2, 4, 10); + dragAndDropColumnHeader(0, 2, 4, CellSide.RIGHT); assertColumnHeaderOrder(1, 4, 3, 5, 2); - dragAndDropColumnHeader(0, 2, 0, 10); + dragAndDropColumnHeader(0, 2, 0, CellSide.RIGHT); assertColumnHeaderOrder(1, 3, 4, 5, 2); } @@ -458,7 +462,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(1, 1, 4, 10); + dragAndDropColumnHeader(1, 1, 4, CellSide.LEFT); scrollGridHorizontallyTo(0); // then @@ -476,14 +480,14 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(1, 1, 4, 10); + dragAndDropColumnHeader(1, 1, 4, CellSide.LEFT); scrollGridHorizontallyTo(0); // then assertColumnHeaderOrder(0, 3, 1, 2, 4); // when - dragAndDropColumnHeader(2, 3, 0, 10); + dragAndDropColumnHeader(2, 3, 0, CellSide.LEFT); // then assertColumnHeaderOrder(1, 2, 0, 3, 4); @@ -500,13 +504,13 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(1, 1, 4, 10); + dragAndDropColumnHeader(1, 1, 4, CellSide.LEFT); // then assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(2, 0, 3, 100); + dragAndDropColumnHeader(2, 0, 3, CellSide.RIGHT); // then assertColumnHeaderOrder(0, 1, 2, 3, 4); @@ -519,14 +523,14 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "State", "Width", "750px"); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(1, 3, 1, 10); + dragAndDropColumnHeader(1, 3, 1, CellSide.LEFT); scrollGridHorizontallyTo(0); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); assertColumnHeaderOrder(0, 3, 4, 5, 1); // when - dragAndDropColumnHeader(1, 1, 0, 10); + dragAndDropColumnHeader(1, 1, 0, CellSide.LEFT); // then assertColumnHeaderOrder(3, 4, 5, 0, 1); @@ -539,21 +543,21 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "State", "Width", "750px"); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(1, 3, 1, 10); + dragAndDropColumnHeader(1, 3, 1, CellSide.LEFT); scrollGridHorizontallyTo(0); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); assertColumnHeaderOrder(0, 3, 4, 5, 1); // when - dragAndDropColumnHeader(2, 1, 3, 100); + dragAndDropColumnHeader(2, 1, 3, CellSide.RIGHT); scrollGridHorizontallyTo(0); // then assertColumnHeaderOrder(0, 5, 3, 4, 1); // when - dragAndDropColumnHeader(2, 2, 0, 10); + dragAndDropColumnHeader(2, 2, 0, CellSide.LEFT); scrollGridHorizontallyTo(0); // then @@ -567,21 +571,21 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { selectMenuPath("Component", "State", "Width", "750px"); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); - dragAndDropColumnHeader(1, 3, 1, 10); + dragAndDropColumnHeader(1, 3, 1, CellSide.LEFT); scrollGridHorizontallyTo(0); selectMenuPath("Component", "Header", "Append row"); selectMenuPath("Component", "Header", "Row 3", "Join columns 1, 2"); assertColumnHeaderOrder(0, 3, 4, 5, 1); // when - dragAndDropColumnHeader(2, 3, 0, 10); + dragAndDropColumnHeader(2, 3, 0, CellSide.LEFT); scrollGridHorizontallyTo(0); // then assertColumnHeaderOrder(0, 5, 3, 4, 1); // when - dragAndDropColumnHeader(2, 1, 4, 10); + dragAndDropColumnHeader(2, 1, 4, CellSide.LEFT); scrollGridHorizontallyTo(0); // then @@ -599,7 +603,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(1, 3, 2, -10); + dragAndDropColumnHeader(1, 3, 1, CellSide.RIGHT); scrollGridHorizontallyTo(0); // then @@ -607,14 +611,14 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { // when scrollGridHorizontallyTo(100); - dragAndDropColumnHeader(2, 4, 2, 10); + dragAndDropColumnHeader(2, 4, 2, CellSide.LEFT); scrollGridHorizontallyTo(0); // then assertColumnHeaderOrder(0, 1, 2, 3, 4); // when - dragAndDropColumnHeader(0, 0, 3, 10); + dragAndDropColumnHeader(0, 0, 3, CellSide.LEFT); scrollGridHorizontallyTo(0); // then diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java index 59e7601369..0d62797ea4 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java @@ -51,7 +51,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { toggleColumnReordering(); // when - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); // then assertColumnHeaderOrder(1, 0, 2); @@ -65,7 +65,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { toggleColumnReordering(); // when - dragAndDropDefaultColumnHeader(0, 2, 110); + dragAndDropDefaultColumnHeader(0, 2, CellSide.RIGHT); // then assertColumnHeaderOrder(1, 2, 0); @@ -80,13 +80,13 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { toggleColumnReordering(); // when - dragAndDropDefaultColumnHeader(2, 0, 10); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(2, 0, 1, 3, 4); // when - dragAndDropDefaultColumnHeader(1, 3, 150); + dragAndDropDefaultColumnHeader(1, 3, CellSide.RIGHT); // then assertColumnHeaderOrder(2, 1, 3, 0); @@ -99,7 +99,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeaderOrder(0, 1, 2); // when - dragAndDropDefaultColumnHeader(0, 2, 110); + dragAndDropDefaultColumnHeader(0, 2, CellSide.RIGHT); // then assertColumnHeaderOrder(0, 1, 2); @@ -113,7 +113,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { toggleColumnReordering(); // when - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); assertColumnHeaderOrder(1, 0, 2); moveColumnManuallyLeftByOne(0); @@ -131,7 +131,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { // when selectMenuPath(new String[] { "Component", "Internals", "Update column order without updating client" }); - dragAndDropDefaultColumnHeader(2, 0, 10); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(1, 0, 2); @@ -145,7 +145,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { // when toggleColumnReorderListener(); - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); // then assertColumnReorderEvent(true); @@ -156,19 +156,19 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { // given openTestURL(); toggleColumnReordering(); - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); assertNoColumnReorderEvent(); // when toggleColumnReorderListener(); - dragAndDropDefaultColumnHeader(0, 2, 110); + dragAndDropDefaultColumnHeader(0, 2, CellSide.RIGHT); // then assertColumnReorderEvent(true); // when toggleColumnReorderListener(); - dragAndDropDefaultColumnHeader(0, 3, 10); + dragAndDropDefaultColumnHeader(0, 3, CellSide.LEFT); // then assertNoColumnReorderEvent(); @@ -195,7 +195,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3); // when - dragAndDropDefaultColumnHeader(0, 2, 10); + dragAndDropDefaultColumnHeader(0, 2, CellSide.LEFT); // then assertColumnHeaderOrder(0, 1, 2, 3); @@ -213,7 +213,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3); // when - dragAndDropDefaultColumnHeader(2, 0, 10); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then assertColumnHeaderOrder(0, 2, 1, 3); @@ -232,7 +232,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeader("Column 2", gridHeaderRowCells.get(3)); // when - dragAndDropDefaultColumnHeader(2, 0, 2); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then gridHeaderRowCells = getGridHeaderRowCells(); @@ -256,7 +256,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeader("Column 2", gridHeaderRowCells.get(3)); // when - dragAndDropDefaultColumnHeader(3, 0, 2); + dragAndDropDefaultColumnHeader(3, 0, CellSide.LEFT); // then gridHeaderRowCells = getGridHeaderRowCells(); @@ -280,7 +280,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeader("Column 2", gridHeaderRowCells.get(3)); // when - dragAndDropDefaultColumnHeader(2, 0, 2); + dragAndDropDefaultColumnHeader(2, 0, CellSide.LEFT); // then gridHeaderRowCells = getGridHeaderRowCells(); @@ -299,7 +299,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3); // when - dragAndDropColumnHeader(0, 0, 2, 110); + dragAndDropColumnHeader(0, 0, 2, CellSide.RIGHT); // then assertColumnHeaderOrder(1, 2, 0, 3); @@ -314,7 +314,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { assertColumnHeaderOrder(0, 1, 2, 3); // when - dragAndDropColumnHeader(1, 0, 2, 110); + dragAndDropColumnHeader(1, 0, 2, CellSide.RIGHT); // then assertColumnHeaderOrder(1, 2, 0, 3); |