Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/org/labkey/test/pages/LabkeyErrorPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public String getErrorImage()
{
return elementCache().errorImage.getAttribute("src");
}

public boolean isShowDetailsPresent()
{
return !Locator.button("View Details").findElements(getDriver()).isEmpty();
}

@Override
protected ElementCache newElementCache()
{
Expand Down
8 changes: 7 additions & 1 deletion src/org/labkey/test/tests/LabkeyErrorPageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void testGeneralErrors()
checker().verifyEquals("Incorrect error heading message", "404: page not found",
errorPage.getErrorHeading());
checker().verifyThat("Incorrect error image", errorPage.getErrorImage(), CoreMatchers.containsString(imageTitle));
checker().verifyTrue("'Show Details' button should appear on not found error page",
errorPage.isShowDetailsPresent());

beginAt(WebTestHelper.buildRelativeUrl("project", getCurrentContainerPath(), "beginning"));
errorPage = new LabkeyErrorPage(getDriver());
Expand Down Expand Up @@ -88,6 +90,8 @@ public void testServerConfigurationErrors()
checker().verifyEquals("Incorrect error sub-heading message", "The requested page cannot be found. You have a configuration problem.",
errorPage.getSubErrorHeading());
checker().verifyThat("Incorrect error image", errorPage.getErrorImage(), CoreMatchers.containsString(imageTitle));
checker().verifyTrue("'Show Details' button should appear on configuration error page",
errorPage.isShowDetailsPresent());

checkExpectedErrors(1);
}
Expand All @@ -103,9 +107,11 @@ public void testExecutionErrors()
checker().verifyEquals("Incorrect error heading message", "Oops! An error has occurred.",
errorPage.getErrorHeading());
checker().verifyEquals("Incorrect error instructions", "You can find help resources here and may " +
"find troubleshooting hints by reading the full stack trace in the View Details section below.",
"find troubleshooting hints by reading the full stack trace in the server logs.",
errorPage.getErrorInstruction());
checker().verifyThat("Incorrect error image", errorPage.getErrorImage(), CoreMatchers.containsString(imageTitle));
checker().verifyFalse("'Show Details' button should not appear on execution error page",
errorPage.isShowDetailsPresent());

checkExpectedErrors(2);
}
Expand Down
Loading