diff --git a/src/org/labkey/test/components/html/SiteNavBar.java b/src/org/labkey/test/components/html/SiteNavBar.java index 70a8391d7f..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; @@ -184,6 +185,8 @@ 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 + getWrapper().shortWait().until(LabKeyExpectedConditions.animationIsDone(elementCache().globalSearch)); 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") 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); }