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

Function test_select_input

tests/async/test_element_handle.py:537–552  ·  view source on GitHub ↗
(
    page: Page, server: Server, is_firefox: bool, is_webkit: bool
)

Source from the content-addressed store, hash-verified

535
536
537async def test_select_input(
538 page: Page, server: Server, is_firefox: bool, is_webkit: bool
539) -> None:
540 await page.goto(server.PREFIX + "/input/textarea.html")
541 input = await page.query_selector("input")
542 assert input
543 await input.evaluate('input => input.value = "some value"')
544 await input.select_text()
545 if is_firefox or is_webkit:
546 assert await input.evaluate("el => el.selectionStart") == 0
547 assert await input.evaluate("el => el.selectionEnd") == 10
548 else:
549 assert (
550 await page.evaluate("() => window.getSelection().toString()")
551 == "some value"
552 )
553
554
555async def test_select_text_select_plain_div(page: Page, server: Server) -> None:

Callers

nothing calls this directly

Calls 4

gotoMethod · 0.45
query_selectorMethod · 0.45
evaluateMethod · 0.45
select_textMethod · 0.45

Tested by

no test coverage detected