Skip to content
15 changes: 12 additions & 3 deletions src/org/labkey/test/components/ui/grids/GridBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static org.labkey.test.WebDriverWrapper.sleep;

Expand Down Expand Up @@ -301,13 +302,18 @@ public AliquotViewOptions getCurrentAliquotView()
*/
public void setAliquotView(AliquotViewOptions view)
{

// Do nothing if currently on the requested menu item.
if (getCurrentAliquotView().equals(view))
return;

// Need to identify where we are. The menu text is contextual to the page.
String url = getDriver().getCurrentUrl().toLowerCase();
String url = Objects.requireNonNull(getDriver().getCurrentUrl()).toLowerCase();
boolean onSourcesPage = url.contains("#/sources/");
boolean onSamplePage = url.contains("#/samples/");

String currentButtonText = currentAliquotViewText();
String menuChoice = "";
final String menuChoice;

switch (view)
{
Expand Down Expand Up @@ -354,10 +360,13 @@ else if(onSamplePage)
case ALIQUOTS:
menuChoice = "Aliquots Only";
break;
default:
menuChoice = "";
}

// Ideally should call _queryGrid.doAndWaitForUpdate(... but that causes the grid to go stale and is tricky to
// get a recover the reference to it.
doMenuAction(currentButtonText, Arrays.asList(menuChoice));

}

public GridBar searchFor(String searchStr)
Expand Down
1 change: 0 additions & 1 deletion src/org/labkey/test/tests/SampleTypeRenameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.labkey.test.util.TestDataGenerator;
import org.labkey.test.util.exp.SampleTypeAPIHelper;
import org.labkey.test.util.search.SearchAdminAPIHelper;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;

import java.io.IOException;
Expand Down