Skip to content

Commit 1cdb83f

Browse files
committed
Improve QueryGrid synchronization
1 parent 6cc9bcd commit 1cdb83f

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/org/labkey/test/WebDriverWrapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ public long beginAt(String url, int millis, boolean acceptAlerts)
12351235
long elapsedTime = doAndWaitForPageToLoad(() -> {
12361236
try
12371237
{
1238+
mouseOut();
12381239
getDriver().navigate().to(fullURL);
12391240
}
12401241
catch (TimeoutException ex)
@@ -3006,9 +3007,7 @@ public void mouseOut()
30063007
try
30073008
{
30083009
scrollToTop();
3009-
WebElement root = Locators.documentRoot.findElement(getDriver());
3010-
final Dimension rootSize = root.getSize();
3011-
new Actions(getDriver()).moveToElement(root, - (rootSize.getWidth() / 2), - (rootSize.getHeight() / 2)).perform();
3010+
new Actions(getDriver()).moveToLocation(0, 0).perform();
30123011
}
30133012
catch (WebDriverException ignore) { }
30143013
}

src/org/labkey/test/components/ui/grids/QueryGrid.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public QueryGrid waitForRecordCount(int expectedCount, int milliseconds)
221221
@Override
222222
public void doAndWaitForUpdate(Runnable func)
223223
{
224+
waitForLoaded();
224225
Optional<WebElement> optionalStatus = elementCache().selectionStatusContainerLoc.findOptionalElement(elementCache());
225226

226227
func.run();

src/org/labkey/test/components/ui/grids/ResponsiveGrid.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public WebElement getComponentElement()
6666
public Boolean isLoaded()
6767
{
6868
return getComponentElement().isDisplayed() &&
69-
(!Locators.loadingGrid.existsIn(this) &&
69+
!Locators.loadingGrid.existsIn(this) &&
7070
!Locators.spinner.existsIn(this) &&
71-
Locator.tag("td").existsIn(this)) ||
72-
getGridEmptyMessage().isPresent();
71+
(Locator.tag("td").existsIn(this) ||
72+
getGridEmptyMessage().isPresent());
7373
}
7474

7575
protected void waitForLoaded()
@@ -788,7 +788,7 @@ public Optional<String> getGridEmptyMessage()
788788

789789
try
790790
{
791-
WebElement tr = Locator.tagWithClass("tr", "grid-empty").refindWhenNeeded(this);
791+
WebElement tr = Locator.tagWithClass("tr", "grid-empty").findWhenNeeded(this);
792792
if (tr.isDisplayed())
793793
{
794794
msg = Optional.of(Locator.tag("td").findElement(tr).getText());

0 commit comments

Comments
 (0)