File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 2525import java .util .HashMap ;
2626import java .util .List ;
2727import java .util .Map ;
28+ import java .util .Objects ;
2829
2930import static org .labkey .test .WebDriverWrapper .sleep ;
3031
@@ -301,13 +302,18 @@ public AliquotViewOptions getCurrentAliquotView()
301302 */
302303 public void setAliquotView (AliquotViewOptions view )
303304 {
305+
306+ // Do nothing if currently on the requested menu item.
307+ if (getCurrentAliquotView ().equals (view ))
308+ return ;
309+
304310 // Need to identify where we are. The menu text is contextual to the page.
305- String url = getDriver ().getCurrentUrl ().toLowerCase ();
311+ String url = Objects . requireNonNull ( getDriver ().getCurrentUrl () ).toLowerCase ();
306312 boolean onSourcesPage = url .contains ("#/sources/" );
307313 boolean onSamplePage = url .contains ("#/samples/" );
308314
309315 String currentButtonText = currentAliquotViewText ();
310- String menuChoice = "" ;
316+ final String menuChoice ;
311317
312318 switch (view )
313319 {
@@ -354,10 +360,13 @@ else if(onSamplePage)
354360 case ALIQUOTS :
355361 menuChoice = "Aliquots Only" ;
356362 break ;
363+ default :
364+ menuChoice = "" ;
357365 }
358366
367+ // Ideally should call _queryGrid.doAndWaitForUpdate(... but that causes the grid to go stale and is tricky to
368+ // get a recover the reference to it.
359369 doMenuAction (currentButtonText , Arrays .asList (menuChoice ));
360-
361370 }
362371
363372 public GridBar searchFor (String searchStr )
Original file line number Diff line number Diff line change 2121import org .labkey .test .util .TestDataGenerator ;
2222import org .labkey .test .util .exp .SampleTypeAPIHelper ;
2323import org .labkey .test .util .search .SearchAdminAPIHelper ;
24- import org .openqa .selenium .Keys ;
2524import org .openqa .selenium .WebElement ;
2625
2726import java .io .IOException ;
You can’t perform that action at this time.
0 commit comments