]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test fixes & split failsafe integration test runs into smaller batches (#12103)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Thu, 1 Oct 2020 10:11:01 +0000 (13:11 +0300)
committerGitHub <noreply@github.com>
Thu, 1 Oct 2020 10:11:01 +0000 (13:11 +0300)
36 files changed:
compatibility-themes/src/main/themes/VAADIN/themes/runo/select/select.scss
uitest/pom.xml
uitest/reference-screenshots/chrome/GridEditorFrozenColumnsUITest-testEditorWithFrozenColumns_ANY_Chrome__noscroll.png
uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__all-left.png
uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-right.png
uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-textfield-right.png
uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-right.png
uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__buttonMoved.png
uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__initial.png
uitest/reference-screenshots/chrome/HComponentSizingTest-ComponentSizing_ANY_Chrome__setSize_-1px.png
uitest/reference-screenshots/chrome/HLayoutSizingTest-LayoutSizing_ANY_Chrome__setSize_-1px.png
uitest/reference-screenshots/chrome/ResponsiveStylesTest-testValoMenuResponsiveParentSize_ANY_Chrome__defaultMenuWidths.png
uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__move.png
uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__remove.png
uitest/src/main/java/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdate.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/LayoutDuringStateUpdateConnector.java
uitest/src/test/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUITest.java
uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldFocusTest.java
uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldNavigationKeyBoardTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java
uitest/src/test/java/com/vaadin/tests/components/grid/GridInWindowResizeTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/escalator/EscalatorRemoveAndAddRowsTest.java
uitest/src/test/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResizeTest.java
uitest/src/test/java/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java
uitest/src/test/java/com/vaadin/tests/components/window/WindowHeaderButtonKeyboardActionsTest.java
uitest/src/test/java/com/vaadin/tests/components/window/WindowTwinColSelectTest.java
uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java
uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java
uitest/src/test/java/com/vaadin/tests/layoutmanager/LayoutDuringStateUpdateTest.java
uitest/src/test/java/com/vaadin/tests/serialization/NoLayoutTest.java
uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsGridOnly.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsNoGrid.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsNonComponent.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/tests/themes/valo/ResponsiveStylesTest.java

index ac8e22b429e65d6b67805819262f16cb078fafa3..a3d51e938f44f1777d385e758eb4c8dfa7ca2989 100644 (file)
@@ -49,6 +49,10 @@ $select-button-negative-width: -25px;
        outline: 5px auto -webkit-focus-ring-color;
        outline-offset: -4px;
 }
+.v-ch & .#{$primaryStyleName}-focus {
+       /* remove safari focus outline offset for chrome (evaluates also as safari) */
+       outline-offset: 0;
+}
 .#{$primaryStyleName}-button {
        width: $select-button-width;
        margin-right: $select-button-negative-width;
index c777a3e5777a0e60cf0e501a4a4db7d4d944ec0c..0dcac0326e30476ab06a45be4b051bdbcc2aa749 100644 (file)
                         <categories.exclude>${categories.exclude}</categories.exclude>
                         <browserstack.identifier>${browserstack.identifier}</browserstack.identifier>
                     </systemPropertyVariables>
-                    <includes>
-                        <include>**/AllTB3Tests.java</include>
-                    </includes>
                 </configuration>
                 <executions>
                     <execution>
+                        <id>no-components</id>
+                        <configuration>
+                            <includes>
+                                <include>**/LimitedTB3TestsNonComponent.java</include>
+                            </includes>
+                        </configuration>
+                        <goals>
+                            <goal>integration-test</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>components-no-grid</id>
+                        <configuration>
+                            <includes>
+                                <include>**/LimitedTB3TestsComponentsNoGrid.java</include>
+                            </includes>
+                        </configuration>
+                        <goals>
+                            <goal>integration-test</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>grid-only</id>
+                        <configuration>
+                            <includes>
+                                <include>**/LimitedTB3TestsComponentsGridOnly.java</include>
+                            </includes>
+                        </configuration>
                         <goals>
                             <goal>integration-test</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>verify</id>
+                        <configuration>
+                            <includes>
+                                <include>**/LimitedTB3TestsNonComponent.java</include>
+                                <include>**/LimitedTB3TestsComponentsNoGrid.java</include>
+                                <include>**/LimitedTB3TestsComponentsGridOnly.java</include>
+                            </includes>
+                        </configuration>
+                        <goals>
                             <goal>verify</goal>
                         </goals>
                     </execution>
