MCPcopy Create free account
hub / github.com/microsoft/playwright-python / test_wait_for_response_should_work

Function test_wait_for_response_should_work

tests/async/test_page.py:307–318  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

305
306
307async def test_wait_for_response_should_work(page: Page, server: Server) -> None:
308 await page.goto(server.EMPTY_PAGE)
309 async with page.expect_response(server.PREFIX + "/digits/2.png") as response_info:
310 await page.evaluate(
311 """() => {
312 fetch('/digits/1.png')
313 fetch('/digits/2.png')
314 fetch('/digits/3.png')
315 }"""
316 )
317 response = await response_info.value
318 assert response.url == server.PREFIX + "/digits/2.png"
319
320
321async def test_wait_for_response_should_respect_timeout(page: Page) -> None:

Callers

nothing calls this directly

Calls 3

gotoMethod · 0.45
expect_responseMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected