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

Function test_select_input

tests/sync/test_element_handle.py:440–452  ·  view source on GitHub ↗
(
    page: Page, server: Server, is_firefox: bool, is_webkit: bool
)

Source from the content-addressed store, hash-verified

438
439
440def test_select_input(
441 page: Page, server: Server, is_firefox: bool, is_webkit: bool
442) -> None:
443 page.goto(server.PREFIX + "/input/textarea.html")
444 input = page.query_selector("input")
445 assert input
446 input.evaluate('input => input.value = "some value"')
447 input.select_text()
448 if is_firefox or is_webkit:
449 assert input.evaluate("el => el.selectionStart") == 0
450 assert input.evaluate("el => el.selectionEnd") == 10
451 else:
452 assert page.evaluate("() => window.getSelection().toString()") == "some value"
453
454
455def 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