From 48784b2bc3728a1d5a0471a4234f6193b7fd0a79 Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Mon, 28 Apr 2025 13:25:09 -0700 Subject: [PATCH 1/2] Add some waits for updates. Use dates that are farther apart and less likely to collide. Wait for the element. --- .../org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java index 29320bc5..69a74573 100644 --- a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java +++ b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java @@ -810,26 +810,27 @@ public void testClinicalCasesWorkflow() setFormElement(Locator.textarea("openRemark"), "Clinical Case WorkFlow - Test"); setFormElement(Locator.textarea("plan"), "Case plan"); setFormElement(Locator.name("Id"), animalId); - _helper.getExt4FieldForFormSection("Clinical Case", "Open Date").setValue(LocalDateTime.now().minusDays(1).format(_dateFormat)); + _helper.getExt4FieldForFormSection("Clinical Case", "Open Date").setValue(LocalDateTime.now().minusDays(2).format(_dateFormat)); Assert.assertEquals("Performed by is incorrect ", "vet tech fs", getFormElement(Locator.name("performedby"))); //Fill out Clinical Remarks section with Date, Remark scrollIntoView(Locator.textarea("remark")); - _helper.getExt4FieldForFormSection("Clinical Remarks", "Date").setValue(LocalDateTime.now().minusDays(2).format(_dateFormat)); + _helper.getExt4FieldForFormSection("Clinical Remarks", "Date").setValue(LocalDateTime.now().minusDays(3).format(_dateFormat)); _helper.setDataEntryField("remark", "Clinical Remarks - Test"); if (null == _helper.getExt4FieldForFormSection("Clinical Remarks", "Remark").getValue()) _helper.setDataEntryField("remark", "Clinical Remarks - Test"); + sleep(750); waitForTextToDisappear("Remark: WARN: Must enter at least one comment"); Ext4GridRef weight = _helper.getExt4GridForFormSection("Weights"); _helper.addRecordToGrid(weight); - weight.setGridCellJS(1, "date", LocalDateTime.now().minusDays(1).format(_dateFormat)); + weight.setGridCellJS(1, "date", LocalDateTime.now().minusDays(2).format(_dateFormat)); weight.setGridCell(1, "weight", "6.000"); log("Adding Medications/Treatments Orders"); Ext4GridRef orderGrid = _helper.getExt4GridForFormSection("Medications/Treatments Orders"); _helper.addRecordToGrid(orderGrid); - orderGrid.setGridCell(1, "date", LocalDateTime.now().minusDays(2).format(_dateFormat)); + orderGrid.setGridCell(1, "date", LocalDateTime.now().minusDays(3).format(_dateFormat)); orderGrid.clickDownArrowOnGrid(1, "code"); orderGrid.setGridCell(1, "code", "Diazepam"); orderGrid.clickDownArrowOnGrid(1, "frequency"); @@ -839,6 +840,7 @@ public void testClinicalCasesWorkflow() orderGrid.clickDownArrowOnGrid(1, "orderedby"); orderGrid.setGridCell(1, "orderedby", NIRC_VET_NAME); orderGrid.completeEdit(); + sleep(1_000); submitForm("Submit Final", "Finalize Form"); log("Completing today's Medication Schedule"); @@ -863,7 +865,7 @@ public void testClinicalCasesWorkflow() impersonate(NIRC_FULL_SUBMITTER_VET); //Go to 'Active Clinical Cases' - clickAndWait(Locator.linkWithText("Active Clinical Cases")); + waitAndClickAndWait(Locator.linkWithText("Active Clinical Cases")); //Click on 'Case Update' link AnimalHistoryPage historyPage = new AnimalHistoryPage<>(getDriver()); From cb7207a9c9e6ec77fee4f7e60b92179a409d01d2 Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Wed, 30 Apr 2025 10:57:53 -0700 Subject: [PATCH 2/2] Revert changes to DateTime adjustments. --- .../src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java index 69a74573..a9a5c63c 100644 --- a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java +++ b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java @@ -810,12 +810,12 @@ public void testClinicalCasesWorkflow() setFormElement(Locator.textarea("openRemark"), "Clinical Case WorkFlow - Test"); setFormElement(Locator.textarea("plan"), "Case plan"); setFormElement(Locator.name("Id"), animalId); - _helper.getExt4FieldForFormSection("Clinical Case", "Open Date").setValue(LocalDateTime.now().minusDays(2).format(_dateFormat)); + _helper.getExt4FieldForFormSection("Clinical Case", "Open Date").setValue(LocalDateTime.now().minusDays(1).format(_dateFormat)); Assert.assertEquals("Performed by is incorrect ", "vet tech fs", getFormElement(Locator.name("performedby"))); //Fill out Clinical Remarks section with Date, Remark scrollIntoView(Locator.textarea("remark")); - _helper.getExt4FieldForFormSection("Clinical Remarks", "Date").setValue(LocalDateTime.now().minusDays(3).format(_dateFormat)); + _helper.getExt4FieldForFormSection("Clinical Remarks", "Date").setValue(LocalDateTime.now().minusDays(2).format(_dateFormat)); _helper.setDataEntryField("remark", "Clinical Remarks - Test"); if (null == _helper.getExt4FieldForFormSection("Clinical Remarks", "Remark").getValue()) _helper.setDataEntryField("remark", "Clinical Remarks - Test"); @@ -824,13 +824,13 @@ public void testClinicalCasesWorkflow() Ext4GridRef weight = _helper.getExt4GridForFormSection("Weights"); _helper.addRecordToGrid(weight); - weight.setGridCellJS(1, "date", LocalDateTime.now().minusDays(2).format(_dateFormat)); + weight.setGridCellJS(1, "date", LocalDateTime.now().minusDays(1).format(_dateFormat)); weight.setGridCell(1, "weight", "6.000"); log("Adding Medications/Treatments Orders"); Ext4GridRef orderGrid = _helper.getExt4GridForFormSection("Medications/Treatments Orders"); _helper.addRecordToGrid(orderGrid); - orderGrid.setGridCell(1, "date", LocalDateTime.now().minusDays(3).format(_dateFormat)); + orderGrid.setGridCell(1, "date", LocalDateTime.now().minusDays(2).format(_dateFormat)); orderGrid.clickDownArrowOnGrid(1, "code"); orderGrid.setGridCell(1, "code", "Diazepam"); orderGrid.clickDownArrowOnGrid(1, "frequency");