|
25 | 25 | import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs; |
26 | 26 | import static org.openqa.selenium.testing.drivers.Browser.CHROME; |
27 | 27 | import static org.openqa.selenium.testing.drivers.Browser.EDGE; |
28 | | -import static org.openqa.selenium.testing.drivers.Browser.LEGACY_FIREFOX_XPI; |
| 28 | +import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; |
29 | 29 | import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT; |
30 | 30 | import static org.openqa.selenium.testing.drivers.Browser.IE; |
31 | | -import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; |
| 31 | +import static org.openqa.selenium.testing.drivers.Browser.LEGACY_FIREFOX_XPI; |
32 | 32 | import static org.openqa.selenium.testing.drivers.Browser.SAFARI; |
33 | 33 |
|
34 | 34 | import org.junit.After; |
|
45 | 45 |
|
46 | 46 | public class AlertsTest extends JUnit4TestBase { |
47 | 47 |
|
| 48 | + private static ExpectedCondition<Boolean> textInElementLocated( |
| 49 | + final By locator, final String text) { |
| 50 | + return driver -> text.equals(driver.findElement(locator).getText()); |
| 51 | + } |
| 52 | + |
| 53 | + private static ExpectedCondition<WebDriver> ableToSwitchToWindow(final String name) { |
| 54 | + return driver -> driver.switchTo().window(name); |
| 55 | + } |
| 56 | + |
48 | 57 | @After |
49 | 58 | public void closeAlertIfPresent() { |
50 | 59 | try { |
@@ -174,6 +183,7 @@ public void testShouldAllowAUserToDismissAPrompt() { |
174 | 183 | } |
175 | 184 |
|
176 | 185 | @Test |
| 186 | + @Ignore(value = FIREFOX, reason = "Hangs") |
177 | 187 | public void testShouldAllowAUserToSetTheValueOfAPrompt() { |
178 | 188 | driver.get(promptPage(null)); |
179 | 189 |
|
@@ -352,6 +362,7 @@ public void testHandlesTwoAlertsFromOneInteraction() { |
352 | 362 | } |
353 | 363 |
|
354 | 364 | @Test |
| 365 | + @Ignore(value = FIREFOX, reason = "Hangs") |
355 | 366 | public void testShouldHandleAlertOnPageLoad() { |
356 | 367 | String pageWithOnLoad = appServer.create(new Page() |
357 | 368 | .withOnLoad("javascript:alert(\"onload\")") |
@@ -466,15 +477,6 @@ public void shouldHandleAlertOnFormSubmit() { |
466 | 477 | assertThat(driver.getTitle()).isEqualTo("Testing Alerts"); |
467 | 478 | } |
468 | 479 |
|
469 | | - private static ExpectedCondition<Boolean> textInElementLocated( |
470 | | - final By locator, final String text) { |
471 | | - return driver -> text.equals(driver.findElement(locator).getText()); |
472 | | - } |
473 | | - |
474 | | - private static ExpectedCondition<WebDriver> ableToSwitchToWindow(final String name) { |
475 | | - return driver -> driver.switchTo().window(name); |
476 | | - } |
477 | | - |
478 | 480 | private void setSimpleOnBeforeUnload(Object returnText) { |
479 | 481 | ((JavascriptExecutor) driver).executeScript( |
480 | 482 | "var returnText = arguments[0]; window.onbeforeunload = function() { return returnText; }", |
|
0 commit comments