Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Death notification test failure fixes #493

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions WNPRC_EHR/src/org/labkey/wnprc_ehr/TriggerScriptHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ public Map<String, Object> getExtraContext()

public void sendDeathNotification(final List<String> ids, String hostName) {
Module ehr = ModuleLoader.getInstance().getModule("EHR");
//Verifies 'Notification Service' is enabled before sending notification.
if (NotificationService.get().isServiceEnabled()){

//Sends original Death Notification.
//Remove this if-else when new notification is approved.
if (NotificationService.get().isActive(new DeathNotification(), container)) {
Expand All @@ -211,10 +210,6 @@ public void sendDeathNotification(final List<String> ids, String hostName) {
else {
_log.info("Death Notification Revamp is not enabled, will not send death notification");
}
}
else if (!NotificationService.get().isServiceEnabled()) {
_log.info("Notification service is not enabled, will not send death notification");
}
}

public void sendPregnancyNotification(final List<String> ids, final List<String> objectids) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static void doSetup() throws Exception

initTest.checkUpdateProgramIncomeAccount();

initTest.checkJavaNotificationsFunctionality();
initTest.deathNotificationSetup();
}

private void uploadBillingDataAndVerify() throws Exception
Expand Down Expand Up @@ -3002,6 +3002,9 @@ private void checkUpdateProgramIncomeAccount() throws UnhandledAlertException

@Test
public void testJavaDeathNotification() throws UnhandledAlertException {

log("Started testJavaDeathNotification.");

//Navigates to the Necropsies table.
beginAt(buildURL("project", getContainerPath(), "begin"));
beginAt("/ehr/" + getContainerPath() + "/datasets.view");
Expand Down Expand Up @@ -3031,10 +3034,15 @@ public void testJavaDeathNotification() throws UnhandledAlertException {
assertTextPresent("Necropsy Case Number:", necropsyCaseNumber);
assertTextPresent("Date of Necropsy:", necropsyDate);
assertTextPresent("Grant #:", necropsyAccount);

log("Completed testJavaDeathNotification.");
}

@Test
public void testJavaPrenatalDeathNotification() throws UnhandledAlertException {

log("Started testJavaPrenatalDeathNotification.");

//Navigates to the "Enter Prenatal Death" page.
beginAt(buildURL("project", getContainerPath(), "begin"));
waitAndClickAndWait(Locator.tagContainingText("a", "Enter Data"));
Expand All @@ -3051,9 +3059,11 @@ public void testJavaPrenatalDeathNotification() throws UnhandledAlertException {
//Navigates to dumbster.
goToModule("Dumbster");
assertTextPresent("Prenatal Death Notification: pd9876");

log("Completed testJavaPrenatalDeathNotification.");
}

private void checkJavaNotificationsFunctionality() throws UnhandledAlertException {
private void deathNotificationSetup() throws UnhandledAlertException {
log("Starting checkJavaNotificationsFunctionality.");
//Navigates to home to get a fresh start.
beginAt(buildURL("project", getContainerPath(), "begin"));
Expand All @@ -3066,7 +3076,7 @@ private void checkJavaNotificationsFunctionality() throws UnhandledAlertExceptio
notificationAdminPage.setNotificationUserAndReplyEmail(DATA_ADMIN_USER);

//Enables all notification that we will be testing.
notificationAdminPage.enableBillingNotification("status_org.labkey.wnprc_ehr.notification.DeathNotificationRevamp");
notificationAdminPage.enableDeathNotification("status_org.labkey.wnprc_ehr.notification.DeathNotificationRevamp");

//Adds notification recipients.
// notificationAdminPage.addManageUsers("org.labkey.wnprc_ehr.notification.DeathNotification", "EHR Administrators");
Expand All @@ -3079,14 +3089,6 @@ private void checkJavaNotificationsFunctionality() throws UnhandledAlertExceptio

//Enables dumbster.
_containerHelper.enableModules(Arrays.asList("Dumbster"));

log("Started testJavaDeathNotification.");
testJavaDeathNotification();
log("Completed testJavaDeathNotification.");

log("Started testJavaPrenatalDeathNotification.");
testJavaPrenatalDeathNotification();
log("Completed testJavaPrenatalDeathNotification.");
}

@Test
Expand Down