From 59c15407eb44b17926052babddec0d292c780adf Mon Sep 17 00:00:00 2001 From: labkey-sweta Date: Thu, 28 Nov 2024 13:58:21 -0800 Subject: [PATCH 1/4] Updating the test to match the new browser value. --- test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java | 6 +++--- test/src/org/labkey/test/tests/cds/CDSSecurityTest.java | 6 +++--- .../org/labkey/test/tests/cds/CDSVisualizationPlotTest.java | 2 +- .../src/org/labkey/test/tests/cds/CDSVisualizationTest.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java b/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java index 5515ffb8c..58ff19025 100644 --- a/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java @@ -825,7 +825,7 @@ public void verifyDiscreteTimeVariables() xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX); xaxis.confirmSelection(); - pattern = Pattern.compile("^01237.*3303003000"); + pattern = Pattern.compile("^01237.*2202002000"); cds.assertPlotTickText(1, pattern); log("Choose 'Study weeks with axis type Categorical'."); @@ -834,7 +834,7 @@ public void verifyDiscreteTimeVariables() xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX); xaxis.confirmSelection(); - pattern = Pattern.compile("^01234.*3303003000"); + pattern = Pattern.compile("^01234.*2202002000"); cds.assertPlotTickText(1, pattern); log("Choose 'Study months with axis type Categorical'."); @@ -843,7 +843,7 @@ public void verifyDiscreteTimeVariables() xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX); xaxis.confirmSelection(); - pattern = Pattern.compile("^0123.*3303003000"); + pattern = Pattern.compile("^0123.*2202002000"); cds.assertPlotTickText(1, pattern); log("Apply the time axis as a filter."); diff --git a/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java b/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java index 2fd74c3bf..39c3881d6 100644 --- a/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java @@ -1011,7 +1011,7 @@ private void verifyInfoPaneWithLimitedAccess(boolean hasAccessToQ1Q2R4) private String[] getWelcomeLinks() { - String usrEmail = "", msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration"; + String msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration"; String[] urls = new String[_newUserAccounts.length]; goToModule("Dumbster"); @@ -1021,8 +1021,8 @@ private String[] getWelcomeLinks() for (int index = 0; index < _newUserAccounts.length; index++) { emailRecordTable.clickSubject(_newUserAccounts[index] + msgSubject); - usrEmail = _newUserAccounts[index].substring(0, _newUserAccounts[index].indexOf("@")); - urls[index] = getAttribute(Locator.css("a[href*='&email=" + usrEmail + "']"), "href"); + String emailBody = emailRecordTable.getMessage(_newUserAccounts[index] + msgSubject).getBody(); + urls[index] = emailBody.substring(emailBody.indexOf("http:"),emailBody.lastIndexOf("\n")); //Extracting the URL from email body. } return urls; diff --git a/test/src/org/labkey/test/tests/cds/CDSVisualizationPlotTest.java b/test/src/org/labkey/test/tests/cds/CDSVisualizationPlotTest.java index 07606b246..d4a9f873c 100644 --- a/test/src/org/labkey/test/tests/cds/CDSVisualizationPlotTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSVisualizationPlotTest.java @@ -575,7 +575,7 @@ public void verifyBinnedPlot() log("Validate that there are bin squares in the plot."); int squareCount = Locator.tagWithClass("a","vis-bin vis-bin-square").findElements(getDriver()).size(); - assertTrue("Expected over 2000 bin squares found: " + squareCount, squareCount > 2000); + assertTrue("Expected over 1980 bin squares found: " + squareCount, squareCount > 1980); cds.ensureNoFilter(); } diff --git a/test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java b/test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java index 036d1937a..7149c6c21 100644 --- a/test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java @@ -726,9 +726,9 @@ public void verifyLogAndLinearScales() // Exact y-axis tick text is inconsistent String smallLogYTicks; - if (isTextPresent("0.0009")) + if (isTextPresent("0.0008")) { - smallLogYTicks = le + "0\n0.0009\n0.009\n0.09\n0.9"; + smallLogYTicks = le + "0\n0.0008\n0.008\n0.08\n0.8"; } else { From 6e483059dab3177a452098a2cc26acec596379ef Mon Sep 17 00:00:00 2001 From: labkey-sweta Date: Mon, 2 Dec 2024 15:13:37 -0800 Subject: [PATCH 2/4] Automation test for Editor without Delete users are able to delete files --- .../labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/org/labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java b/test/src/org/labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java index 2692792fa..267e27c73 100644 --- a/test/src/org/labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java @@ -13,7 +13,7 @@ import java.util.Arrays; @Category({}) -@BaseWebDriverTest.ClassTimeout(minutes = 5) +@BaseWebDriverTest.ClassTimeout(minutes = 10) public class CDSLearnAboutAssayTabsSearchTest extends CDSReadOnlyTest { private final CDSHelper cds = new CDSHelper(this); From c78dd16fcfb24201058efc5f72c0d5554b06c3b3 Mon Sep 17 00:00:00 2001 From: Lum Date: Tue, 3 Dec 2024 12:37:52 -0800 Subject: [PATCH 3/4] Fix for selenium test failures. --- src/org/labkey/cds/CDSManager.java | 17 ++++++++--------- .../labkey/test/tests/cds/CDSSecurityTest.java | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/org/labkey/cds/CDSManager.java b/src/org/labkey/cds/CDSManager.java index bfcdcbbde..98799b81a 100644 --- a/src/org/labkey/cds/CDSManager.java +++ b/src/org/labkey/cds/CDSManager.java @@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerManager; import org.labkey.api.data.CoreSchema; @@ -53,7 +54,6 @@ import org.labkey.api.settings.AppProps; import org.labkey.api.util.ContainerUtil; import org.labkey.api.util.PageFlowUtil; -import org.labkey.api.view.NotFoundException; import java.sql.SQLException; import java.util.ArrayList; @@ -353,13 +353,12 @@ public String getAllBlogsPath(Container container) return PageFlowUtil.decode(mp.getEffectiveValue(container)); } - public TableInfo getSiteUserTableInfo(User user) + @Nullable + public Domain getSiteUserDomain(User user) { UserSchema coreSchema = QueryService.get().getUserSchema(user, getUserTableContainer(), "core"); - TableInfo tableInfo = coreSchema.getTable("SiteUsers"); - if (tableInfo == null) - throw new NotFoundException("SiteUsers table not available. You don't have permission to the project."); - return tableInfo; + TableInfo userTable = coreSchema.getTable("SiteUsers"); + return userTable != null ? userTable.getDomain() : null; } private Container getUserTableContainer() @@ -370,7 +369,7 @@ private Container getUserTableContainer() public boolean isNeedSurvey(User user) { String needSurveyProp = "NeedSurvey"; - Domain domain = getSiteUserTableInfo(user).getDomain(); + Domain domain = getSiteUserDomain(user); if (domain == null) return false; @@ -392,7 +391,7 @@ public boolean isNeedSurvey(User user) public void setNeedSurvey(User user, boolean needSurvey) throws ValidEmail.InvalidEmailException, SQLException, BatchValidationException, InvalidKeyException, QueryUpdateServiceException, ValidationException { - Domain domain = getSiteUserTableInfo(user).getDomain(); + Domain domain = getSiteUserDomain(user); if (domain == null) return; @@ -408,7 +407,7 @@ public void updateSurvey(User user, String firstName, String lastName, String in //TODO simplify code once "Issue 34721: UsersTable permission handling improvement" is fixed updateUserName(user, firstName, lastName); - Domain domain = getSiteUserTableInfo(user).getDomain(); + Domain domain = getSiteUserDomain(user); if (domain == null) return; diff --git a/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java b/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java index 39c3881d6..67854b6c5 100644 --- a/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java @@ -741,7 +741,7 @@ public void testFirstTimeUse() log("Validate behavior with the deleted user."); getDriver().navigate().to(welcomeUrls[2]); handleCreateAccount(true); - waitForText("This email address is not associated with an account."); + waitForText("Verification failed. You may have already verified."); log("Validate behavior with the user who does not have permissions to CDS."); getDriver().navigate().to(welcomeUrls[1]); From a8ca2969002a04b1beff47ee4073f426e1a637cf Mon Sep 17 00:00:00 2001 From: labkey-sweta Date: Tue, 3 Dec 2024 13:04:41 -0800 Subject: [PATCH 4/4] Increase the timeout --- test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java b/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java index 58ff19025..7a4a4d8fe 100644 --- a/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java +++ b/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java @@ -882,7 +882,7 @@ public void verifyDiscreteTimeVariables() clickButton("Filter", 0); log("Wait for one of the other studies to disappear before moving on."); - waitForTextToDisappear("ZAP 117", 5000); + waitForTextToDisappear("ZAP 117", 8000); pattern = Pattern.compile("^0123.*330300.*"); cds.assertPlotTickText(1, pattern);