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

Function test_expose_function

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

Source from the content-addressed store, hash-verified

453
454
455async def test_expose_function(page: Page, server: Server) -> None:
456 await page.expose_function("compute", lambda a, b: a * b)
457 result = await page.evaluate("compute(9, 4)")
458 assert result == 36
459
460
461async def test_expose_function_should_throw_exception_in_page_context(

Callers

nothing calls this directly

Calls 2

expose_functionMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected