|
20 | 20 | import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
21 | 21 | import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
|
22 | 22 | import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
|
| 23 | +import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs; |
| 24 | +import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated; |
23 | 25 | import static org.openqa.selenium.testing.Safely.safelyCall;
|
24 | 26 | import static org.openqa.selenium.testing.drivers.Browser.CHROME;
|
25 | 27 | import static org.openqa.selenium.testing.drivers.Browser.EDGE;
|
|
43 | 45 | import org.openqa.selenium.environment.webserver.Page;
|
44 | 46 | import org.openqa.selenium.print.PrintOptions;
|
45 | 47 | import org.openqa.selenium.remote.RemoteWebElement;
|
| 48 | +import org.openqa.selenium.testing.Ignore; |
46 | 49 | import org.openqa.selenium.testing.JupiterTestBase;
|
47 | 50 | import org.openqa.selenium.testing.NotYetImplemented;
|
48 | 51 |
|
@@ -498,6 +501,41 @@ void canPrintPage() {
|
498 | 501 | assertThat(printPage).contains("JVBER");
|
499 | 502 | }
|
500 | 503 |
|
| 504 | + @Test |
| 505 | + @NotYetImplemented(SAFARI) |
| 506 | + @NotYetImplemented(IE) |
| 507 | + @NotYetImplemented(CHROME) |
| 508 | + @NotYetImplemented(FIREFOX) |
| 509 | + public void canNavigateBackInTheBrowserHistory() { |
| 510 | + BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle()); |
| 511 | + browsingContext.navigate(pages.formPage, ReadinessState.COMPLETE); |
| 512 | + |
| 513 | + wait.until(visibilityOfElementLocated(By.id("imageButton"))).submit(); |
| 514 | + wait.until(titleIs("We Arrive Here")); |
| 515 | + |
| 516 | + browsingContext.back(); |
| 517 | + wait.until(titleIs("We Leave From Here")); |
| 518 | + } |
| 519 | + |
| 520 | + @Test |
| 521 | + @NotYetImplemented(SAFARI) |
| 522 | + @NotYetImplemented(IE) |
| 523 | + @NotYetImplemented(CHROME) |
| 524 | + @NotYetImplemented(FIREFOX) |
| 525 | + void canNavigateForwardInTheBrowserHistory() { |
| 526 | + BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle()); |
| 527 | + browsingContext.navigate(pages.formPage, ReadinessState.COMPLETE); |
| 528 | + |
| 529 | + wait.until(visibilityOfElementLocated(By.id("imageButton"))).submit(); |
| 530 | + wait.until(titleIs("We Arrive Here")); |
| 531 | + |
| 532 | + browsingContext.back(); |
| 533 | + wait.until(titleIs("We Leave From Here")); |
| 534 | + |
| 535 | + browsingContext.forward(); |
| 536 | + wait.until(titleIs("We Arrive Here")); |
| 537 | + } |
| 538 | + |
501 | 539 | private String alertPage() {
|
502 | 540 | return appServer.create(
|
503 | 541 | new Page()
|
|
0 commit comments