def raises_alert(driver: WebDriver, element: str) -> None:
    """Click an element and check that an alert is raised.

    Args:
        driver: WebDriver instance.
        element: The element to click.
    """
    btn = driver.find_element(By.ID, element)
    btn.click()
    alert = AppHarness._poll_for(lambda: get_alert_or_none(driver))
    assert isinstance(alert, Alert)
    assert alert.text == "clicked"
    alert.accept()
Click an element and check that an alert is raised.

    Args:
        driver: WebDriver instance.
        element: The element to click.
    
tests/integration/test_state_inheritance.py