File tree Expand file tree Collapse file tree
src/org/labkey/test/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ public String grayTextPreviewInstruction()
527527 }
528528
529529 private final Locator previewBodyLoc = Locator .tagWithClass ("div" , "chart-builder-preview-body" );
530- private final Locator svgLoc = Locator .tagWithClass ("div" , "svg-chart__chart" );
530+ private final Locator svgLoc = Locator .tagWithClass ("div" , "svg-chart__chart" ). childTag ( "svg" ) ;
531531
532532 public WebElement svg ()
533533 {
Original file line number Diff line number Diff line change @@ -719,7 +719,14 @@ public QueryGrid resetToDefaultState(boolean revertDefaultView)
719719
720720 public QueryChartPanel showChart (String chartName )
721721 {
722+ // if there was a different chart already shown, wait for it to close first
723+ // NOTE: this will need to be updated soon with the changes for the "multiple chart rendering" feature
724+ WebElement prevChart = hasChartPanel () ? getChartPanel ().getSvgChart () : null ;
725+
722726 elementCache ().chartsMenu .clickSubMenu (false , chartName );
727+
728+ if (prevChart != null )
729+ getWrapper ().shortWait ().until (ExpectedConditions .stalenessOf (prevChart ));
723730 return getChartPanel ();
724731 }
725732
@@ -737,6 +744,12 @@ public QueryChartPanel getChartPanel()
737744 return new QueryChartPanel .QueryChartPanelFinder (getDriver (), this ).waitFor (this );
738745 }
739746
747+ public boolean hasChartPanel ()
748+ {
749+ QueryChartPanel chartPanel = new QueryChartPanel .QueryChartPanelFinder (getDriver (), this ).findOrNull (this );
750+ return chartPanel != null ;
751+ }
752+
740753 public WebElement showRReport (String reportName )
741754 {
742755 elementCache ().chartsMenu .clickSubMenu (false , reportName );
You can’t perform that action at this time.
0 commit comments