-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax related issue rules for restricted issues #1249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotoProjectHome()
impersonate()
waitAndClickAndWait();
need this update in most of the place.
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@Category({CustomModules.class, EHR.class, ONPRC.class}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@labkey-tchad Do we need CustomModule.EHR for this test to run in ONPRC module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomModules.class
should be removed from all of the EHR tests.
@Test | ||
public void restrictedIssueTest() | ||
{ | ||
clickProject(getProjectName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goToProjectHome(); would do the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a particular preference but the difference is that clickProject
uses the project menu while goToProjectHome
navigates directly to <containerPath>/project-begin.view
.
|
||
// create a few issues in the restricted list | ||
impersonate(ISSUE_CREATOR.getEmail()); | ||
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't goToProjectHome()
on line 98 wait for up to 60 seconds for the page to load?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitAndClick
/waitAndClickAndWait
are only necessary if the link takes a moment to appear after the page has loaded (probably not necessary here)
stopImpersonating(); | ||
|
||
// verify site admins can see both issues (but not folder admins) | ||
clickProject(getProjectName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotoProjectHome();
|
||
// verify site admins can see both issues (but not folder admins) | ||
clickProject(getProjectName()); | ||
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
verifyIssueAccess(ISSUE_2, true); | ||
|
||
impersonate(FOLDER_ADMIN.getEmail()); | ||
clickProject(getProjectName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt it be ?
gotoProjectHome();
impersonate(FOLDER_ADMIN.getEmail());
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter? Either should be starting from the project begin URL?
stopImpersonating(); | ||
|
||
// creators can see all of the issues they opened | ||
impersonate(ISSUE_CREATOR.getEmail()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above
stopImpersonating(); | ||
|
||
// users can view issues assigned to them | ||
impersonate(USER1.getEmail()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
impersonate(FOLDER_ADMIN.getEmail()); | ||
clickProject(getProjectName()); | ||
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); | ||
verifyIssueAccess(ISSUE_1, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Folder admin don't have access to issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to a restricted issue, only site admins are allowed.
|
||
// create 2 issues related to each other | ||
impersonate(ISSUE_CREATOR.getEmail()); | ||
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotoProjectHome()
impersonate()
waitAndClickAndWait();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automation looks good
Rationale
This changes how related issues are handled for restricted issues. Previously, a user was required to have access to all related issues in order to view an issues details. With this change, related issues will behave equivalently to those in an unrestricted list. A user will still be able to view the details of an issue but will not see any related issues they do not have access to (other than the ID of said related issue(s)).
This also adds automated tests to validate the desired behavior for restricted issue lists.
Related Pull Requests