index d88da45c36ef73f98968a40f12e4129618ea58fe..cd676d0a144567be4b60d0199cd521949485f527 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridEditorFrozenColumnsUITest-testEditorWithFrozenColumns_ANY_Chrome__noscroll.png and b/uitest/reference-screenshots/chrome/GridEditorFrozenColumnsUITest-testEditorWithFrozenColumns_ANY_Chrome__noscroll.png differ
index a8a7f9bb55fade2df1bb2cc5dbbc4f26d755b1fc..6b56c424f119fd72b08a7ad0baac0459dc9e8e83 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__all-left.png and b/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__all-left.png differ
index 429de6e9d36f4f9b5f012d10e6dcf056662bfef7..66927c2ace49d16db43e5a2ad82404f96408dfb4 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-right.png and b/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-right.png differ
index fc810e5a6ab303a54a566afa1e152dd51eaceb7b..86511ef326237bbcc0a3707001212ac1c2f8c79c 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-textfield-right.png and b/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-button-textfield-right.png differ
index 74658bdd2448810fcd3e9162c7e054d244f17e03..e356916476807dd6be07ea2cfb7318c10e0a76c2 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-right.png and b/uitest/reference-screenshots/chrome/GridLayoutMoveComponentTest-componentsShouldMoveRight_ANY_Chrome__label-right.png differ
index 2b6aa56641bb47019e43c2352225b47e9bbe7c95..5bbcae708af8ab99cf76c23c3788b9f4cb974730 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__buttonMoved.png and b/uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__buttonMoved.png differ
index 4de80aa88f431e07bdf498f8a0de932b1022e0e1..56661d728d631bb9edad8063b28314ca16f5b36d 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__initial.png and b/uitest/reference-screenshots/chrome/GridLayoutWidthChangeTest-layoutIsReduced_ANY_Chrome__initial.png differ
index 9f266e3edbf3b011e1a6bc691e2c9eed66f85683..15e8c42cfbdcb522d38ef36258a6150af96faf7a 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/HComponentSizingTest-ComponentSizing_ANY_Chrome__setSize_-1px.png and b/uitest/reference-screenshots/chrome/HComponentSizingTest-ComponentSizing_ANY_Chrome__setSize_-1px.png differ
index 2f34a2b88b039a1450d70c7bc469cc8f298e1b78..aa2cbb4ac3b9f501116d929a631492f6511a39e6 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/HLayoutSizingTest-LayoutSizing_ANY_Chrome__setSize_-1px.png and b/uitest/reference-screenshots/chrome/HLayoutSizingTest-LayoutSizing_ANY_Chrome__setSize_-1px.png differ
index 1e566798ab681eee13cee2a29b0830eeb3a864d5..91edc2d9bc9d192bd490ad8c6ed72bff4d147234 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/ResponsiveStylesTest-testValoMenuResponsiveParentSize_ANY_Chrome__defaultMenuWidths.png and b/uitest/reference-screenshots/chrome/ResponsiveStylesTest-testValoMenuResponsiveParentSize_ANY_Chrome__defaultMenuWidths.png differ
index 2355afba57b790bf415016d6270cc923c0182400..8a0755b89559a814b6cbe6a7b25276103fed14b1 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__move.png and b/uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__move.png differ
index 5f8b4c3d493ecf80ba2cb65909057cd2338657a4..35b7c2be80294dd11ba346170c905eb1fa8d7914 100755 (executable)
Binary files a/uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__remove.png and b/uitest/reference-screenshots/chrome/VAddReplaceMoveTest-LayoutAlignment_ANY_Chrome__remove.png differ
index b4dc972d896aeb2cf7b3ba5efface6291aeb494c..6b114176a004d0c0728e82ca9d7d921112d2a607 100644 (file)
@@ -5,13 +5,16 @@ import com.vaadin.server.VaadinRequest;
 import com.vaadin.tests.components.AbstractReindeerTestUI;
 import com.vaadin.tests.widgetset.TestingWidgetSet;
 import com.vaadin.tests.widgetset.server.LayoutDuringStateUpdateComponent;
