From 8631f1afc567d25aacb1c7dacdfe267bc589f39d Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 5 Aug 2025 15:41:37 -0700 Subject: [PATCH 1/3] Billing ext columns container --- .../test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java | 1 + 1 file changed, 1 insertion(+) 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 39c8ccd61..f653149cb 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 @@ -324,6 +324,7 @@ private void loadEHRBillingExtensibleCols() log("Setup the EHR Billing table definitions"); EHRAdminPage.beginAt(this,getContainerPath()); click(Locator.linkWithText("EHR EXTENSIBLE COLUMNS")); + fillAnInputByName("ehrbilling_container", "/WNPRC/EHR"); click(Locator.linkWithText("Load EHR_Billing table definitions")); waitForElement(Locator.tagWithClass("span", "x4-window-header-text").withText("Success")); assertExt4MsgBox("EHR_Billing tables updated successfully.", "OK"); From 2deecec453dcc0dca17f1869716f98b7a6f470da Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 5 Aug 2025 15:48:07 -0700 Subject: [PATCH 2/3] Update --- .../src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f653149cb..069ed20ac 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 @@ -324,7 +324,7 @@ private void loadEHRBillingExtensibleCols() log("Setup the EHR Billing table definitions"); EHRAdminPage.beginAt(this,getContainerPath()); click(Locator.linkWithText("EHR EXTENSIBLE COLUMNS")); - fillAnInputByName("ehrbilling_container", "/WNPRC/EHR"); + fillAnInputByName("ehrbilling_container", "/" + EHR_FOLDER_PATH); click(Locator.linkWithText("Load EHR_Billing table definitions")); waitForElement(Locator.tagWithClass("span", "x4-window-header-text").withText("Success")); assertExt4MsgBox("EHR_Billing tables updated successfully.", "OK"); @@ -3272,7 +3272,7 @@ public void populateAnimalRequestTableLookups() throws IOException, CommandExcep } - public WebElement fillAnInputByName(String name, String value) + private WebElement fillAnInputByName(String name, String value) { WebElement el = Locator.name(name).findElement(getDriver()); el.click(); From 46fc47621c4693a4b01bee904d1b98b8520eaf25 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Wed, 6 Aug 2025 11:23:59 -0700 Subject: [PATCH 3/3] Factor helpful function to ehr helper --- .../test/tests/wnprc_ehr/WNPRC_EHRTest.java | 58 ++++++++----------- 1 file changed, 25 insertions(+), 33 deletions(-) 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 069ed20ac..cc2d23399 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 @@ -324,7 +324,7 @@ private void loadEHRBillingExtensibleCols() log("Setup the EHR Billing table definitions"); EHRAdminPage.beginAt(this,getContainerPath()); click(Locator.linkWithText("EHR EXTENSIBLE COLUMNS")); - fillAnInputByName("ehrbilling_container", "/" + EHR_FOLDER_PATH); + _helper.fillAnInputByName("ehrbilling_container", "/" + EHR_FOLDER_PATH); click(Locator.linkWithText("Load EHR_Billing table definitions")); waitForElement(Locator.tagWithClass("span", "x4-window-header-text").withText("Success")); assertExt4MsgBox("EHR_Billing tables updated successfully.", "OK"); @@ -3272,14 +3272,6 @@ public void populateAnimalRequestTableLookups() throws IOException, CommandExcep } - private WebElement fillAnInputByName(String name, String value) - { - WebElement el = Locator.name(name).findElement(getDriver()); - el.click(); - el.sendKeys(value); - return el; - } - @Test public void testClinpathVirologyBulkUpload() throws IOException, CommandException { @@ -3386,34 +3378,34 @@ public void testAnimalRequestFormSubmit() throws IOException, CommandException //it's a timing issue. we have to wait until the form is loaded for it to be clickable. //this is dependent on the billing setup above which populates the investigators table - fillAnInputByName("principalinvestigator", "Snow, Jon"); - fillAnInputByName("numberofanimals", "23"); - fillAnInputByName("speciesneeded", "Cyno"); - fillAnInputByName("originneeded", "any"); - fillAnInputByName("sex", "M"); - fillAnInputByName("age", "10"); - fillAnInputByName("weight", "2"); - fillAnInputByName("mhctype", "2"); - fillAnInputByName("viralstatus", "SPF4"); - fillAnInputByName("infectiousdisease", "Yes"); - fillAnInputByName("majorsurgery", "Yes"); - fillAnInputByName("pregnantanimalsrequired", "Yes"); - fillAnInputByName("pregnantanimalsrequiredterminfant", "Yes"); - fillAnInputByName("pregnantanimalsrequiredtermdam", "Yes"); - fillAnInputByName("disposition", "Terminal"); - fillAnInputByName("executivecommitteeapproval", "Yes"); - fillAnInputByName("previousexposures", "None"); - fillAnInputByName("optionalproject", "TBD"); - fillAnInputByName("account", "80085"); - fillAnInputByName("protocol", "TBD"); + _helper.fillAnInputByName("principalinvestigator", "Snow, Jon"); + _helper.fillAnInputByName("numberofanimals", "23"); + _helper.fillAnInputByName("speciesneeded", "Cyno"); + _helper.fillAnInputByName("originneeded", "any"); + _helper.fillAnInputByName("sex", "M"); + _helper.fillAnInputByName("age", "10"); + _helper.fillAnInputByName("weight", "2"); + _helper.fillAnInputByName("mhctype", "2"); + _helper.fillAnInputByName("viralstatus", "SPF4"); + _helper.fillAnInputByName("infectiousdisease", "Yes"); + _helper.fillAnInputByName("majorsurgery", "Yes"); + _helper.fillAnInputByName("pregnantanimalsrequired", "Yes"); + _helper.fillAnInputByName("pregnantanimalsrequiredterminfant", "Yes"); + _helper.fillAnInputByName("pregnantanimalsrequiredtermdam", "Yes"); + _helper.fillAnInputByName("disposition", "Terminal"); + _helper.fillAnInputByName("executivecommitteeapproval", "Yes"); + _helper.fillAnInputByName("previousexposures", "None"); + _helper.fillAnInputByName("optionalproject", "TBD"); + _helper.fillAnInputByName("account", "80085"); + _helper.fillAnInputByName("protocol", "TBD"); WebElement el = Locator.id("anticipatedstartdate").findElement(getDriver()).findElement(By.tagName("input")); el.sendKeys(formattedDate); el.sendKeys(Keys.TAB); el = Locator.id("anticipatedenddate").findElement(getDriver()).findElement(By.tagName("input")); el.sendKeys(formattedDate); el.sendKeys(Keys.TAB); - fillAnInputByName("comments", "test"); - fillAnInputByName("contacts", "test@test.com"); + _helper.fillAnInputByName("comments", "test"); + _helper.fillAnInputByName("contacts", "test@test.com"); clickAndWait(Locator.tagWithId("button","submit-final")); assertTextPresent("Data Entry"); @@ -3462,7 +3454,7 @@ public void updateProgramIncomeAccountWithInvalidPermissions() throws UnhandledA //Attempts to change the value. //Assumes an error is presented and the test is complete. - fillAnInputByName("newCreditToAccountField", "asdf"); + _helper.fillAnInputByName("newCreditToAccountField", "asdf"); click(Locator.tagWithId("button","updateCreditToAccountButton")); assertAlert("Unable to update the program income account. User does not have the correct permissions."); @@ -3485,7 +3477,7 @@ public void updateProgramIncomeAccountWithValidPermissions() throws UnhandledAle impersonate(BASIC_SUBMITTER.getEmail()); //Attempts to change the value. - fillAnInputByName("newCreditToAccountField", "testString"); + _helper.fillAnInputByName("newCreditToAccountField", "testString"); click(Locator.tagWithId("button","updateCreditToAccountButton")); //Verifies the value has been changed, then continues. If value has not been changed, the test fails here.