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

Function test_wheel_should_work

tests/async/test_input.py:268–292  ·  view source on GitHub ↗
(page: Page, browser_name: str)

Source from the content-addressed store, hash-verified

266
267
268async def test_wheel_should_work(page: Page, browser_name: str) -> None:
269 await page.set_content(
270 """
271 <div style="width: 5000px; height: 5000px;"></div>
272 """
273 )
274 await page.mouse.move(50, 60)
275 await _listen_for_wheel_events(page, "div")
276 await page.mouse.wheel(0, 100)
277 _assert_wheel_event(
278 await page.evaluate("window.lastEvent"),
279 {
280 "deltaX": 0,
281 "deltaY": 100,
282 "clientX": 50,
283 "clientY": 60,
284 "deltaMode": 0,
285 "ctrlKey": False,
286 "shiftKey": False,
287 "altKey": False,
288 "metaKey": False,
289 },
290 browser_name,
291 )
292 await page.wait_for_function("window.scrollY === 100")
293
294
295async def _listen_for_wheel_events(page: Page, selector: str) -> None:

Callers

nothing calls this directly

Calls 7

_listen_for_wheel_eventsFunction · 0.85
_assert_wheel_eventFunction · 0.85
set_contentMethod · 0.45
moveMethod · 0.45
wheelMethod · 0.45
evaluateMethod · 0.45
wait_for_functionMethod · 0.45

Tested by

no test coverage detected