+import com.vaadin.ui.Button;
 
 @Widgetset(TestingWidgetSet.NAME)
 public class LayoutDuringStateUpdate extends AbstractReindeerTestUI {
 
     @Override
     protected void setup(VaadinRequest request) {
-        addComponent(new LayoutDuringStateUpdateComponent());
+        // delay adding of the component to ensure unrelated layouting calls
+        // don't interfere with the test
+        addComponent(new Button("Add component",
+                e -> addComponent(new LayoutDuringStateUpdateComponent())));
     }
-
 }
index 6ccb8d61752d5685427b465a2f2beb1e97b6faa3..18593620152cca2ccf052b753f686a8a303db82d 100644 (file)
@@ -11,6 +11,7 @@ import com.vaadin.tests.widgetset.server.LayoutDuringStateUpdateComponent;
 public class LayoutDuringStateUpdateConnector extends AbstractComponentConnector
         implements PostLayoutListener {
     private int layoutCount = 0;
+    private String changeLog = "";
 
     @Override
     protected void init() {
@@ -29,13 +30,22 @@ public class LayoutDuringStateUpdateConnector extends AbstractComponentConnector
 
         try {
             getLayoutManager().layoutNow();
+
+            // these should never be reached
+            if (changeLog.isEmpty()) {
+                changeLog += " properties: ";
+            }
+            for (String property : stateChangeEvent.getChangedProperties()) {
+                changeLog += property + ", ";
+            }
         } catch (AssertionError e) {
             // Ignore
         }
     }
 
     private void updateLabelText() {
-        getWidget().setText("Layout phase count: " + layoutCount);
+        getWidget().setText("Layout phase count: " + layoutCount + changeLog);
+        changeLog = "";
     }
 
     @Override
index 2f2dd91ea846788cbfaf09ba9ee6e3d40ecdcaff..7ac7ceaf864e49609797b6f9c43caa95be886635 100644 (file)
@@ -5,7 +5,12 @@ import java.util.List;
 import org.junit.Assert;
 import org.junit.Test;
 import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebDriverException;
+import org.openqa.selenium.WebElement;
 import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.support.ui.ExpectedCondition;
 
 import com.vaadin.testbench.elements.MenuBarElement;
 import com.vaadin.testbench.parallel.Browser;
@@ -21,21 +26,53 @@ public class MenuBarDownloadBrowserOpenerUITest extends MultiBrowserTest {
     @Test
     public void testTriggerExtension() {
         openTestURL();
-        MenuBarElement first = $(MenuBarElement.class).first();
-        first.clickItem("TestExtension", "RunMe");
+        MenuBarElement menu = $(MenuBarElement.class).first();
+        clickItem(menu, "TestExtension", "RunMe");
         checkAndCloseAlert();
 
-        first.clickItem("TestExtension", "AddTrigger");
-        first.clickItem("TestExtension", "RunMe");
+        clickItem(menu, "TestExtension", "AddTrigger");
+        clickItem(menu, "TestExtension", "RunMe");
         checkAndCloseAlert();
         checkAndCloseAlert();
 
         sleep(500);
-        first.clickItem("TestExtension", "RemoveTrigger");
-        first.clickItem("TestExtension", "RunMe");
+        clickItem(menu, "TestExtension", "RemoveTrigger");
+        clickItem(menu, "TestExtension", "RunMe");
         checkAndCloseAlert();
     }
 
+    private void clickItem(MenuBarElement menu, String... captions) {
+        // click each given menu item in turn
+        for (String caption : captions) {
+            // wait for the menu item to become available
+            waitUntil(new ExpectedCondition<Boolean>() {
+                @Override
+                public Boolean apply(WebDriver arg0) {
+                    List<WebElement> captionElements = findElements(
+                            By.className("v-menubar-menuitem-caption"));
+                    for (WebElement captionElement : captionElements) {
+                        try {
+                            if (captionElement.getText().equals(caption)) {
+                                return true;
+                            }
+                        } catch (WebDriverException e) {
+                            // stale, detached element is not visible
+                        }
+                    }
+                    return false;
+                }
+
+                @Override
+                public String toString() {
+                    // Expected condition failed: waiting for ...
+                    return caption + " to be available";
+                }
+            });
+            // menu item was found, click it
+            menu.clickItem(caption);
+        }
+    }
+
     private void checkAndCloseAlert() {
         Alert alert = getDriver().switchTo().alert();
         Assert.assertEquals("Trigger", alert.getText());
index 49e8312295144e443010f78b36d407983ca6a4be..4e05f66c082837f06c2e130f77ecdcb5091fa8ab 100644 (file)
@@ -1,5 +1,7 @@
 package com.vaadin.tests.components.datefield;
 
+import static org.junit.Assert.assertEquals;
+
 import org.junit.Test;
 import org.openqa.selenium.By;
 
@@ -7,8 +9,6 @@ import com.vaadin.testbench.elements.DateFieldElement;
 import com.vaadin.testbench.elements.TextFieldElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
-import static org.junit.Assert.assertEquals;
-
 public class DateFieldFocusTest extends MultiBrowserTest {
 
     @Test
@@ -22,10 +22,10 @@ public class DateFieldFocusTest extends MultiBrowserTest {
 
         // open DateField popup
         dateField.findElement(By.className("v-datefield-button")).click();
-        sleep(100);
+        waitUntilLoadingIndicatorNotVisible();
         // close DateField popup
         dateField.findElement(By.className("v-datefield-button")).click();
-        sleep(100);
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("1. focused", getLogRow(0));
         textField.focus();
index 1b9d88957a7598fdc9793623b3082e1235647cb9..d92b3ac2dc60cdd364b2195235ff82d02ea8f674 100644 (file)
@@ -1,12 +1,13 @@
 package com.vaadin.tests.components.datefield;
 
-import com.vaadin.tests.tb3.MultiBrowserTest;
+import static org.junit.Assert.assertNotEquals;
+
 import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.WebElement;
 
-import static org.junit.Assert.assertNotEquals;
+import com.vaadin.tests.tb3.MultiBrowserTest;
 
 public class DateFieldNavigationKeyBoardTest extends MultiBrowserTest {
     @Test
@@ -15,6 +16,8 @@ public class DateFieldNavigationKeyBoardTest extends MultiBrowserTest {
         // Opening pop-up
         findElement(By.className("v-datefield-button")).click();
         waitForElementVisible(By.className("v-datefield-calendarpanel"));
+        waitForElementPresent(
+                By.className("v-datefield-calendarpanel-day-focused"));
         // Focused element in the calendarPanel
         WebElement focused = findElement(
                 By.className("v-datefield-calendarpanel-day-focused"));
index 23a747c4eac1ccb7568362a66d6d26701a06eb34..57d5405ed5ccc3d004abb521df7da13d23267396 100644 (file)
@@ -22,11 +22,12 @@ public class GridEditorFrozenColumnsUITest extends MultiBrowserTest {
         openTestURL();
 
         openEditor(10);
+        waitUntilLoadingIndicatorNotVisible();
         waitForElementPresent(By.className("v-grid-editor"));
         compareScreen("noscroll");
 
         scrollGridHorizontallyTo(100);
-        sleep(500);
+        waitUntilLoadingIndicatorNotVisible();
         compareScreen("scrolled");
     }
 
index 5efcdba1aa76cecc0a6e055b77d8d5b0efaf0e56..ccb99cec633df8f5611872a3c0f5d28623e43454 100644 (file)
@@ -13,6 +13,8 @@ public class GridInWindowResizeTest extends SingleBrowserTest {
     @Test
     public void resizeWindow() {
         openTestURL();
+        waitUntilLoadingIndicatorNotVisible();
+
         GridElement grid = $(GridElement.class).first();
         int col1WidthBefore = grid.getCell(0, 0).getSize().getWidth();
         $(ButtonElement.class).caption("resize").first().click();
index 8c2529a509b13d0fc55897abfb63c0d391a6499a..dfe2158519bfabd1c7315b3c9dc225d972fe3565 100644 (file)
@@ -1,5 +1,9 @@
 package com.vaadin.tests.components.grid;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.junit.Before;
@@ -14,10 +18,6 @@ import com.vaadin.testbench.elements.GridElement.GridCellElement;
 import com.vaadin.testbench.parallel.BrowserUtil;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 public class GridResizeHiddenColumnTest extends MultiBrowserTest {
 
     @Before
@@ -61,6 +61,7 @@ public class GridResizeHiddenColumnTest extends MultiBrowserTest {
                 sidebarPopup.findElements(By.className("gwt-MenuItem")));
         // Click on "Last Name" menu item
         action.click(visibilityToggle).perform();
+        waitUntilLoadingIndicatorNotVisible();
 
         // Check if column "Last Name" is visible
         headerCells = grid.getHeaderCells(0);
@@ -74,7 +75,6 @@ public class GridResizeHiddenColumnTest extends MultiBrowserTest {
         for (GridCellElement e : headerCells) {
             widthSum += e.getSize().getWidth();
         }
-        sleep(100);
         assertEquals("'Last Name' column should take up the remaining space",
                 grid.getHeader().getSize().getWidth(), widthSum, 1d);
     }
@@ -102,5 +102,6 @@ public class GridResizeHiddenColumnTest extends MultiBrowserTest {
                         getXOffset(headerCell, size.getWidth() + posX),
                         getYOffset(headerCell, size.getHeight() / 2))
                 .clickAndHold().moveByOffset(offset, 0).release().perform();
+        waitUntilLoadingIndicatorNotVisible();
     }
 }
index 82c7fda3cb841d67357bb7cfd698dfe60d74058e..0430e7530a9f628b93f8d06ab5f63f36869aabe1 100644 (file)
@@ -27,12 +27,16 @@ public class EscalatorRemoveAndAddRowsTest
         selectMenuPath(GENERAL, POPULATE_COLUMN_ROW);
 
         scrollVerticallyTo(99999);
+        waitUntilLoadingIndicatorNotVisible();
+
         assertTrue("Escalator is not scrolled to bottom.",
                 isElementPresent(By.xpath("//td[text() = 'Row 99: 0,99']")));
 
         selectMenuPath(COLUMNS_AND_ROWS, BODY_ROWS, REMOVE_ALL_INSERT_SCROLL);
 
         scrollVerticallyTo(99999);
+        waitUntilLoadingIndicatorNotVisible();
+
         assertTrue("Escalator is not scrolled to bottom.",
                 isElementPresent(By.xpath("//td[text() = 'Row 29: 0,129']")));
     }
index f40c07823f999d9d43694e6b7f1c297d5c93877f..0390c525091005d2b8f1667b770fb10ff9939f74 100644 (file)
@@ -42,6 +42,10 @@ public class ScrolledTabSheetResizeTest extends MultiBrowserTest {
                 }
                 failed = true;
                 exceptions.append(i + ": " + e.getMessage());
+                if (e.getCause() != null && e.getCause().getMessage() != null
+                        && !e.getCause().getMessage().trim().isEmpty()) {
+                    exceptions.append(" - " + e.getCause().getMessage());
+                }
             } catch (AssertionError e) {
                 if (failed) {
                     exceptions.append(" --- ");
@@ -70,6 +74,10 @@ public class ScrolledTabSheetResizeTest extends MultiBrowserTest {
                 }
                 failed = true;
                 exceptions.append(i + ": " + e.getMessage());
+                if (e.getCause() != null && e.getCause().getMessage() != null
+                        && !e.getCause().getMessage().trim().isEmpty()) {
+                    exceptions.append(" - " + e.getCause().getMessage());
+                }
             } catch (AssertionError e) {
                 if (failed) {
                     exceptions.append(" --- ");
@@ -86,9 +94,11 @@ public class ScrolledTabSheetResizeTest extends MultiBrowserTest {
     private void testResize(int start)
             throws IOException, InterruptedException {
         testBench().resizeViewPortTo(start, 600);
+        waitUntilLoadingIndicatorNotVisible();
 
         int iterations = 0;
         while (scrollRight() && iterations < 50) {
+            waitUntilLoadingIndicatorNotVisible();
             ++iterations;
         }
 
@@ -108,6 +118,7 @@ public class ScrolledTabSheetResizeTest extends MultiBrowserTest {
         // assertNoExtraRoom(start);
 
         testBench().resizeViewPortTo(start + 150, 600);
+        waitUntilLoadingIndicatorNotVisible();
 
         assertNoExtraRoom(start + 150);
     }
index 2ba5cfa28f99cacdd5583fbdf52f6421806df37b..ea33122541e123f071b6f42e6c2b7dae7b4eed5d 100644 (file)
@@ -25,8 +25,17 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         Actions builder = new Actions(driver);
         builder.click(textArea);
         builder.sendKeys(textArea, "first line asdf");
+        builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder.sendKeys(Keys.ENTER);
+        builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder.sendKeys(textArea, "second line jkl;");
+        builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder.perform();
 
         // Should not have triggered shortcut
@@ -41,9 +50,16 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         Actions builder = new Actions(driver);
         builder.click(textArea);
         builder.sendKeys(textArea, "first line asdf");
+        builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder.sendKeys(Keys.ESCAPE);
+        builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder.sendKeys(textArea, "second line jkl;");
         builder.perform();
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("1. Escape button pressed", getLogRow(0));
     }
@@ -56,11 +72,16 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         builder2.click(textField);
 
         builder2.sendKeys("third line");
-        sleep(100);
+        builder2.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder2.sendKeys(Keys.ENTER);
-        sleep(100);
+        builder2.perform();
+        waitUntilLoadingIndicatorNotVisible();
+
         builder2.sendKeys(Keys.ESCAPE);
         builder2.perform();
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("1. Enter button pressed", getLogRow(1));
         assertEquals("2. Escape button pressed", getLogRow(0));
@@ -74,9 +95,12 @@ public class TextAreaEventPropagationTest extends MultiBrowserTest {
         builder2.click(textField);
 
         builder2.sendKeys("third line");
-        builder2.sendKeys(Keys.ENTER);
+        builder2.perform();
+        waitUntilLoadingIndicatorNotVisible();
 
+        builder2.sendKeys(Keys.ENTER);
         builder2.perform();
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("1. Enter button pressed", getLogRow(0));
     }
index 93986f487e53e95637710b2567e1ee097e3f8c33..9e7d647e9c438bcb844348ab9ce0a2ba4e969e8e 100644 (file)
@@ -1,5 +1,7 @@
 package com.vaadin.tests.components.window;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 
 import org.junit.Test;
@@ -12,8 +14,6 @@ import com.vaadin.testbench.By;
 import com.vaadin.testbench.elements.WindowElement;
 import com.vaadin.tests.tb3.SingleBrowserTest;
 
-import static org.junit.Assert.assertTrue;
-
 public class WindowHeaderButtonKeyboardActionsTest extends SingleBrowserTest {
 
     private static final String HEADER_CLASS = "v-window-header";
@@ -191,10 +191,7 @@ public class WindowHeaderButtonKeyboardActionsTest extends SingleBrowserTest {
 
         // click button with mouse and wait
         closeButton.click();
-        sleep(200);
-
-        assertTrue("Window is not closed when focused element is clicked",
-                findElements(By.className("v-window")).size() == 0);
+        waitForElementNotPresent(By.className("v-window"));
     }
 
     // Tests for maximize-restore button
index 23635b100414696893816d12d2ef0dc9604d5896..47d42e7941257f616fe11af70a6b13c50590b7b7 100644 (file)
@@ -1,5 +1,8 @@
 package com.vaadin.tests.components.window;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
@@ -8,14 +11,12 @@ import com.vaadin.testbench.By;
 import com.vaadin.testbench.elements.TwinColSelectElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 public class WindowTwinColSelectTest extends MultiBrowserTest {
 
     @Test
     public void testBothVisibleInitially() {
         openTestURL();
+        waitUntilLoadingIndicatorNotVisible();
         TwinColSelectElement twinColSelect = $(TwinColSelectElement.class)
                 .first();
         WebElement optionsElement = twinColSelect.getOptionsElement();
index 7287372adb92d9f837c10783b47b0da66f865291..8e0faa31d6a7baccdaf55b6acef1ec202d067437 100644 (file)
@@ -71,6 +71,7 @@ public class ResponsiveUITest extends MultiBrowserTest {
     @Test
     public void testResizingWindowReflowsLayout() throws Exception {
         openTestURL();
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("401px-600px",
                 $(".v-csslayout-grid.first").getAttribute("width-range"));
@@ -78,6 +79,7 @@ public class ResponsiveUITest extends MultiBrowserTest {
                 $(".v-csslayout-grid.second").getAttribute("width-range"));
 
         testBench().resizeViewPortTo(1224, 768);
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("601-800",
                 $(".v-csslayout-grid.first").getAttribute("width-range"));
@@ -85,6 +87,7 @@ public class ResponsiveUITest extends MultiBrowserTest {
                 $(".v-csslayout-grid.second").getAttribute("width-range"));
 
         testBench().resizeViewPortTo(674, 768);
+        waitUntilLoadingIndicatorNotVisible();
 
         assertEquals("201px-400px",
                 $(".v-csslayout-grid.first").getAttribute("width-range"));
index 532277059bb662d39281d86badd3a15c3e12629b..e59b5d59a10784993a5debe0d945d3877f2a69d6 100644 (file)
@@ -15,6 +15,7 @@ public class FontIconsTest extends MultiBrowserTest {
     @Test
     public void checkScreenshot() throws IOException {
         openTestURL();
+        waitUntilLoadingIndicatorNotVisible();
         compareScreen("allVaadinIcons");
     }
 
index 6f33b5bb6e83230e447f6936523458de33a040c0..607e089d204932e70fd5b134f36c349ef0cc1641 100644 (file)
@@ -6,6 +6,7 @@ import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
 
+import com.vaadin.testbench.elements.ButtonElement;
 import com.vaadin.tests.tb3.SingleBrowserTest;
 
 public class LayoutDuringStateUpdateTest extends SingleBrowserTest {
@@ -13,9 +14,14 @@ public class LayoutDuringStateUpdateTest extends SingleBrowserTest {
     @Test
     public void layoutDuringStateUpdate() {
         openTestURL();
+        waitUntilLoadingIndicatorNotVisible();
 
-        WebElement label = findElement(By.className("gwt-Label"));
+        // add the custom component
+        $(ButtonElement.class).first().click();
+        waitUntilLoadingIndicatorNotVisible();
 
+        // ensure the layouting failed to be triggered during the state update
+        WebElement label = findElement(By.className("gwt-Label"));
         assertEquals("Layout phase count: 1", label.getText());
     }
 
index 47469392413d701efb93b2d96be205e966d91efc..545d2412f8a06059b474b42fc549a42220deee7a 100644 (file)
@@ -13,13 +13,18 @@ public class NoLayoutTest extends MultiBrowserTest {
     @Test
     public void testNoLayout() {
         openTestURL();
-        assertCounts(1, 0);
+        // In some situations initial layouting is done in batches. That is OK,
+        // the point of this test is to ensure each subsequent action only
+        // causes expected amount of layouting rounds.
+        int offset = getCount("layoutCount") - 1;
+
+        assertCounts(1 + offset, 0);
 
         $(CheckBoxElement.class).caption("UI polling enabled").first()
                 .findElement(By.tagName("input")).click();
 
         // Toggling check box requires layout
-        assertCounts(2, 0);
+        assertCounts(2 + offset, 0);
 
         try {
             Thread.sleep(2000);
@@ -27,34 +32,34 @@ public class NoLayoutTest extends MultiBrowserTest {
             e.printStackTrace();
         }
         // Count should not change even with polling enabled
-        assertCounts(2, 0);
+        assertCounts(2 + offset, 0);
 
         // Disable polling
         $(CheckBoxElement.class).caption("UI polling enabled").first()
                 .findElement(By.tagName("input")).click();
         // Toggling checkbox layotus again
-        assertCounts(3, 0);
+        assertCounts(3 + offset, 0);
 
         $(ButtonElement.class).caption("Change regular state").first().click();
         // Updating normal state layouts
-        assertCounts(4, 0);
+        assertCounts(4 + offset, 0);
 
         $(ButtonElement.class).caption("Change @NoLayout state").first();
         // Updating @NoLayout state does not layout
-        assertCounts(4, 0);
+        assertCounts(4 + offset, 0);
 
         $(ButtonElement.class).caption("Do regular RPC").first().click();
         // Doing normal RPC layouts
-        assertCounts(5, 0);
+        assertCounts(5 + offset, 0);
 
         $(ButtonElement.class).caption("Do @NoLayout RPC").first().click();
         // Doing @NoLayout RPC does not layout, but updates the RPC count
-        assertCounts(5, 1);
+        assertCounts(5 + offset, 1);
 
         $(ButtonElement.class).caption("Update LegacyComponent").first()
                 .click();
         // Painting LegacyComponent layouts
-        assertCounts(6, 1);
+        assertCounts(6 + offset, 1);
     }
 
     private void assertCounts(int layoutCount, int rpcCount) {
index cd5eb5d17e5f1bc213f65871bda7b98daf2e43c8..c822901b1ffae9e26138795c70ba04f3ce57b172 100644 (file)
@@ -136,10 +136,6 @@ public abstract class AbstractTB3Test extends ParallelTest {
         int h = SCREENSHOT_HEIGHT;
 
         try {
-            if (BrowserUtil.isChrome(getDesiredCapabilities())) {
-                // Chrome 85 keeps failing in this task...
-                sleep(200);
-            }
             testBench().resizeViewPortTo(w, h);
         } catch (UnsupportedOperationException e) {
             // Opera does not support this...
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsGridOnly.java b/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsGridOnly.java
new file mode 100644 (file)
index 0000000..9c07140
--- /dev/null
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tb3;
+
+import java.io.IOException;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.model.InitializationError;
+
+import com.vaadin.tests.tb3.LimitedTB3TestsComponentsGridOnly.LimitedTB3TestsComponentsGridOnlySuite;
+
+/**
+ * Test consisting of all TB3 tests within package
+ * com.vaadin.tests.components.grid (classes extending AbstractTB3Test).
+ *
+ * @author Vaadin Ltd
+ */
+@RunWith(LimitedTB3TestsComponentsGridOnlySuite.class)
+public class LimitedTB3TestsComponentsGridOnly {
+
+    public static class LimitedTB3TestsComponentsGridOnlySuite
+            extends TB3TestSuite {
+
+        public LimitedTB3TestsComponentsGridOnlySuite(Class<?> klass)
+                throws InitializationError, IOException {
+            super(klass, AbstractTB3Test.class,
+                    "com.vaadin.tests.components.grid", new String[] {});
+        }
+
+    }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsNoGrid.java b/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsComponentsNoGrid.java
new file mode 100644 (file)
index 0000000..e719c5e
--- /dev/null
@@ -0,0 +1,31 @@
+package com.vaadin.tests.tb3;
+
+import java.io.IOException;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.model.InitializationError;
+
+import com.vaadin.tests.tb3.LimitedTB3TestsComponentsNoGrid.LimitedTB3TestsComponentsNoGridSuite;
+
+/**
+ * Test consisting of all TB3 tests within package com.vaadin.tests.components
+ * except those within package com.vaadin.tests.components.grid (classes
+ * extending AbstractTB3Test).
+ *
+ * @author Vaadin Ltd
+ */
+@RunWith(LimitedTB3TestsComponentsNoGridSuite.class)
+public class LimitedTB3TestsComponentsNoGrid {
+
+    public static class LimitedTB3TestsComponentsNoGridSuite
+            extends TB3TestSuite {
+
+        public LimitedTB3TestsComponentsNoGridSuite(Class<?> klass)
+                throws InitializationError, IOException {
+            super(klass, AbstractTB3Test.class, "com.vaadin.tests.components",
+                    new String[] { "com.vaadin.tests.components.grid" });
+        }
+
+    }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsNonComponent.java b/uitest/src/test/java/com/vaadin/tests/tb3/LimitedTB3TestsNonComponent.java
new file mode 100644 (file)
index 0000000..2537389
--- /dev/null
@@ -0,0 +1,31 @@
+package com.vaadin.tests.tb3;
+
+import java.io.IOException;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.model.InitializationError;
+
+import com.vaadin.tests.tb3.LimitedTB3TestsNonComponent.LimitedTB3TestsNonComponentSuite;
+
+/**
+ * Test consisting of all TB3 tests except integration tests and component tests
+ * (classes extending AbstractTB3Test, excludes packages
+ * com.vaadin.test.integration and com.vaadin.tests.components).
+ *
+ * @author Vaadin Ltd
+ */
+@RunWith(LimitedTB3TestsNonComponentSuite.class)
+public class LimitedTB3TestsNonComponent {
+
+    public static class LimitedTB3TestsNonComponentSuite extends TB3TestSuite {
+
+        public LimitedTB3TestsNonComponentSuite(Class<?> klass)
+                throws InitializationError, IOException {
+            super(klass, AbstractTB3Test.class, "com.vaadin.tests",
+                    new String[] { "com.vaadin.tests.integration",
+                            "com.vaadin.tests.components" });
+        }
+
+    }
+
+}
index a243c25a583da28ba63a13cc502aa50997569f97..b8b376cff40b3350a6cfa4451b7f57dabf6989fe 100644 (file)
@@ -52,7 +52,7 @@ public class ResponsiveStylesTest extends MultiBrowserTest {
         WebElement wideMenu = menus.get(WIDE_ELEMENT_INDEX);
         int wideWidth = wideMenu.getSize().width;
         assertThat(wideWidth, equalTo(WIDE_WIDTH));
-        sleep(200);
+        sleep(300);
 
         compareScreen("defaultMenuWidths");
     }