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

Function test_select_textarea

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

Source from the content-addressed store, hash-verified

423
424
425def test_select_textarea(
426 page: Page, server: Server, is_firefox: bool, is_webkit: bool
427) -> None:
428 page.goto(server.PREFIX + "/input/textarea.html")
429 textarea = page.query_selector("textarea")
430 assert textarea
431 textarea.evaluate('textarea => textarea.value = "some value"')
432 textarea.select_text()
433 if is_firefox or is_webkit:
434 assert textarea.evaluate("el => el.selectionStart") == 0
435 assert textarea.evaluate("el => el.selectionEnd") == 10
436 else:
437 assert page.evaluate("() => window.getSelection().toString()") == "some value"
438
439
440def test_select_input(

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