async def test_event_actions_dialog_form_in_form(
    driver: WebDriver,
    poll_for_order: Callable[[list[str]], Coroutine[None, None, None]],
):
    """Click links and buttons and assert on fired events.

    Args:
        driver: WebDriver instance.
        poll_for_order: function that polls for the order list to match the expected order.
    """
    open_dialog_id = "btn-dialog"
    submit_button_id = "btn-submit"
    wait = WebDriverWait(driver, 10)

    driver.find_element(By.ID, open_dialog_id).click()
    el = wait.until(EC.element_to_be_clickable((By.ID, submit_button_id)))
    el.click()  # pyright: ignore[reportAttributeAccessIssue]
    el.send_keys(Keys.ESCAPE)  # pyright: ignore[reportAttributeAccessIssue]

    btn_no_events = wait.until(EC.element_to_be_clickable((By.ID, "btn-no-events")))
    btn_no_events.click()
    await poll_for_order(["on_submit", "on_click:outer"])
Click links and buttons and assert on fired events.

    Args:
        driver: WebDriver instance.
        poll_for_order: function that polls for the order list to match the expected order.
    
tests/integration/test_event_actions.py