Skip to content

Commit

Permalink
QueryGrid: Add showChart and closeChart
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-alan committed Aug 29, 2023
1 parent 30f2ad8 commit 7d5e742
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/org/labkey/test/components/ui/grids/QueryGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,17 @@ public QueryGrid resetToDefaultState(boolean revertDefaultView)
return this;
}

public WebElement showChart(String chartName)
{
elementCache().chartsMenu.clickSubMenu(false, chartName);
return elementCache().svgChart;
}

public void closeChart()
{
elementCache().closeButton.click();
}

/**
* possible this is either a GridPanel, or a QueryGridPanel (QGP is to be deprecated).
* use this to test which one so we can fork behavior until QGP is gone
Expand Down Expand Up @@ -721,6 +732,16 @@ public WebElement panelHeader()
return Locator.xpath("preceding-sibling::div[contains(@class,'panel-heading')]").findWhenNeeded(this);
}

final BootstrapMenu chartsMenu = new MultiMenu.MultiMenuFinder(getDriver()).withText("Charts").findWhenNeeded(this);

final WebElement chartPanel = Locator.byClass("chart-panel").refindWhenNeeded(this);

final WebElement svgChart = Locator.byClass("svg-chart")
.refindWhenNeeded(chartPanel)
.withTimeout(WAIT_FOR_JAVASCRIPT);

final WebElement closeButton = Locator.tagContainingText("button", "Close").refindWhenNeeded(chartPanel);

}

public static class QueryGridFinder extends WebDriverComponentFinder<QueryGrid, QueryGridFinder>
Expand Down

0 comments on commit 7d5e742

Please sign in to comment.