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

Function test_focus_a_button

tests/async/test_element_handle.py:682–688  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

680
681
682async def test_focus_a_button(page: Page, server: Server) -> None:
683 await page.goto(server.PREFIX + "/input/button.html")
684 button = await page.query_selector("button")
685 assert button
686 assert await button.evaluate("button => document.activeElement === button") is False
687 await button.focus()
688 assert await button.evaluate("button => document.activeElement === button")
689
690
691async def test_is_visible_and_is_hidden_should_work(page: Page) -> None:

Callers

nothing calls this directly

Calls 4

gotoMethod · 0.45
query_selectorMethod · 0.45
evaluateMethod · 0.45
focusMethod · 0.45

Tested by

no test coverage detected