Skip to content

Commit

Permalink
[Misc] Expose test alert problem with firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
surli committed Apr 18, 2024
1 parent c0fa0f9 commit f1bba36
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.xwiki.administration.test.po.AdministrationPage;
import org.xwiki.application.test.po.ApplicationIndexHomePage;
import org.xwiki.appwithinminutes.test.po.EntryNamePane;
Expand Down Expand Up @@ -169,4 +170,15 @@ void verifyMenuIsAvailableInAdministration(TestUtils setup) throws Exception
administrationPage = AdministrationPage.gotoPage();
assertTrue(administrationPage.hasLeftPanel("menu1"));
}

@Test
@Order(4)
void testAlert(TestUtils testUtils) throws InterruptedException
{
ViewPage viewPage = testUtils.gotoPage("Main", "WebHome");
testUtils.getDriver().executeJavascript("window.onbeforeunload = function () { return false; }");
viewPage.edit();
testUtils.getDriver().waitUntilCondition(ExpectedConditions.alertIsPresent());
testUtils.getDriver().switchTo().alert().dismiss();
}
}

0 comments on commit f1bba36

Please sign in to comment.