Skip to content

Commit b63590f

Browse files
authored
53194 : The user may not have access to the Well table (#2472)
1 parent ab776b9 commit b63590f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/org/labkey/test/tests/SampleTypeLinkToStudyTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class SampleTypeLinkToStudyTest extends BaseWebDriverTest
5353
final static String SAMPLE_TYPE2 = "Sample type 2";
5454
private final static String visitLabel1 = "Screening";
5555
private final static String visitLabel2 = "Baseline";
56+
private static final String READER_USER = "[email protected]";
5657

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

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

143+
// issue 53194
144+
impersonate(READER_USER);
145+
log("Verifying the linked sample type in study");
146+
goToProjectHome(VISIT_BASED_STUDY);
147+
clickAndWait(Locator.linkWithText(SAMPLE_TYPE1));
148+
stopImpersonating();
149+
141150
log("Verifying log entries");
142151
goToProjectHome(SAMPLE_TYPE_PROJECT);
143152
clickAndWait(Locator.linkWithText(SAMPLE_TYPE1));
@@ -852,6 +861,7 @@ public List<String> getAssociatedModules()
852861
@Override
853862
protected void doCleanup(boolean afterTest) throws TestTimeoutException
854863
{
864+
_userHelper.deleteUsers(false, READER_USER);
855865
_containerHelper.deleteProject(SAMPLE_TYPE_PROJECT, afterTest);
856866
_containerHelper.deleteProject(VISIT_BASED_STUDY, afterTest);
857867
_containerHelper.deleteProject(DATE_BASED_STUDY, afterTest);

0 commit comments

Comments
 (0)