Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 3eb734f

Browse files
Updating the test to match the new browser value. (#673)
Co-authored-by: Lum <klum@labkey.com>
1 parent 3b36b98 commit 3eb734f

6 files changed

Lines changed: 20 additions & 21 deletions

File tree

src/org/labkey/cds/CDSManager.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.apache.commons.lang3.StringUtils;
2020
import org.jetbrains.annotations.NotNull;
21+
import org.jetbrains.annotations.Nullable;
2122
import org.labkey.api.data.Container;
2223
import org.labkey.api.data.ContainerManager;
2324
import org.labkey.api.data.CoreSchema;
@@ -53,7 +54,6 @@
5354
import org.labkey.api.settings.AppProps;
5455
import org.labkey.api.util.ContainerUtil;
5556
import org.labkey.api.util.PageFlowUtil;
56-
import org.labkey.api.view.NotFoundException;
5757

5858
import java.sql.SQLException;
5959
import java.util.ArrayList;
@@ -353,13 +353,12 @@ public String getAllBlogsPath(Container container)
353353
return PageFlowUtil.decode(mp.getEffectiveValue(container));
354354
}
355355

356-
public TableInfo getSiteUserTableInfo(User user)
356+
@Nullable
357+
public Domain getSiteUserDomain(User user)
357358
{
358359
UserSchema coreSchema = QueryService.get().getUserSchema(user, getUserTableContainer(), "core");
359-
TableInfo tableInfo = coreSchema.getTable("SiteUsers");
360-
if (tableInfo == null)
361-
throw new NotFoundException("SiteUsers table not available. You don't have permission to the project.");
362-
return tableInfo;
360+
TableInfo userTable = coreSchema.getTable("SiteUsers");
361+
return userTable != null ? userTable.getDomain() : null;
363362
}
364363

