From 436202b4e6675e5457e1f9ff0ae76d145350b656 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Wed, 28 Oct 2026 17:51:33 -0700 Subject: [PATCH 1/3] Wait for site search bar to finish expanding before typing --- src/org/labkey/test/components/html/SiteNavBar.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/labkey/test/components/html/SiteNavBar.java b/src/org/labkey/test/components/html/SiteNavBar.java index 70a8391d7f..e1939035cb 100644 --- a/src/org/labkey/test/components/html/SiteNavBar.java +++ b/src/org/labkey/test/components/html/SiteNavBar.java @@ -183,6 +183,9 @@ public WebElement expandSearchBar() { elementCache().searchToggle.click(); WebDriverWrapper.waitFor(this::isSearchBarExpanded, "Search bar didn't expand", WebDriverWrapper.WAIT_FOR_JAVASCRIPT); + // 'active' starts a width transition; the input is clipped and not interactable until it finishes + WebDriverWrapper.waitFor(() -> elementCache().globalSearch.getSize().getWidth() >= elementCache().searchInput.getSize().getWidth(), + "Search bar didn't finish expanding", WebDriverWrapper.WAIT_FOR_JAVASCRIPT); } return elementCache().searchInput; } @@ -214,6 +217,8 @@ protected class Elements extends Component.ElementCache .findWhenNeeded(this).withTimeout(WebDriverWrapper.WAIT_FOR_JAVASCRIPT); public final WebElement searchToggle = Locator.id("global-search-trigger") .findWhenNeeded(this).withTimeout(WebDriverWrapper.WAIT_FOR_JAVASCRIPT); + public final WebElement globalSearch = Locator.id("global-search") + .findWhenNeeded(this).withTimeout(WebDriverWrapper.WAIT_FOR_JAVASCRIPT); public final WebElement searchInput = Locator.input("q") .findWhenNeeded(this).withTimeout(WebDriverWrapper.WAIT_FOR_JAVASCRIPT); public final WebElement searchSubmitInput = Locator.tagWithClass("a", "btn-search") From 09b2c21cbf913e3c52d6db022fad5e747671605c Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Wed, 28 Oct 2026 18:15:02 -0700 Subject: [PATCH 2/3] Wait for search bar animation even when already expanded --- src/org/labkey/test/components/html/SiteNavBar.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/labkey/test/components/html/SiteNavBar.java b/src/org/labkey/test/components/html/SiteNavBar.java index e1939035cb..a85bb1a6b7 100644 --- a/src/org/labkey/test/components/html/SiteNavBar.java +++ b/src/org/labkey/test/components/html/SiteNavBar.java @@ -29,6 +29,7 @@ import org.labkey.test.pages.search.SearchResultsPage; import org.labkey.test.pages.user.ShowUsersPage; import org.labkey.test.util.AbstractUserHelper; +import org.labkey.test.util.LabKeyExpectedConditions; import org.labkey.test.util.LogMethod; import org.labkey.test.util.LoggedParam; import org.openqa.selenium.NoSuchElementException; @@ -183,10 +184,9 @@ public WebElement expandSearchBar() { elementCache().searchToggle.click(); WebDriverWrapper.waitFor(this::isSearchBarExpanded, "Search bar didn't expand", WebDriverWrapper.WAIT_FOR_JAVASCRIPT); - // 'active' starts a width transition; the input is clipped and not interactable until it finishes - WebDriverWrapper.waitFor(() -> elementCache().globalSearch.getSize().getWidth() >= elementCache().searchInput.getSize().getWidth(), - "Search bar didn't finish expanding", WebDriverWrapper.WAIT_FOR_JAVASCRIPT); } + // 'active' starts a width transition; the input is clipped and not interactable until it finishes + getWrapper().shortWait().until(LabKeyExpectedConditions.animationIsDone(elementCache().globalSearch)); return elementCache().searchInput; } From 4a24fe98e4a40ad8967dae42951e063c6d136219 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Thu, 29 Oct 2026 06:44:14 -0700 Subject: [PATCH 3/3] Treat a page without Ext4 loaded as not ready in waitForComponent --- src/org/labkey/test/util/ext4cmp/Ext4CmpRef.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/labkey/test/util/ext4cmp/Ext4CmpRef.java b/src/org/labkey/test/util/ext4cmp/Ext4CmpRef.java index e638a9f463..0891507e4b 100644 --- a/src/org/labkey/test/util/ext4cmp/Ext4CmpRef.java +++ b/src/org/labkey/test/util/ext4cmp/Ext4CmpRef.java @@ -87,7 +87,7 @@ public void waitForEnabled() @LogMethod(quiet = true) public static void waitForComponent(final WebDriverWrapper test, @LoggedParam final String query) { - test.waitFor(() -> (Boolean)test.executeScript("return !!Ext4.ComponentQuery.query(\"" + query + "\").length;"), + test.waitFor(() -> (Boolean)test.executeScript("return !!window.Ext4 && !!Ext4.ComponentQuery.query(\"" + query + "\").length;"), "Component did not appear: " + query, WebDriverWrapper.WAIT_FOR_JAVASCRIPT); }