Repository navigation
Description
What's going on?
The bundled playwright-cli skill (packages/playwright-core/src/tools/skills/playwright-cli/SKILL.md, which playwright-cli install --skills copies into .claude/skills/) never says how to scroll, and under-documents drag. An agent that reads only the skill has no way to discover either capability by searching for "scroll" or "drag and drop".
Scrolling
- The word "scroll" appears nowhere in
SKILL.mdorreferences/(grep -rni scrollfinds nothing). The only related line isplaywright-cli mousewheel 0 100under "Mouse", with no explanation. - The arguments (
<dx> <dy>, wheel deltas) are only explained byplaywright-cli mousewheel --help. - The wheel event goes to the element under the pointer. With the pointer over a nested
overflow: autobox,mousewheel 0 100scrolled the box (scrollTop100) and left the page at 0. The skill doesn't say tomousemovefirst. - The only example is a positive delta. Scrolling up is undocumented (
mousewheel 0 -100works on 0.1.21; negative values used to fail, see [CLI]: Negative positional arguments are parsed as flags, breaking mousewheel scroll-up #42321, so a one-line example would help).
Drag
- The skill only shows
drag e2 e8.playwright-cli drag --helpsays the targets can be "exact source element reference from the page snapshot, or a unique element selector", anddrag "#card" "#zone"works, but the skill never says selectors are accepted. dragrunslocator.dragTo(). It fired a real HTML5dropevent on my test page. The skill doesn't mention that pointer-event based drags can be done withmousemove/mousedown/mousemove/mouseup(I verified that sequence moves apointerdown/pointermovedraggable). I did not test whetherdragalone works on pointer-event-only widgets.
Suggested addition to the "Mouse" section of SKILL.md
# scroll: <dx> <dy> wheel deltas. The element under the pointer scrolls, so move the mouse first.
playwright-cli mousemove 300 150
playwright-cli mousewheel 0 100
playwright-cli mousewheel 0 -100 # scroll up
# drag accepts snapshot refs or unique selectors; for pointer-event drags use mousedown/mousemove/mouseup
playwright-cli drag "#card" "#zone"How I checked (headless, small local page that records scroll, wheel, pointer and drop events):
| Command | Observed |
|---|---|
mousewheel 0 500 |
scrollY 0 → 500, page saw deltaY=500 |
mousemove 300 150 + mousewheel 0 100 over a nested scroller |
inner scrollTop 100, page scrollY 0 |
mousewheel 0 -150 after scrolling down |
scrolled up by 150 |
mousedown + 3x mousemove + mouseup |
pointer-event box moved to the release point |
drag "#card" "#zone" |
drop event fired |
Related closed issues, for context only: #39715 (dx/dy swapped), #42321 (negative args).
Version
@playwright/cli 0.1.21 (macOS 26.5, Node 24.14). I also read SKILL.md on main today: it still has no mention of scrolling, and the drag / mousewheel lines are unchanged. I did not run 0.1.22.
Activity