diff --git a/src/org/labkey/test/components/ui/grids/ResponsiveGrid.java b/src/org/labkey/test/components/ui/grids/ResponsiveGrid.java index cf643d2d19..e8bfad7634 100644 --- a/src/org/labkey/test/components/ui/grids/ResponsiveGrid.java +++ b/src/org/labkey/test/components/ui/grids/ResponsiveGrid.java @@ -4,6 +4,7 @@ */ package org.labkey.test.components.ui.grids; +import org.awaitility.Awaitility; import org.jetbrains.annotations.Nullable; import org.labkey.remoteapi.query.Filter; import org.labkey.test.Locator; @@ -26,6 +27,7 @@ import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -357,20 +359,16 @@ public void editColumnLabel(CharSequence columnIdentifier, String newColumnLabel .keyUp(Keys.SHIFT) .perform(); - // Enter the new text. - textEdit.sendKeys(newColumnLabel, Keys.RETURN); + doAndWaitForUpdate(()-> { + textEdit.sendKeys(newColumnLabel, Keys.RETURN); - getWrapper().shortWait() + getWrapper().shortWait() .withMessage("Column label edit text box did not go away.") .until(ExpectedConditions.stalenessOf(textEdit)); - doAndWaitForUpdate(()-> - WebDriverWrapper.waitFor(()-> WebElementUtils.getTextContent(headerCell).equals(newColumnLabel), - "Column header not updated.", 1_000) - ); - waitForLoaded(); - clearElementCache(); - + Awaitility.await().atMost(Duration.ofSeconds(1)).untilAsserted(() -> assertEquals("Column label", + newColumnLabel, WebElementUtils.getTextContent(headerCell))); + }); } /**