From d74300331f63de9634b351340c6dc450531bbcc8 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 2 Oct 2025 00:16:26 -0700 Subject: [PATCH 1/4] Remove object-level discussions --- .../test/tests/NonStudyReportsTest.java | 43 ------- .../announcements/DiscussionLinkTest.java | 118 ------------------ .../labkey/test/tests/wiki/WikiLongTest.java | 34 ----- 3 files changed, 195 deletions(-) delete mode 100644 src/org/labkey/test/tests/announcements/DiscussionLinkTest.java diff --git a/src/org/labkey/test/tests/NonStudyReportsTest.java b/src/org/labkey/test/tests/NonStudyReportsTest.java index 763e37ee9b..602f1d1f8e 100644 --- a/src/org/labkey/test/tests/NonStudyReportsTest.java +++ b/src/org/labkey/test/tests/NonStudyReportsTest.java @@ -67,7 +67,6 @@ public class NonStudyReportsTest extends ReportTest protected void doCleanup(boolean afterTest) throws TestTimeoutException { _userHelper.deleteUsers(false, ATTACHMENT_USER); - OptionalFeatureHelper.disableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); super.doCleanup(afterTest); } @@ -90,7 +89,6 @@ protected void doVerifySteps() doAttachmentReportTest(); doLinkReportTest(); doThumbnailChangeTest(); - doReportDiscussionTest(); } @LogMethod @@ -258,47 +256,6 @@ private void doThumbnailChangeTest() //no way to verify, unfortunately } - @LogMethod - private void doReportDiscussionTest() - { - // Issue 51620: Remove the UI for Object-level discussions - OptionalFeatureHelper.enableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); - - clickProject(getProjectName()); - - goToManageViews(); - BootstrapMenu.find(getDriver(), "Add Report").clickSubMenu(true, "R Report"); - RReportHelper RReportHelper = new RReportHelper(this); - RReportHelper.executeScript("# Placeholder script for discussion", ""); - click(Locator.linkWithText("Source")); - RReportHelper.saveReport(DISCUSSED_REPORT); - clickReportGridLink(DISCUSSED_REPORT); - - clickMenuButton(true, Locator.tagWithClass("div", "discussion-toggle").findElement(getDriver()), false, "Start new discussion"); - waitForElement(Locator.id("title"), WAIT_FOR_JAVASCRIPT); - setFormElement(Locator.id("title"), DISCUSSION_TITLE_1); - setFormElement(Locator.id("body"), DISCUSSION_BODY_1); - clickButton("Submit"); - - clickMenuButton(true, Locator.tagWithClass("div", "discussion-toggle").findElement(getDriver()), false, DISCUSSION_TITLE_1); - waitForText(DISCUSSION_TITLE_1); - assertTextPresent(DISCUSSION_BODY_1); - - clickButton("Respond"); - waitForElement(Locator.id("body")); - setFormElement(Locator.id("body"), DISCUSSION_BODY_2); - clickButton("Submit"); - - assertTextPresent(DISCUSSION_BODY_2); - - clickAndWait(Locator.linkContainingText("edit")); - waitForElement(Locator.id("body")); - setFormElement(Locator.id("body"), DISCUSSION_BODY_3); - clickButton("Submit"); - - assertTextPresent(DISCUSSION_BODY_3); - } - @LogMethod private void doLinkReportTest() { diff --git a/src/org/labkey/test/tests/announcements/DiscussionLinkTest.java b/src/org/labkey/test/tests/announcements/DiscussionLinkTest.java deleted file mode 100644 index 2657cceb3a..0000000000 --- a/src/org/labkey/test/tests/announcements/DiscussionLinkTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2016-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.test.tests.announcements; - -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.labkey.test.BaseWebDriverTest; -import org.labkey.test.Locator; -import org.labkey.test.TestTimeoutException; -import org.labkey.test.categories.Daily; -import org.labkey.test.pages.core.admin.ProjectSettingsPage; -import org.labkey.test.util.OptionalFeatureHelper; -import org.labkey.test.util.PortalHelper; -import org.labkey.test.util.WikiHelper; - -import java.util.Arrays; -import java.util.List; - -import static org.junit.Assert.assertEquals; - -@Category({Daily.class}) -@BaseWebDriverTest.ClassTimeout(minutes = 4) -public class DiscussionLinkTest extends BaseWebDriverTest -{ - public static final String WIKI_NAME = "Link test"; - - @BeforeClass - public static void setupProject() - { - DiscussionLinkTest init = getCurrentTest(); - - init.doSetup(); - } - - private void doSetup() - { - _containerHelper.createProject(getProjectName()); - - // Issue 51620: Remove the UI for Object-level discussions - OptionalFeatureHelper.enableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); - } - - @Override - protected void doCleanup(boolean afterTest) throws TestTimeoutException - { - OptionalFeatureHelper.disableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); - super.doCleanup(afterTest); - } - - @Before - public void preTest() - { - goToProjectHome(); - } - - @Test - public void testDiscussionLink() - { - PortalHelper portalHelper = new PortalHelper(this); - portalHelper.addWebPart("Wiki"); - //Create wiki using WikiHelper - WikiHelper wikiHelper = new WikiHelper(this); - wikiHelper.createNewWikiPage(); - setFormElement(Locator.name("name"), WIKI_NAME); - wikiHelper.saveWikiPage(); - //Confirm link present using AssertElementPresent by text - clickAndWait(Locator.linkContainingText(WIKI_NAME)); - waitForElement(Locator.linkContainingText("Discussion")); - //goto l and feel - ProjectSettingsPage projectSettingsPage = goToProjectSettings(); - //confirm Enable discussion enabled checked - assertEquals("Enable Discussion should be inherited.", true, projectSettingsPage.getObjectLevelDiscInherited()); - assertEquals("Enable Discussion should be checked.", true, projectSettingsPage.getObjectLevelDiscussions()); - - //un-check Enabled - projectSettingsPage.setObjectLevelDiscInherited(false); - projectSettingsPage.setObjectLevelDiscussions(false); - projectSettingsPage.save(); - - //Confirm Discussion link is not present - goToProjectHome(); - click(Locator.linkContainingText(WIKI_NAME)); - assertElementNotPresent(Locator.linkContainingText("discussion")); - } - - @Override - protected BrowserType bestBrowser() - { - return BrowserType.CHROME; - } - - @Override - protected String getProjectName() - { - return "DiscussionLinkTest Project"; - } - - @Override - public List getAssociatedModules() - { - return Arrays.asList("announcements"); - } -} diff --git a/src/org/labkey/test/tests/wiki/WikiLongTest.java b/src/org/labkey/test/tests/wiki/WikiLongTest.java index c7b68cdd7c..2878284f53 100644 --- a/src/org/labkey/test/tests/wiki/WikiLongTest.java +++ b/src/org/labkey/test/tests/wiki/WikiLongTest.java @@ -26,7 +26,6 @@ import org.labkey.test.categories.Daily; import org.labkey.test.categories.Wiki; import org.labkey.test.pages.LabkeyErrorPage; -import org.labkey.test.util.OptionalFeatureHelper; import org.labkey.test.util.PortalHelper; import org.labkey.test.util.WikiHelper; import org.openqa.selenium.WebElement; @@ -67,8 +66,6 @@ public class WikiLongTest extends BaseWebDriverTest private static final String WIKI_PAGE8_NAME= "Page 8 Name For Delete Subtree Test " + BaseWebDriverTest.INJECT_CHARS_1; private static final String WIKI_PAGE9_NAME= "Page 9 _blank " + BaseWebDriverTest.INJECT_CHARS_1; - private static final String DISC1_TITLE = "Let's Talk"; - private static final String DISC1_BODY = "I don't know how normal this wiki is"; private static final String RESP1_TITLE = "Let's Keep Talking"; private static final String RESP1_BODY = "I disagree"; private static final String USER1 = "wikilong_user1@wikilong.test"; @@ -177,9 +174,6 @@ protected String getProjectName() @Test public void testSteps() { - // Issue 51620: Remove the UI for Object-level discussions - OptionalFeatureHelper.enableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); - enableEmailRecorder(); _containerHelper.createProject(PROJECT2_NAME, null); _containerHelper.enableModule(PROJECT2_NAME, "MS2"); @@ -352,33 +346,6 @@ public void testSteps() clickAndWait(Locator.linkWithText("next")); assertTextPresent("Some HTML content"); - log("Check that discussion board works"); - clickAndWait(Locator.linkWithText(WIKI_PAGE1_TITLE)); - _ext4Helper.waitForOnReady(); - click(Locator.linkWithText("discussions")); - waitForElement(Locator.linkWithText("Start new discussion"), defaultWaitForPage); - clickAndWait(Locator.linkWithText("Start new discussion")); - _wikiHelper.setWikiTitle(DISC1_TITLE); - setFormElement(Locator.id("body"), DISC1_BODY); - submit(); - _ext4Helper.waitForOnReady(); - clickMenuButton(true, Locator.linkWithText("discussions") - .findElement(getDriver()), false, DISC1_TITLE); - - assertTextPresent(DISC1_TITLE, - DISC1_BODY); - - log("Check response on discussion board works"); - clickButton("Respond"); - _wikiHelper.setWikiTitle(RESP1_TITLE); - setFormElement(Locator.id("body"), RESP1_BODY); - submit(); - assertTextPresent(RESP1_TITLE, - RESP1_BODY); - clickButton("Delete Message"); - clickButton("Delete"); - assertTextNotPresent(DISC1_TITLE, DISC1_BODY); - log("test navTree and header"); _wikiHelper.createNewWikiPage("RADEOX"); _wikiHelper.setWikiName("_navTree"); @@ -820,7 +787,6 @@ protected void selectRenderType(String renderType) @Override protected void doCleanup(boolean afterTest) throws TestTimeoutException { - OptionalFeatureHelper.disableOptionalFeature(createDefaultConnection(), "deprecatedObjectLevelDiscussions"); deleteUsersIfPresent(USER1); _containerHelper.deleteProject(PROJECT2_NAME, afterTest); _containerHelper.deleteProject(PROJECT_NAME, afterTest); From 10def818eb312fd8510a9966cfd9f8bf15f06889 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 2 Oct 2025 00:24:57 -0700 Subject: [PATCH 2/4] Unused import --- src/org/labkey/test/tests/NonStudyReportsTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/org/labkey/test/tests/NonStudyReportsTest.java b/src/org/labkey/test/tests/NonStudyReportsTest.java index 602f1d1f8e..f420d316fa 100644 --- a/src/org/labkey/test/tests/NonStudyReportsTest.java +++ b/src/org/labkey/test/tests/NonStudyReportsTest.java @@ -26,7 +26,6 @@ import org.labkey.test.categories.Reports; import org.labkey.test.components.html.BootstrapMenu; import org.labkey.test.util.LogMethod; -import org.labkey.test.util.OptionalFeatureHelper; import org.labkey.test.util.PortalHelper; import org.labkey.test.util.RReportHelper; import org.labkey.test.util.ext4cmp.Ext4FileFieldRef; From 7bc9734d41300d6c7ef005516783c9b599a1f34b Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 3 Oct 2025 16:11:40 -0700 Subject: [PATCH 3/4] Remove unused discussion constants --- src/org/labkey/test/tests/NonStudyReportsTest.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/org/labkey/test/tests/NonStudyReportsTest.java b/src/org/labkey/test/tests/NonStudyReportsTest.java index f420d316fa..9f9296f0b3 100644 --- a/src/org/labkey/test/tests/NonStudyReportsTest.java +++ b/src/org/labkey/test/tests/NonStudyReportsTest.java @@ -33,7 +33,7 @@ import java.io.File; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.labkey.test.util.PermissionsHelper.EDITOR_ROLE; @@ -50,11 +50,6 @@ public class NonStudyReportsTest extends ReportTest private static final String UPDATE_ATTACHMENT_REPORT = "Update Attachment Report"; private static final String ATTACHMENT_REPORT2_DESCRIPTION = BaseWebDriverTest.INJECT_CHARS_2; private static final File ATTACHMENT_REPORT2_FILE = TestFileUtils.getSampleData("Microarray/test2.jpg"); // arbitrary image file - private static final String DISCUSSED_REPORT = "Blank R Report"; - private static final String DISCUSSION_BODY_1 = "Starting a discussion"; - private static final String DISCUSSION_TITLE_1 = "Discussion about R report"; - private static final String DISCUSSION_BODY_2 = "Responding to a discussion"; - private static final String DISCUSSION_BODY_3 = "Editing a discussion response"; private static final String LINK_REPORT1_NAME = "Link report 1" + BaseWebDriverTest.INJECT_CHARS_2; private static final String LINK_REPORT1_DESCRIPTION = "Link report 1" + BaseWebDriverTest.INJECT_CHARS_2; private static final String LINK_REPORT1_URL = "/home/project-begin.view"; @@ -226,7 +221,7 @@ private void doUpdateAttachmentReportTest() // verify we can set a property clickAndWait(Locator.linkContainingText("Edit Report")); waitForText(UPDATE_ATTACHMENT_REPORT); - assertFalse("Locked".equals(getFormElement(statusElement))); + assertNotEquals("Locked", getFormElement(statusElement)); setFormElement(Locator.name("status"), "Locked"); clickButton("Save"); waitForText(ATTACHMENT_REPORT3_NAME); From 53edb063b6b4b57bbe987b7f59be2b9d7a86faef Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 4 Oct 2025 07:26:03 -0700 Subject: [PATCH 4/4] With discussions enabled, wiki titles used to be omitted (no doubt mistakenly). Now these titles are present, so expect two links (title + nav tree). --- src/org/labkey/test/tests/wiki/WikiLongTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/labkey/test/tests/wiki/WikiLongTest.java b/src/org/labkey/test/tests/wiki/WikiLongTest.java index 2878284f53..e70060899e 100644 --- a/src/org/labkey/test/tests/wiki/WikiLongTest.java +++ b/src/org/labkey/test/tests/wiki/WikiLongTest.java @@ -586,7 +586,7 @@ public void testSteps() clickAndWait(Locator.linkWithText("Edit")); deleteWikiPage(true); clickAndWait(Locator.linkWithText(WIKI_PAGE1_TITLE)); - assertElementPresent(Locator.linkWithText(WIKI_PAGE1_TITLE), 1); + assertElementPresent(Locator.linkWithText(WIKI_PAGE1_TITLE), 2); assertElementNotPresent(Locator.linkWithText(WIKI_PAGE3_ALTTITLE)); assertElementNotPresent(Locator.linkWithText(WIKI_PAGE8_TITLE));