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

Function test_should_pause_and_resume

tests/async/test_debugger.py:26–43  ·  view source on GitHub ↗
(
    context: BrowserContext, page: Page, server: Server
)

Source from the content-addressed store, hash-verified

24
25
26async def test_should_pause_and_resume(
27 context: BrowserContext, page: Page, server: Server
28) -> None:
29 paused_event = asyncio.Event()
30 context.debugger.on("pausedstatechanged", lambda: paused_event.set())
31
32 await context.debugger.request_pause()
33 next_call = asyncio.create_task(page.goto(server.EMPTY_PAGE))
34
35 await asyncio.wait_for(paused_event.wait(), timeout=5)
36 assert context.debugger.paused_details is not None
37
38 paused_event.clear()
39 await context.debugger.resume()
40 await asyncio.wait_for(paused_event.wait(), timeout=5)
41 assert context.debugger.paused_details is None
42
43 await next_call

Callers

nothing calls this directly

Calls 7

setMethod · 0.80
onMethod · 0.45
request_pauseMethod · 0.45
gotoMethod · 0.45
wait_forMethod · 0.45
clearMethod · 0.45
resumeMethod · 0.45

Tested by

no test coverage detected