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

Function test_network_events_request

tests/async/test_network.py:659–669  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

657
658
659async def test_network_events_request(page: Page, server: Server) -> None:
660 requests = []
661 page.on("request", lambda r: requests.append(r))
662 await page.goto(server.EMPTY_PAGE)
663 assert len(requests) == 1
664 assert requests[0].url == server.EMPTY_PAGE
665 assert requests[0].resource_type == "document"
666 assert requests[0].method == "GET"
667 assert await requests[0].response()
668 assert requests[0].frame == page.main_frame
669 assert requests[0].frame.url == server.EMPTY_PAGE
670
671
672async def test_network_events_response(page: Page, server: Server) -> None:

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
onMethod · 0.45
gotoMethod · 0.45
responseMethod · 0.45

Tested by

no test coverage detected