Skip to content

Commit ba8b8a7

Browse files
authored
Dismiss popover for responsive grid (#2874)
1 parent 7205dfb commit ba8b8a7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ public void clickColumnMenuItem(CharSequence columnIdentifier, String menuText,
328328
WebElement menu = Locator.css("ul.grid-header-cell__dropdown-menu.open").findWhenNeeded(getDriver());
329329
WebElement menuItem = Locator.css("li > a").containing(menuText).findWhenNeeded(menu);
330330
waitFor(menuItem::isDisplayed, 1000);
331+
dismissPopover();
331332
if (waitForUpdate)
332333
doAndWaitForUpdate(menuItem::click);
333334
else
@@ -800,6 +801,17 @@ public Optional<String> getGridEmptyMessage()
800801
return msg;
801802
}
802803

804+
public void dismissPopover()
805+
{
806+
getWrapper().mouseOut();
807+
Locators.popover.findOptionalElement(getDriver()).ifPresent(popover -> {
808+
getWrapper().mouseOver(popover);
809+
getWrapper().mouseOut();
810+
getWrapper().mouseOver(elementCache().getGridHeaderManager().getColumnHeader(0).getElement());
811+
getWrapper().shortWait().until(ExpectedConditions.invisibilityOf(popover));
812+
});
813+
}
814+
803815
public List<FieldReference> getHeaders()
804816
{
805817
return Collections.unmodifiableList(elementCache().findHeaders());
@@ -971,6 +983,7 @@ static public Locator.XPathLocator responsiveGridByBaseId(String baseGridId)
971983
static final Locator emptyGrid = Locator.css("tbody tr.grid-empty");
972984
static final Locator spinner = Locator.byClass("fa-spinner");
973985
static final Locator headerCells = Locator.tagWithClass("th", "grid-header-cell");
986+
static final Locator popover = Locator.byClass("popover");
974987
static public Locator.XPathLocator headerCellBody(String label)
975988
{
976989
return Locator.tagWithClass("div", "grid-header-cell__body")

0 commit comments

Comments
 (0)