From 57754e1c82a1f3cefd6ed57eff19645585b7b55d Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 11 Oct 2024 09:28:29 -0700 Subject: [PATCH 1/3] Fix test setting date-time display formats --- .../test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java index 8545d1ca..3dfa2c96 100644 --- a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java +++ b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java @@ -1055,7 +1055,9 @@ private void setProjectDateFormat(String dateFormat, String dateTimeFormat) { goToProjectSettings(PROJECT_NAME); + uncheckCheckbox(Locator.name("defaultDateFormatInherited")); setFormElement(Locator.name("defaultDateFormat"), dateFormat); + uncheckCheckbox(Locator.name("defaultDateTimeFormatInherited")); setFormElement(Locator.name("defaultDateTimeFormat"), dateTimeFormat); clickAndWait(Locator.lkButton("Save")); } From 4be4ff27096bb29ec0d3202a88ee598e32e1f1af Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 12 Oct 2024 08:52:53 -0700 Subject: [PATCH 2/3] Test standard date display format --- .../labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java index 3dfa2c96..1bdae1e5 100644 --- a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java +++ b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java @@ -1002,19 +1002,19 @@ public void testClinicalHistoryPanelOptions(){ @Test public void testDateFormat(){ - String dateFormat = "yy-M-d"; - String dateTimeFormat = "yy-M-d H:mm"; - String expectedDate = "16-6-1"; - String expectedTime = "8:58"; + String dateFormat = "dd-MMM-yyyy"; + String dateTimeFormat = dateFormat + "HH:mm:ss.SSS"; + String expectedDate = "01-Jun-2016"; + String expectedTime = "08:58:00.000"; - testDateFormat(dateFormat,dateTimeFormat, expectedDate, expectedTime); + testDateFormat(dateFormat, dateTimeFormat, expectedDate, expectedTime); dateFormat = "yyyy-MM-dd"; dateTimeFormat = dateFormat + " HH:mm"; expectedDate = "2016-06-01"; expectedTime = "08:58"; - testDateFormat(dateFormat,dateTimeFormat, expectedDate, expectedTime); + testDateFormat(dateFormat, dateTimeFormat, expectedDate, expectedTime); } From 6fef9121bbc3128c672b6d85f362e04be4b0aa56 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 12 Oct 2024 10:14:07 -0700 Subject: [PATCH 3/3] Date and time formats are now set via separate selects --- .../test/tests/snprc_ehr/SNPRC_EHRTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java index 1bdae1e5..9a558920 100644 --- a/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java +++ b/snprc_ehr/test/src/org/labkey/test/tests/snprc_ehr/SNPRC_EHRTest.java @@ -1000,27 +1000,27 @@ public void testClinicalHistoryPanelOptions(){ } @Test - public void testDateFormat(){ + public void testDateAndTimeFormats(){ String dateFormat = "dd-MMM-yyyy"; - String dateTimeFormat = dateFormat + "HH:mm:ss.SSS"; + String timeFormat = "HH:mm:ss.SSS"; String expectedDate = "01-Jun-2016"; String expectedTime = "08:58:00.000"; - testDateFormat(dateFormat, dateTimeFormat, expectedDate, expectedTime); + testDateAndTimeFormats(dateFormat, timeFormat, expectedDate, expectedTime); dateFormat = "yyyy-MM-dd"; - dateTimeFormat = dateFormat + " HH:mm"; + timeFormat = "HH:mm"; expectedDate = "2016-06-01"; expectedTime = "08:58"; - testDateFormat(dateFormat, dateTimeFormat, expectedDate, expectedTime); + testDateAndTimeFormats(dateFormat, timeFormat, expectedDate, expectedTime); } - private void testDateFormat(String dateFormat, String dateTimeFormat, String expectedDate, String expectedTime) + private void testDateAndTimeFormats(String dateFormat, String timeFormat, String expectedDate, String expectedTime) { - setProjectDateFormat(dateFormat,dateTimeFormat); + setProjectDateAndTimeFormats(dateFormat, timeFormat); confirmJavascriptDrivenDateFormat(expectedDate); @@ -1051,14 +1051,15 @@ private void confirmJavascriptDrivenDateFormat(String expectedDate) assertTextPresentCaseInsensitive(expectedDate); } - private void setProjectDateFormat(String dateFormat, String dateTimeFormat) + private void setProjectDateAndTimeFormats(String dateFormat, String timeFormat) { goToProjectSettings(PROJECT_NAME); uncheckCheckbox(Locator.name("defaultDateFormatInherited")); setFormElement(Locator.name("defaultDateFormat"), dateFormat); uncheckCheckbox(Locator.name("defaultDateTimeFormatInherited")); - setFormElement(Locator.name("defaultDateTimeFormat"), dateTimeFormat); + setFormElement(Locator.name("dateSelect"), dateFormat); + setFormElement(Locator.name("timeSelect"), timeFormat); clickAndWait(Locator.lkButton("Save")); }