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

Function test_should_receive_events

tests/async/test_cdp_session.py:39–45  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

37
38@pytest.mark.only_browser("chromium")
39async def test_should_receive_events(page: Page, server: Server) -> None:
40 client = await page.context.new_cdp_session(page)
41 await client.send("Network.enable")
42 events = []
43 client.on("Network.requestWillBeSent", lambda event: events.append(event))
44 await page.goto(server.EMPTY_PAGE)
45 assert len(events) == 1
46
47
48@pytest.mark.only_browser("chromium")

Callers

nothing calls this directly

Calls 5

appendMethod · 0.80
new_cdp_sessionMethod · 0.45
sendMethod · 0.45
onMethod · 0.45
gotoMethod · 0.45

Tested by

no test coverage detected