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

Function test_select_textarea

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

Source from the content-addressed store, hash-verified

517
518
519async def test_select_textarea(
520 page: Page, server: Server, is_firefox: bool, is_webkit: bool
521) -> None:
522 await page.goto(server.PREFIX + "/input/textarea.html")
523 textarea = await page.query_selector("textarea")
524 assert textarea
525 await textarea.evaluate('textarea => textarea.value = "some value"')
526 await textarea.select_text()
527 if is_firefox or is_webkit:
528 assert await textarea.evaluate("el => el.selectionStart") == 0
529 assert await textarea.evaluate("el => el.selectionEnd") == 10
530 else:
531 assert (
532 await page.evaluate("() => window.getSelection().toString()")
533 == "some value"
534 )
535
536
537async def 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