async def test_navigation_app(navigation_app: AppHarness):
    """Type text after moving cursor. Update text on backend.

    Args:
        navigation_app: harness for NavigationApp app
    """
    assert navigation_app.app_instance is not None, "app is not running"
    driver = navigation_app.frontend()

    ss = SessionStorage(driver)
    assert AppHarness._poll_for(lambda: ss.get("token") is not None), "token not found"

    internal_link = driver.find_element(By.ID, "internal")

    with poll_for_navigation(driver):
        internal_link.click()
    assert urlsplit(driver.current_url).path == "/internal/"
    with poll_for_navigation(driver):
        driver.back()

    external_link = driver.find_element(By.ID, "external")
    external2_link = driver.find_element(By.ID, "external2")

    external_link.click()
    # Expect a new tab to open
    assert AppHarness._poll_for(lambda: len(driver.window_handles) == 2)

    # Switch back to the main tab
    driver.switch_to.window(driver.window_handles[0])

    external2_link.click()
    # Expect another new tab to open
    assert AppHarness._poll_for(lambda: len(driver.window_handles) == 3)
Type text after moving cursor. Update text on backend.

    Args:
        navigation_app: harness for NavigationApp app
    
tests/integration/test_navigation.py