MCPcopy Create free account
hub / github.com/microsoft/playwright-python / test_should_specify_location

Function test_should_specify_location

tests/async/test_keyboard.py:387–403  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

385
386
387async def test_should_specify_location(page: Page, server: Server) -> None:
388 await page.goto(server.PREFIX + "/input/textarea.html")
389 lastEvent = await captureLastKeydown(page)
390 textarea = await page.query_selector("textarea")
391 assert textarea
392
393 await textarea.press("Digit5")
394 assert await lastEvent.evaluate("e => e.location") == 0
395
396 await textarea.press("ControlLeft")
397 assert await lastEvent.evaluate("e => e.location") == 1
398
399 await textarea.press("ControlRight")
400 assert await lastEvent.evaluate("e => e.location") == 2
401
402 await textarea.press("NumpadSubtract")
403 assert await lastEvent.evaluate("e => e.location") == 3
404
405
406async def test_should_press_enter(page: Page) -> None:

Callers

nothing calls this directly

Calls 5

captureLastKeydownFunction · 0.85
gotoMethod · 0.45
query_selectorMethod · 0.45
pressMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected