Skip to content

Commit

Permalink
[java] Fixing tests with onbeforeunload event to work in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed May 2, 2019
1 parent a758261 commit d087505
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions java/client/test/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public void testShouldHandleAlertOnPageUnload() {
isFirefox(driver) && getFirefoxVersion(driver) >= 27);

String pageWithOnBeforeUnload = appServer.create(new Page()
.withOnBeforeUnload("javascript:alert(\"onbeforeunload\")")
.withOnBeforeUnload("return \"onbeforeunload\"")
.withBody("<p>Page with onbeforeunload event handler</p>"));
driver.get(appServer.create(new Page()
.withBody(String.format("<a id='link' href='%s'>open new page</a>", pageWithOnBeforeUnload))));
Expand Down Expand Up @@ -469,13 +469,14 @@ public void testShouldImplicitlyHandleAlertOnPageBeforeUnload() {
@Ignore(value = CHROME, reason = "Chrome does not trigger alerts on unload")
@NotYetImplemented(HTMLUNIT)
@Ignore(SAFARI)
@Ignore(value = IE, reason = "IE driver automatically dismisses alerts on window close")
@NotYetImplemented(EDGE)
public void testShouldHandleAlertOnWindowClose() {
assumeFalse("Firefox 27 does not trigger alerts on unload",
isFirefox(driver) && getFirefoxVersion(driver) >= 27);

String pageWithOnBeforeUnload = appServer.create(new Page()
.withOnBeforeUnload("javascript:alert(\"onbeforeunload\")")
.withOnBeforeUnload("return \"onbeforeunload\"")
.withBody("<p>Page with onbeforeunload event handler</p>"));
driver.get(appServer.create(new Page()
.withBody(String.format(
Expand Down

0 comments on commit d087505

Please sign in to comment.