-
Notifications
You must be signed in to change notification settings - Fork 9
Item 7767: Automated test updates for the new error page #491
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
Conversation
| getWrapper().goToHome(); | ||
|
|
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.
Don't change the behavior of this method (It only navigates if ends up on a permission denied page after impersonating). It is fairly widely used and some probably expect to be on the same page after impersonating.
Does the 403 page (or whatever page we end up on) not have a link to go to home anymore?
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.
We do not have home button on the error page anymore. Should I check for the response code from the title of the page and then route to home?
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.
Yeah. And just click the logo in the upper-left. I'd rather not move goToHome into WebDriverWrapper.
| waitForAnyElement(Locators.labkeyError, Locators.labkeyErrorSubHeading); | ||
| assertElementPresent(Locators.labkeyErrorSubHeading.withText("Registration is not enabled.")); |
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.
This check should be specific. We know what page we should end up on. If timing is a problem, we can wait for the error.
| waitForAnyElement(Locators.labkeyError, Locators.labkeyErrorSubHeading); | |
| assertElementPresent(Locators.labkeyErrorSubHeading.withText("Registration is not enabled.")); | |
| waitForElement(Locators.labkeyErrorSubHeading.withText("Registration is not enabled.")); |
| protected static final String PERMISSION_ERROR = "User does not have permission to perform this operation."; | ||
| protected static final String NOT_FOUND_ERROR = "notFound"; |
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.
Move PERMISSION_ERROR and NOT_FOUND_ERROR to SecurityTest. The only other place that uses PERMISSION_ERROR is an unused method, which can be removed: BaseWebDriverTest.assertAtUserUserLacksPermissionPage.
labkey-tchad
left a comment
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.
A couple of questions.
- In
Crawler.isIgnoredError, we ignore 404s from modules that aren't enabled in the current container. Should we update that check or do we think 404 is an inappropriate response for those actions? It probably isn't appropriate since we have links to all modules in the admin menu, regardless of whether they are enabled. - Is
Locator.css("table.server-error")still valid? Its used inCrawler.checkForServerErrorandCrawler.crawlLink.
|
@labkey-tchad An action from an inactive module won't automatically return a 404. Most should return 200 and work OK. For example, neither Study nor Flow is enabled in this folder: https://www.labkey.org/home/study-begin.view? https://www.labkey.org/home/flow-begin.view? I see exactly one spot in the code that returns a 404 with the message about a module not being enabled, in a MS2 protein search action. |
|
@labkey-tchad I think |
|
@labkey-tchad all the tests passed. Let me know if there are changes to be made. |
Rationale
Automated test updates for the new error page
Related Pull Requests