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

Function test_should_fire

tests/async/test_dialog.py:18–30  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

16
17
18async def test_should_fire(page: Page) -> None:
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')")
30 assert result
31
32
33async def test_should_allow_accepting_prompts(page: Page) -> None:

Callers

nothing calls this directly

Calls 2

onMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected