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

Function test_should_emit_focus_event

tests/async/test_focus.py:27–33  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

25
26
27async def test_should_emit_focus_event(page: Page) -> None:
28 await page.set_content("<div id=d1 tabIndex=0></div>")
29 focused = []
30 await page.expose_function("focusEvent", lambda: focused.append(True))
31 await page.evaluate("() => d1.addEventListener('focus', focusEvent)")
32 await page.focus("#d1")
33 assert focused == [True]
34
35
36async def test_should_emit_blur_event(page: Page) -> None:

Callers

nothing calls this directly

Calls 5

appendMethod · 0.80
set_contentMethod · 0.45
expose_functionMethod · 0.45
evaluateMethod · 0.45
focusMethod · 0.45

Tested by

no test coverage detected