From 83918e3719216501f1cc75153f16a2f8dde3509a Mon Sep 17 00:00:00 2001 From: Dan Duffek Date: Thu, 2 Apr 2026 07:58:08 -0700 Subject: [PATCH 1/4] Fix PortTab helper. (#2929) --- src/org/labkey/test/components/labkey/PortalTab.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/labkey/test/components/labkey/PortalTab.java b/src/org/labkey/test/components/labkey/PortalTab.java index 8a66c9dcc0..50ec8fd682 100644 --- a/src/org/labkey/test/components/labkey/PortalTab.java +++ b/src/org/labkey/test/components/labkey/PortalTab.java @@ -222,7 +222,7 @@ static public Locator.XPathLocator tabIdLoc(String tabText) } static public Locator.XPathLocator container = Locator.tagWithClass("ul", "lk-nav-tabs"); - static public Locator.XPathLocator tabItem = Locator.xpath("//li[@role='presentation']"); + static public Locator.XPathLocator tabItem = Locator.xpath("//li"); static public Locator.XPathLocator subContainerTabSelect = Locator.tagWithAttribute("select", "title", "subContainerTabs"); static public Locator.XPathLocator tabList = container.append(tabItem); From 658adda9f2cc2098d61ff4bc45761b38bd30ad96 Mon Sep 17 00:00:00 2001 From: Trey Chadick Date: Fri, 3 Apr 2026 09:56:04 -0700 Subject: [PATCH 2/4] Fix crawler and returnUrl test failures (#2930) - Fix ListTest crawler failure - Fix bad returnUrl in AssayTransformMissingParentDirTest --- .../assay/AssayTransformMissingParentDirTest.java | 7 +++---- src/org/labkey/test/tests/list/ListTest.java | 11 +++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/org/labkey/test/tests/assay/AssayTransformMissingParentDirTest.java b/src/org/labkey/test/tests/assay/AssayTransformMissingParentDirTest.java index d0979ba985..74cc69000c 100644 --- a/src/org/labkey/test/tests/assay/AssayTransformMissingParentDirTest.java +++ b/src/org/labkey/test/tests/assay/AssayTransformMissingParentDirTest.java @@ -19,6 +19,7 @@ import java.nio.file.AccessDeniedException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; /** * Issue 54156: Regression test to ensure a reasonable error message is shown when an assay design references @@ -40,10 +41,9 @@ public void testMissingParentDirectoryRegression() throws Exception TestFileUtils.writeFile(transformFile, transformContent); // Create a General assay and add the transform by absolute path (not upload) - var protocolResponse = new GeneralAssayDesign(assayName).createAssay(getProjectName(), createDefaultConnection()); + var protocolResponse = new GeneralAssayDesign(assayName).setBatchFields(List.of(), false).createAssay(getProjectName(), createDefaultConnection()); var assayDesignerPage = ReactAssayDesignerPage.beginAt(this, getProjectName(), protocolResponse.getProtocolId(), - "general", getURL().toString()); - assayDesignerPage.goToBatchFields().removeAllFields(true); + "general", ""); // add by path so the absolute path is stored; this allows reproducing the missing parent dir scenario assayDesignerPage.addTransformScript(transformFile); assayDesignerPage.clickSave(); @@ -78,7 +78,6 @@ public void testMissingParentDirectoryRegression() throws Exception 1\tP1\timport after parent deleted """; - clickAndWait(Locator.linkWithText(assayName)); new AssayRunsPage(getDriver()).getTable().clickHeaderButtonAndWait("Import Data"); var importPage = new AssayImportPage(getDriver()); importPage.setNamedInputText("Name", "missingParentImport"); diff --git a/src/org/labkey/test/tests/list/ListTest.java b/src/org/labkey/test/tests/list/ListTest.java index d82d02ce62..9b1e664323 100644 --- a/src/org/labkey/test/tests/list/ListTest.java +++ b/src/org/labkey/test/tests/list/ListTest.java @@ -861,6 +861,11 @@ public void testCustomViews() customizeURLTest(); crossContainerLookupTest(); + + // Prevent crawler errors after the list is deleted + // A Query WebPart for a missing query contains links that will 404 + goToProjectHome(); + new PortalHelper(this).removeAllWebParts(); } /* Issue 23487: add regression coverage for batch insert into list with multiple errors @@ -1128,8 +1133,10 @@ private void filterTest() clickProject(PROJECT_VERIFY); PortalHelper portalHelper = new PortalHelper(this); - portalHelper.addQueryWebPart(null, "lists", LIST_NAME_COLORS, null); - portalHelper.addQueryWebPart(null, "lists", LIST_NAME_COLORS, null); + portalHelper.doInAdminMode(ph -> { + portalHelper.addQueryWebPart(null, "lists", LIST_NAME_COLORS, null); + portalHelper.addQueryWebPart(null, "lists", LIST_NAME_COLORS, null); + }); log("Test that the right filters are present for each type"); DataRegionTable region = new DataRegionTable("qwp3", getDriver()); From 6e1d80dbb36c9fc1d9211f5fc2661e07b2e10375 Mon Sep 17 00:00:00 2001 From: Dan Duffek Date: Fri, 3 Apr 2026 10:37:40 -0700 Subject: [PATCH 3/4] Change the xpath used to find tabs. (#2932) --- src/org/labkey/test/components/labkey/PortalTab.java | 2 +- src/org/labkey/test/util/PortalHelper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/labkey/test/components/labkey/PortalTab.java b/src/org/labkey/test/components/labkey/PortalTab.java index 50ec8fd682..ef5a78760f 100644 --- a/src/org/labkey/test/components/labkey/PortalTab.java +++ b/src/org/labkey/test/components/labkey/PortalTab.java @@ -222,7 +222,7 @@ static public Locator.XPathLocator tabIdLoc(String tabText) } static public Locator.XPathLocator container = Locator.tagWithClass("ul", "lk-nav-tabs"); - static public Locator.XPathLocator tabItem = Locator.xpath("//li"); + static public Locator.XPathLocator tabItem = Locator.xpath("/li"); static public Locator.XPathLocator subContainerTabSelect = Locator.tagWithAttribute("select", "title", "subContainerTabs"); static public Locator.XPathLocator tabList = container.append(tabItem); diff --git a/src/org/labkey/test/util/PortalHelper.java b/src/org/labkey/test/util/PortalHelper.java index e974dcb346..43bb628f0e 100644 --- a/src/org/labkey/test/util/PortalHelper.java +++ b/src/org/labkey/test/util/PortalHelper.java @@ -87,7 +87,7 @@ public void moveTab(@LoggedParam String tabText, @LoggedParam Direction directio throw new IllegalArgumentException("Can't move folder tabs vertically."); String tabId = tabText.replace(" ", "") + "Tab"; - Locator.XPathLocator tabList = Locator.xpath("//ul[contains(@class, 'lk-nav-tabs-admin')]//li[@role='presentation']"); + Locator.XPathLocator tabList = Locator.xpath("//ul[contains(@class, 'lk-nav-tabs-admin')]/li"); Locator.XPathLocator tabLink = Locator.xpath("//a[@id=" + Locator.xq(tabId) + "]"); int tabCount = getElementCount(tabList) - 1; From a9b1c395ac093876e55320a027caa9cc27e498d3 Mon Sep 17 00:00:00 2001 From: labkey-matthewb Date: Tue, 7 Apr 2026 10:28:59 -0700 Subject: [PATCH 4/4] test setRequired() (#2937) #### Rationale Test that field (non-MVTC) can't be set to required if null is present regression test for change in https://github.com/LabKey/platform/pull/7549 #### Related Pull Requests [- ](https://github.com/LabKey/platform/pull/7549) #### Changes - --- src/org/labkey/test/tests/list/ListTest.java | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/org/labkey/test/tests/list/ListTest.java b/src/org/labkey/test/tests/list/ListTest.java index 418b3cbfc0..cd51c7f9de 100644 --- a/src/org/labkey/test/tests/list/ListTest.java +++ b/src/org/labkey/test/tests/list/ListTest.java @@ -1396,6 +1396,52 @@ public void doRenameFieldsTest() assertTextBefore(newFieldName, origFieldName); } + + @Test + public void requiredFieldsTest() + { + log("Test changing required property of field"); + String listName = "requiredColList"; + String fieldA = "c$a"; + String fieldB = "c_b"; + + _listHelper.createList(PROJECT_VERIFY, listName, "key", + new FieldDefinition(fieldA, ColumnType.String).setDescription("first column").setRequired(false), + new FieldDefinition(fieldB, ColumnType.String).setDescription("second column").setRequired(false) + ); + + // insert a row with a NULL value and NON-NULL value + Map row = new HashMap<>(); + row.put(fieldA, "not null"); + row.put(fieldB, ""); + _listHelper.insertNewRow(row, false); + row.put(fieldA, "still not null"); + row.put(fieldB, "also not null"); + _listHelper.insertNewRow(row, false); + + // fieldA can be set to required==true + EditListDefinitionPage listDefinitionPage = _listHelper.goToEditDesign(listName); + listDefinitionPage.getFieldsPanel() + .getField(fieldA) + .setRequiredField(true); + listDefinitionPage.clickSave(); + + // fieldB can not be set to required==true + listDefinitionPage = _listHelper.goToEditDesign(listName); + listDefinitionPage.getFieldsPanel() + .getField(fieldB) + .setRequiredField(true); + List errors = listDefinitionPage.clickSaveExpectingErrors(); + assertEquals(2, errors.size()); + assertEquals("The property \"" + fieldB + "\" cannot be required when it contains rows with blank values.", errors.get(0)); + assertEquals("Please correct errors in " + listName + " before saving.", errors.get(1)); + + goToProjectHome(); + clickAndWait(Locator.linkWithText(listName)); + _listHelper.deleteList(); + } + + @Test public void exportPhiFileColumn() throws Exception {