From f8206dc215c3dc8d89985aaf4cd4199944861b1a Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Fri, 12 Jun 2026 15:30:31 -0700 Subject: [PATCH 1/3] Do an async call to send mail in the setup. --- .../StudyDatasetChangeEmailNotificationTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java index d504879f93c..7dd5154fc34 100644 --- a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java +++ b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java @@ -20,8 +20,11 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.labkey.remoteapi.CommandException; +import org.labkey.remoteapi.SimplePostCommand; import org.labkey.test.BaseWebDriverTest; import org.labkey.test.Locator; +import org.labkey.test.WebTestHelper; import org.labkey.test.categories.Daily; import org.labkey.test.components.domain.DomainFormPanel; import org.labkey.test.components.dumbster.EmailRecordTable; @@ -30,6 +33,7 @@ import org.labkey.test.util.DataRegionTable; import org.labkey.test.util.PortalHelper; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -40,7 +44,7 @@ public class StudyDatasetChangeEmailNotificationTest extends BaseWebDriverTest { @BeforeClass - public static void doSetup() + public static void doSetup() throws IOException, CommandException { StudyDatasetChangeEmailNotificationTest init = getCurrentTest(); init.doCreateSteps(); @@ -58,7 +62,7 @@ public List getAssociatedModules() return null; } - private void doCreateSteps() + private void doCreateSteps() throws IOException, CommandException { _containerHelper.createProject(getProjectName(), "Study"); _studyHelper.startCreateStudy().createStudy(); @@ -74,7 +78,8 @@ private void doCreateSteps() createDataset("D5", Arrays.asList("F11", "F24"), null); log("Execute the script to send the email"); - executeScript("LABKEY.Ajax.request({ url: '%s/home/reports-sendDailyDigest.view', method: 'POST' });".formatted(getContextPath())); +// executeScript("LABKEY.Ajax.request({ url: '%s/home/reports-sendDailyDigest.view', method: 'POST' });".formatted(getContextPath())); + new SimplePostCommand("reports", "sendDailyDigest").execute(WebTestHelper.getRemoteApiConnection(), null); } @Before From 34f4f7c10ab12a43df0bc38c9fdbd4c936e4e605 Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Fri, 12 Jun 2026 15:46:59 -0700 Subject: [PATCH 2/3] Add the path. --- .../tests/study/StudyDatasetChangeEmailNotificationTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java index 7dd5154fc34..446b89e0a75 100644 --- a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java +++ b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java @@ -78,8 +78,7 @@ private void doCreateSteps() throws IOException, CommandException createDataset("D5", Arrays.asList("F11", "F24"), null); log("Execute the script to send the email"); -// executeScript("LABKEY.Ajax.request({ url: '%s/home/reports-sendDailyDigest.view', method: 'POST' });".formatted(getContextPath())); - new SimplePostCommand("reports", "sendDailyDigest").execute(WebTestHelper.getRemoteApiConnection(), null); + new SimplePostCommand("reports", "sendDailyDigest").execute(WebTestHelper.getRemoteApiConnection(), getContextPath()); } @Before From d50ebf94666864e3a5022557391cb915baedd0f6 Mon Sep 17 00:00:00 2001 From: labkey-danield Date: Fri, 12 Jun 2026 16:20:26 -0700 Subject: [PATCH 3/3] Add the path. --- .../tests/study/StudyDatasetChangeEmailNotificationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java index 446b89e0a75..6d820977603 100644 --- a/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java +++ b/study/test/src/org/labkey/test/tests/study/StudyDatasetChangeEmailNotificationTest.java @@ -78,7 +78,7 @@ private void doCreateSteps() throws IOException, CommandException createDataset("D5", Arrays.asList("F11", "F24"), null); log("Execute the script to send the email"); - new SimplePostCommand("reports", "sendDailyDigest").execute(WebTestHelper.getRemoteApiConnection(), getContextPath()); + new SimplePostCommand("reports", "sendDailyDigest").execute(WebTestHelper.getRemoteApiConnection(), "home"); } @Before