From 20402de1ed92ffbb2afa41a67796daf67b1519f7 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Fri, 26 Jun 2026 10:29:06 -0600 Subject: [PATCH 1/3] Add WNPRC_EHRTest for Time of Day lovcombo multi-select Adds testTreatmentTimeOfDayMultiSelect: opens the Treatments task Import Scheduled Treatments dialog, selects multiple Time of Day values in the string-valued lovcombo, and submits. It asserts the selection is retained and reaches the schedule query (alert 'No uncompleted treatments were found.') rather than the pre-fix validation alert 'Must provide room and time of day'. Exercises the LovCombo fix end-to-end. https://github.com/LabKey/internal-issues/issues/1266 --- .../test/tests/wnprc_ehr/WNPRC_EHRTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java index 80b1d4723..a9ce823c4 100644 --- a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java +++ b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java @@ -4858,4 +4858,41 @@ public void testCageUIHomeDisplay() throws Exception { } + + // https://github.com/LabKey/internal-issues/issues/1266: the "Time of Day" multi-select (lovcombo) must + // retain string selections so they reach the schedule query. A bogus room makes the query empty, so a + // passing Submit reaches "No uncompleted treatments were found." instead of the pre-fix "Must provide + // room and time of day" validation alert. + @Test + public void testTreatmentTimeOfDayMultiSelect() + { + beginAt(buildURL("ehr", getContainerPath(), "manageTask.view?formtype=Treatments")); + WebElement titleEl = waitForElement(Locator.xpath("//input[@name='title' and not(contains(@class, 'disabled'))]"), WAIT_FOR_JAVASCRIPT); + waitForFormElementToEqual(titleEl, "Treatments"); + + log("Open the Import Scheduled Treatments dialog"); + waitAndClick(Locator.extButton("Add Treatments")); + waitForElement(ExtHelper.Locators.formItemWithLabel("Time of Day:").notHidden(), WAIT_FOR_JAVASCRIPT); + + log("Enter a (bogus) room and select multiple Time of Day values from the lovcombo"); + _extHelper.setExtFormElementByLabel("Room:", "zz999"); + _extHelper.selectComboBoxItem("Time of Day:", "AM"); + _extHelper.selectComboBoxItem("Time of Day:", "Noon"); + + String selectedTimes = getLovComboValue("Time of Day:"); + Assertions.assertThat(selectedTimes) + .as("Time of Day lovcombo dropped its selections (Issue 7144)") + .contains("AM").contains("Noon"); + + log("Submit; the selected times must pass validation and reach the schedule query"); + _extHelper.clickExtButton("", "Submit", 0); + assertAlert("No uncompleted treatments were found."); + } + + private String getLovComboValue(String label) + { + WebElement comboEl = ExtHelper.Locators.formItemWithLabel(label).notHidden().findElement(getDriver()); + WebElement input = Locator.xpath(".//input[contains(@class, 'x-form-field')]").findElement(comboEl); + return getFormElement(input); + } } From 2d71aba1f806395bedd77c7c66c73e5495a2f235 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Fri, 26 Jun 2026 10:48:04 -0600 Subject: [PATCH 2/3] Reference issue 1266 (not 7144) in Time of Day lovcombo test assertion --- .../test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java index a9ce823c4..af8755a4c 100644 --- a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java +++ b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java @@ -4881,7 +4881,7 @@ public void testTreatmentTimeOfDayMultiSelect() String selectedTimes = getLovComboValue("Time of Day:"); Assertions.assertThat(selectedTimes) - .as("Time of Day lovcombo dropped its selections (Issue 7144)") + .as("Time of Day lovcombo dropped its selections (Issue 1266)") .contains("AM").contains("Noon"); log("Submit; the selected times must pass validation and reach the schedule query"); From 6f9ac18def609eda8c69380eaeb7ea95f7d685a8 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Fri, 26 Jun 2026 13:28:44 -0600 Subject: [PATCH 3/3] Use GH Issue prefix so the Time of Day test message links to GitHub 1266 --- .../test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java index af8755a4c..f68ef5c13 100644 --- a/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java +++ b/WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java @@ -4881,7 +4881,7 @@ public void testTreatmentTimeOfDayMultiSelect() String selectedTimes = getLovComboValue("Time of Day:"); Assertions.assertThat(selectedTimes) - .as("Time of Day lovcombo dropped its selections (Issue 1266)") + .as("Time of Day lovcombo dropped its selections (GH Issue 1266)") .contains("AM").contains("Noon"); log("Submit; the selected times must pass validation and reach the schedule query");