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

Function track_events

tests/async/test_tap.py:225–237  ·  view source on GitHub ↗
(target: Optional[ElementHandle])

Source from the content-addressed store, hash-verified

223
224
225async def track_events(target: Optional[ElementHandle]) -> JSHandle:
226 assert target
227 return await target.evaluate_handle(
228 """target => {
229 const events = [];
230 for (const event of [
231 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'click',
232 'pointercancel', 'pointerdown', 'pointerenter', 'pointerleave', 'pointermove', 'pointerout', 'pointerover', 'pointerup',
233 'touchstart', 'touchend', 'touchmove', 'touchcancel',])
234 target.addEventListener(event, () => events.push(event), false);
235 return events;
236 }"""
237 )

Calls 1

evaluate_handleMethod · 0.45

Tested by

no test coverage detected