Type text after moving cursor. Update text on backend. Args: navigation_app: harness for NavigationApp app
(navigation_app: AppHarness)
| 58 | |
| 59 | |
| 60 | def test_navigation_app(navigation_app: AppHarness): |
| 61 | """Type text after moving cursor. Update text on backend. |
| 62 | |
| 63 | Args: |
| 64 | navigation_app: harness for NavigationApp app |
| 65 | """ |
| 66 | assert navigation_app.app_instance is not None, "app is not running" |
| 67 | driver = navigation_app.frontend() |
| 68 | |
| 69 | ss = SessionStorage(driver) |
| 70 | assert AppHarness._poll_for(lambda: ss.get("token") is not None), "token not found" |
| 71 | |
| 72 | internal_link = driver.find_element(By.ID, "internal") |
| 73 | |
| 74 | with poll_for_navigation(driver): |
| 75 | internal_link.click() |
| 76 | assert urlsplit(driver.current_url).path == "/internal" |
| 77 | with poll_for_navigation(driver): |
| 78 | driver.back() |
| 79 | |
| 80 | external_link = AppHarness.poll_for_or_raise_timeout( |
| 81 | lambda: driver.find_element(By.ID, "external") |
| 82 | ) |
| 83 | external2_link = driver.find_element(By.ID, "external2") |
| 84 | |
| 85 | external_link.click() |
| 86 | # Expect a new tab to open |
| 87 | AppHarness.expect(lambda: len(driver.window_handles) == 2) |
| 88 | |
| 89 | # Switch back to the main tab |
| 90 | driver.switch_to.window(driver.window_handles[0]) |
| 91 | |
| 92 | external2_link.click() |
| 93 | # Expect another new tab to open |
| 94 | AppHarness.expect(lambda: len(driver.window_handles) == 3) |
nothing calls this directly
no test coverage detected