]> source.dussan.org Git - vaadin-framework.git/commitdiff
Compatibility Grid test tweaks (#12483) (#12487)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Tue, 23 Nov 2021 15:06:42 +0000 (17:06 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Nov 2021 15:06:42 +0000 (17:06 +0200)
uitest/src/test/java/com/vaadin/tests/components/grid/GridReorderMergedTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridHeightTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridReorderMergedTest.java

index 80be6353c2f5ee81b2cf6507d3a5420ab580fa1d..5f4b4446ebd407ddd04a6b24f6eb920ec0017822 100644 (file)
@@ -16,8 +16,10 @@ public class GridReorderMergedTest extends MultiBrowserTest {
         openTestURL();
         GridElement grid = $(GridElement.class).first();
         GridCellElement headerCell0_0 = grid.getHeaderCell(0, 0);
-        GridCellElement headerCell0_4 = grid.getHeaderCell(0, 4);
-        new Actions(driver).dragAndDrop(headerCell0_0, headerCell0_4).perform();
+        // dragAndDrop(headerCell0_0, headerCell0_4) isn't enough for Firefox
+        new Actions(driver).clickAndHold(headerCell0_0)
+                .moveByOffset(headerCell0_0.getSize().getWidth() + 5, 5)
+                .release().perform();
 
         // ensure the first merged block got dragged over the entire second
         // merged block
index 71ba4c6251fc5797bd2c1190ca1b40dba33b525e..3493d053cb24f2e747b7eb19c640f6803681998f 100644 (file)
@@ -19,6 +19,7 @@ import com.vaadin.testbench.elements.LabelElement;
 import com.vaadin.testbench.elements.NativeButtonElement;
 import com.vaadin.testbench.elements.NativeSelectElement;
 import com.vaadin.testbench.elementsbase.ServerClass;
+import com.vaadin.testbench.parallel.BrowserUtil;
 import com.vaadin.testbench.parallel.TestCategory;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 import com.vaadin.tests.widgetset.client.v7.grid.GridClientColumnRendererConnector.Renderers;
@@ -134,11 +135,17 @@ public class GridClientRenderers extends MultiBrowserTest {
         // Simulate network latency with 2000ms
         latency = 2000;
 
-        // Chrome uses RGB instead of RGBA
+        // Chrome and IE11 use RGBA instead of RGB
         String colorRed = "rgba(255, 0, 0, 1)";
         String colorWhite = "rgba(255, 255, 255, 1)";
         String colorDark = "rgba(245, 245, 245, 1)";
 
+        if (BrowserUtil.isFirefox(desiredCapabilities)) {
+            colorRed = "rgb(255, 0, 0)";
+            colorWhite = "rgb(255, 255, 255)";
+            colorDark = "rgb(245, 245, 245)";
+        }
+
         openTestURL();
 
         getGrid();
index fd3c0ee16b92b444eb8f48097b0ea47f1c1ddefc..dc173a6d2ce92721e9b8c925072e6942073fe25a 100644 (file)
@@ -92,6 +92,10 @@ public class GridHeightTest extends MultiBrowserTest {
                             detailsRowHeight, "opened" });
                 }
 
+                // Firefox fails to close the details row if the clicks happen
+                // too close to each other
+                sleep(500);
+
                 grid.getRow(2).click(5, 5);
                 waitForElementNotPresent(By.id("lbl1"));
 
index 27f5e4711eb04529b96dffb0c5c75c5a6bdc4d00..5d15881a561e4c1332378e7be865012b716d9e58 100644 (file)
@@ -16,8 +16,10 @@ public class GridReorderMergedTest extends MultiBrowserTest {
         openTestURL();
         GridElement grid = $(GridElement.class).first();
         GridCellElement headerCell0_0 = grid.getHeaderCell(0, 0);
-        GridCellElement headerCell0_4 = grid.getHeaderCell(0, 4);
-        new Actions(driver).dragAndDrop(headerCell0_0, headerCell0_4).perform();
+        // dragAndDrop(headerCell0_0, headerCell0_4) isn't enough for Firefox
+        new Actions(driver).clickAndHold(headerCell0_0)
+                .moveByOffset(headerCell0_0.getSize().getWidth() + 5, 5)
+                .release().perform();
 
         // ensure the first merged block got dragged over the entire second
         // merged block