MCPcopy Index your code
hub / github.com/microsoft/playwright-python / on_dialog

Function on_dialog

tests/async/test_dialog.py:21–26  ·  view source on GitHub ↗
(dialog: Dialog)

Source from the content-addressed store, hash-verified

19 result = []
20
21 async def on_dialog(dialog: Dialog) -> None:
22 result.append(True)
23 assert dialog.type == "alert"
24 assert dialog.default_value == ""
25 assert dialog.message == "yo"
26 await dialog.accept()
27
28 page.on("dialog", on_dialog)
29 await page.evaluate("alert('yo')")

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
acceptMethod · 0.45
dismissMethod · 0.45

Tested by

no test coverage detected