Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/org/labkey/test/tests/SampleTypeLinkToStudyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class SampleTypeLinkToStudyTest extends BaseWebDriverTest
final static String SAMPLE_TYPE2 = "Sample type 2";
private final static String visitLabel1 = "Screening";
private final static String visitLabel2 = "Baseline";
private static final String READER_USER = "reader_user@user.test";

protected DateTimeFormatter _dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
protected String now = LocalDateTime.now().format(_dateTimeFormatter);
Expand All @@ -71,6 +72,7 @@ private void doSetup()
_studyHelper.startCreateStudy()
.setTimepointType(StudyHelper.TimepointType.VISIT)
.createStudy();
createUserWithPermissions(READER_USER, VISIT_BASED_STUDY, "Reader");

_containerHelper.createProject(DATE_BASED_STUDY, "Study");
_studyHelper.startCreateStudy()
Expand Down Expand Up @@ -138,6 +140,13 @@ public void testLinkToStudy()
checker().verifyEquals("Incorrect Participant ID's", Arrays.asList("P3", "P4"), table.getColumnDataAsText("ParticipantId"));
checker().verifyEquals("Incorrect category for the dataset(Uncategorized case)", " ", getCategory(VISIT_BASED_STUDY, SAMPLE_TYPE1));

// issue 53194
impersonate(READER_USER);
log("Verifying the linked sample type in study");
goToProjectHome(VISIT_BASED_STUDY);
clickAndWait(Locator.linkWithText(SAMPLE_TYPE1));
stopImpersonating();

log("Verifying log entries");
goToProjectHome(SAMPLE_TYPE_PROJECT);
clickAndWait(Locator.linkWithText(SAMPLE_TYPE1));
Expand Down Expand Up @@ -852,6 +861,7 @@ public List<String> getAssociatedModules()
@Override
protected void doCleanup(boolean afterTest) throws TestTimeoutException
{
_userHelper.deleteUsers(false, READER_USER);
_containerHelper.deleteProject(SAMPLE_TYPE_PROJECT, afterTest);
_containerHelper.deleteProject(VISIT_BASED_STUDY, afterTest);
_containerHelper.deleteProject(DATE_BASED_STUDY, afterTest);
Expand Down