Skip to content

Commit

Permalink
Disable JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Oct 29, 2024
1 parent 2fc461e commit 177f2e7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ public void testWithIdenticalNames() throws IOException {
final URI uri = reportsFile.toURI();

try (WebClient webClient = new WebClient()) {
webClient.getOptions().setJavaScriptEnabled(false);
HtmlPage page = webClient.getPage(uri.toURL());
HtmlAnchor a = (HtmlAnchor)
page.getByXPath("//a[@href = \"javascript:toggleDisplay('surefire260.TestB.testDup');\"]")
.get(0);
HtmlTableRow content = (HtmlTableRow) page.getElementById("surefire260.TestB.testDup-failure");
assertNotNull(content);
assertTrue(content.getAttribute("style").contains("none"));
webClient.getOptions().setJavaScriptEnabled(true);
a.click();
assertFalse(content.getAttribute("style").contains("none"));
}
Expand Down

0 comments on commit 177f2e7

Please sign in to comment.