365364
private Container getUserTableContainer()
@@ -370,7 +369,7 @@ private Container getUserTableContainer()
370369
public boolean isNeedSurvey(User user)
371370
{
372371
String needSurveyProp = "NeedSurvey";
373-
Domain domain = getSiteUserTableInfo(user).getDomain();
372+
Domain domain = getSiteUserDomain(user);
374373
if (domain == null)
375374
return false;
376375

@@ -392,7 +391,7 @@ public boolean isNeedSurvey(User user)
392391

393392
public void setNeedSurvey(User user, boolean needSurvey) throws ValidEmail.InvalidEmailException, SQLException, BatchValidationException, InvalidKeyException, QueryUpdateServiceException, ValidationException
394393
{
395-
Domain domain = getSiteUserTableInfo(user).getDomain();
394+
Domain domain = getSiteUserDomain(user);
396395
if (domain == null)
397396
return;
398397

@@ -408,7 +407,7 @@ public void updateSurvey(User user, String firstName, String lastName, String in
408407
//TODO simplify code once "Issue 34721: UsersTable permission handling improvement" is fixed
409408
updateUserName(user, firstName, lastName);
410409

411-
Domain domain = getSiteUserTableInfo(user).getDomain();
410+
Domain domain = getSiteUserDomain(user);
412411
if (domain == null)
413412
return;
414413

test/src/org/labkey/test/tests/cds/CDSLearnAboutAssayTabsSearchTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import java.util.Arrays;
1414

1515
@Category({})
16-
@BaseWebDriverTest.ClassTimeout(minutes = 5)
16+
@BaseWebDriverTest.ClassTimeout(minutes = 10)
1717
public class CDSLearnAboutAssayTabsSearchTest extends CDSReadOnlyTest
1818
{
1919
private final CDSHelper cds = new CDSHelper(this);

test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ public void verifyDiscreteTimeVariables()
825825
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
826826
xaxis.confirmSelection();
827827

828-
pattern = Pattern.compile("^01237.*3303003000");
828+
pattern = Pattern.compile("^01237.*2202002000");
829829
cds.assertPlotTickText(1, pattern);
830830

831831
log("Choose 'Study weeks with axis type Categorical'.");
@@ -834,7 +834,7 @@ public void verifyDiscreteTimeVariables()
834834
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
835835
xaxis.confirmSelection();
836836

837-
pattern = Pattern.compile("^01234.*3303003000");
837+
pattern = Pattern.compile("^01234.*2202002000");
838838
cds.assertPlotTickText(1, pattern);
839839

840840
log("Choose 'Study months with axis type Categorical'.");
@@ -843,7 +843,7 @@ public void verifyDiscreteTimeVariables()
843843
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
844844
xaxis.confirmSelection();
845845

846-
pattern = Pattern.compile("^0123.*3303003000");
846+
pattern = Pattern.compile("^0123.*2202002000");
847847
cds.assertPlotTickText(1, pattern);
848848

849849
log("Apply the time axis as a filter.");
@@ -882,7 +882,7 @@ public void verifyDiscreteTimeVariables()
882882

883883
clickButton("Filter", 0);
884884
log("Wait for one of the other studies to disappear before moving on.");
885-
waitForTextToDisappear("ZAP 117", 5000);
885+
waitForTextToDisappear("ZAP 117", 8000);
886886

887887
pattern = Pattern.compile("^0123.*330300.*");
888888
cds.assertPlotTickText(1, pattern);

test/src/org/labkey/test/tests/cds/CDSSecurityTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public void testFirstTimeUse()
741741
log("Validate behavior with the deleted user.");
742742
getDriver().navigate().to(welcomeUrls[2]);
743743
handleCreateAccount(true);
744-
waitForText("This email address is not associated with an account.");
744+
waitForText("Verification failed. You may have already verified.");
745745

746746
log("Validate behavior with the user who does not have permissions to CDS.");
747747
getDriver().navigate().to(welcomeUrls[1]);
@@ -1011,7 +1011,7 @@ private void verifyInfoPaneWithLimitedAccess(boolean hasAccessToQ1Q2R4)
10111011

10121012
private String[] getWelcomeLinks()
10131013
{
1014-
String usrEmail = "", msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration";
1014+
String msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration";
10151015
String[] urls = new String[_newUserAccounts.length];
10161016

10171017
goToModule("Dumbster");
@@ -1021,8 +1021,8 @@ private String[] getWelcomeLinks()
10211021
for (int index = 0; index < _newUserAccounts.length; index++)
10221022
{
10231023
emailRecordTable.clickSubject(_newUserAccounts[index] + msgSubject);
1024-
usrEmail = _newUserAccounts[index].substring(0, _newUserAccounts[index].indexOf("@"));
1025-
urls[index] = getAttribute(Locator.css("a[href*='&email=" + usrEmail + "']"), "href");
1024+
String emailBody = emailRecordTable.getMessage(_newUserAccounts[index] + msgSubject).getBody();
1025+
urls[index] = emailBody.substring(emailBody.indexOf("http:"),emailBody.lastIndexOf("\n")); //Extracting the URL from email body.
10261026
}
10271027

10281028
return urls;

test/src/org/labkey/test/tests/cds/CDSVisualizationPlotTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ public void verifyBinnedPlot()
575575

576576
log("Validate that there are bin squares in the plot.");
577577
int squareCount = Locator.tagWithClass("a","vis-bin vis-bin-square").findElements(getDriver()).size();
578-
assertTrue("Expected over 2000 bin squares found: " + squareCount, squareCount > 2000);
578+
assertTrue("Expected over 1980 bin squares found: " + squareCount, squareCount > 1980);
579579

580580
cds.ensureNoFilter();
581581
}

test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ public void verifyLogAndLinearScales()
726726

727727
// Exact y-axis tick text is inconsistent
728728
String smallLogYTicks;
729-
if (isTextPresent("0.0009"))
729+
if (isTextPresent("0.0008"))
730730
{
731-
smallLogYTicks = le + "0\n0.0009\n0.009\n0.09\n0.9";
731+
smallLogYTicks = le + "0\n0.0008\n0.008\n0.08\n0.8";
732732
}
733733
else
734734
{

0 commit comments

Comments
 (0)