Method: Playwright::Page#expect_response
- Defined in:
- lib/playwright_api/page.rb
#expect_response(urlOrPredicate, timeout: nil) ⇒ Object
Returns the matched response.
“‘js const firstResponse = await page.waitForResponse(’example.com/resource’); const finalResponse = await page.waitForResponse(response => response.url() === ‘example.com’ && response.status() === 200); return finalResponse.ok(); “‘
“‘python async first_response = await page.wait_for_response(“example.com/resource”) final_response = await page.wait_for_response(lambda response: response.url == “example.com” and response.status === 200) return final_response.ok “`
“‘python sync first_response = page.wait_for_response(“example.com/resource”) final_response = page.wait_for_response(lambda response: response.url == “example.com” and response.status === 200) return final_response.ok “`
1764 1765 1766 |
# File 'lib/playwright_api/page.rb', line 1764 def expect_response(urlOrPredicate, timeout: nil) wrap_impl(@impl.expect_response(unwrap_impl(urlOrPredicate), timeout: unwrap_impl(timeout))) end |