Skip to content

[CLI]: SKILL.md never mentions scrolling; document mousewheel as the scroll command and drag selector support #42989

Closed

Description

@jinhuang712

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.md or references/ (grep -rni scroll finds nothing). The only related line is playwright-cli mousewheel 0 100 under "Mouse", with no explanation.
  • The arguments (<dx> <dy>, wheel deltas) are only explained by playwright-cli mousewheel --help.
  • The wheel event goes to the element under the pointer. With the pointer over a nested overflow: auto box, mousewheel 0 100 scrolled the box (scrollTop 100) and left the page at 0. The skill doesn't say to mousemove first.
  • The only example is a positive delta. Scrolling up is undocumented (mousewheel 0 -100 works 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 --help says the targets can be "exact source element reference from the page snapshot, or a unique element selector", and drag "#card" "#zone" works, but the skill never says selectors are accepted.
  • drag runs locator.dragTo(). It fired a real HTML5 drop event on my test page. The skill doesn't mention that pointer-event based drags can be done with mousemove / mousedown / mousemove / mouseup (I verified that sequence moves a pointerdown/pointermove draggable). I did not test whether drag alone 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions