From 5a5209c2d8cc5fec0fa1e99e5b323e22cddab58f Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Wed, 3 Dec 2025 19:34:32 -0800 Subject: [PATCH 1/5] Update error messages for MSSQL runs. Fixed some errors for calculated columns when running on MSSQL. Use RegEx to validate time values if milliseconds are expected. Trim double value returned from DB. Wait for grid refresh when applying a view choice. --- src/org/labkey/test/components/ui/grids/GridBar.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/labkey/test/components/ui/grids/GridBar.java b/src/org/labkey/test/components/ui/grids/GridBar.java index d82c9b6766..3f4e6c8a40 100644 --- a/src/org/labkey/test/components/ui/grids/GridBar.java +++ b/src/org/labkey/test/components/ui/grids/GridBar.java @@ -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; @@ -302,7 +303,7 @@ public AliquotViewOptions getCurrentAliquotView() public void setAliquotView(AliquotViewOptions view) { // 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/"); @@ -356,8 +357,12 @@ else if(onSamplePage) break; } - doMenuAction(currentButtonText, Arrays.asList(menuChoice)); + // Do nothing if currently on the requested menu item. + if (currentButtonText.equals(menuChoice)) + return; + String finalMenuChoice = menuChoice; + _queryGrid.doAndWaitForUpdate(()->doMenuAction(currentButtonText, Arrays.asList(finalMenuChoice))); } public GridBar searchFor(String searchStr) From 96f730c62c16216dbb14a4b07d9a990aa15a1bcf Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Mon, 8 Dec 2025 14:45:01 -0800 Subject: [PATCH 2/5] Don't change grid view if on the current view. Wait for various elements, etc... --- src/org/labkey/test/components/ui/grids/GridBar.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/test/components/ui/grids/GridBar.java b/src/org/labkey/test/components/ui/grids/GridBar.java index 3f4e6c8a40..e21ee7bfc1 100644 --- a/src/org/labkey/test/components/ui/grids/GridBar.java +++ b/src/org/labkey/test/components/ui/grids/GridBar.java @@ -302,6 +302,11 @@ 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 = Objects.requireNonNull(getDriver().getCurrentUrl()).toLowerCase(); boolean onSourcesPage = url.contains("#/sources/"); @@ -357,10 +362,6 @@ else if(onSamplePage) break; } - // Do nothing if currently on the requested menu item. - if (currentButtonText.equals(menuChoice)) - return; - String finalMenuChoice = menuChoice; _queryGrid.doAndWaitForUpdate(()->doMenuAction(currentButtonText, Arrays.asList(finalMenuChoice))); } From 6e1286a0798322c61a724db5c1c5661f65f597ae Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Tue, 9 Dec 2025 08:23:17 -0800 Subject: [PATCH 3/5] Remove unused import. --- src/org/labkey/test/tests/SampleTypeRenameTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/org/labkey/test/tests/SampleTypeRenameTest.java b/src/org/labkey/test/tests/SampleTypeRenameTest.java index 13168753d7..ec921290e1 100644 --- a/src/org/labkey/test/tests/SampleTypeRenameTest.java +++ b/src/org/labkey/test/tests/SampleTypeRenameTest.java @@ -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; From 11d7b92747e04d05543602e2ff07ce1bfeab59fe Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Tue, 9 Dec 2025 16:00:50 -0800 Subject: [PATCH 4/5] Make code better. --- src/org/labkey/test/components/ui/grids/GridBar.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/labkey/test/components/ui/grids/GridBar.java b/src/org/labkey/test/components/ui/grids/GridBar.java index e21ee7bfc1..4b16efec4b 100644 --- a/src/org/labkey/test/components/ui/grids/GridBar.java +++ b/src/org/labkey/test/components/ui/grids/GridBar.java @@ -313,7 +313,7 @@ public void setAliquotView(AliquotViewOptions view) boolean onSamplePage = url.contains("#/samples/"); String currentButtonText = currentAliquotViewText(); - String menuChoice = ""; + final String menuChoice; switch (view) { @@ -360,10 +360,11 @@ else if(onSamplePage) case ALIQUOTS: menuChoice = "Aliquots Only"; break; + default: + menuChoice = ""; } - String finalMenuChoice = menuChoice; - _queryGrid.doAndWaitForUpdate(()->doMenuAction(currentButtonText, Arrays.asList(finalMenuChoice))); + _queryGrid.doAndWaitForUpdate(()->doMenuAction(currentButtonText, Arrays.asList(menuChoice))); } public GridBar searchFor(String searchStr) From 63f86046158e3a80f03f19e1ae9b050efa1890dc Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Wed, 10 Dec 2025 14:57:54 -0800 Subject: [PATCH 5/5] Adding a few more await checks. Reverting call to doAndWaitForUpdate. --- src/org/labkey/test/components/ui/grids/GridBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/labkey/test/components/ui/grids/GridBar.java b/src/org/labkey/test/components/ui/grids/GridBar.java index 4b16efec4b..f5ec928835 100644 --- a/src/org/labkey/test/components/ui/grids/GridBar.java +++ b/src/org/labkey/test/components/ui/grids/GridBar.java @@ -364,7 +364,9 @@ else if(onSamplePage) menuChoice = ""; } - _queryGrid.doAndWaitForUpdate(()->doMenuAction(currentButtonText, Arrays.asList(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)