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/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); diff --git a/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java b/test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java index 5515ffb8c..7a4a4d8fe 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."); @@ -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); diff --git a/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java b/test/src/org/labkey/test/tests/cds/CDSSecurityTest.java index 2fd74c3bf..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]); @@ -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 {