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

Function test_should_work_with_modifiers

tests/async/test_tap.py:102–116  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

100
101
102async def test_should_work_with_modifiers(page: Page) -> None:
103 await page.set_content("hello world")
104 alt_key_promise = asyncio.create_task(
105 page.evaluate(
106 """() => new Promise(resolve => {
107 document.addEventListener('touchstart', event => {
108 resolve(event.altKey);
109 }, {passive: false});
110 })"""
111 )
112 )
113 await asyncio.sleep(0) # make sure the evals hit the page
114 await page.evaluate("""() => void 0""")
115 await page.tap("body", modifiers=["Alt"])
116 assert await alt_key_promise is True
117
118
119async def test_should_send_well_formed_touch_points(page: Page) -> None:

Callers

nothing calls this directly

Calls 3

set_contentMethod · 0.45
evaluateMethod · 0.45
tapMethod · 0.45

Tested by

no test coverage detected