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

Function override

tests/async/test_browsercontext.py:186–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 await baseline()
185
186 async def override() -> None:
187 context = await browser.new_context(user_agent="foobar")
188 page = await context.new_page()
189 [request, _] = await asyncio.gather(
190 server.wait_for_request("/empty.html"),
191 page.goto(server.EMPTY_PAGE),
192 )
193 assert request.getHeader("user-agent") == "foobar"
194 await context.close()
195
196 await override()
197

Calls 8

wait_for_requestMethod · 0.80
new_contextMethod · 0.45
new_pageMethod · 0.45
gotoMethod · 0.45
closeMethod · 0.45
add_script_tagMethod · 0.45
evaluateMethod · 0.45
attach_frameMethod · 0.45

Tested by

no test coverage detected