Expected: Drag-and-drop is performed between the two elements.
[
{
"expected": "string",
"code": "invalid_type",
"path": ["startElement"],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": ["endElement"],
"message": "Invalid input: expected string, received undefined"
}
]
The CLI daemon's drag command (playwright-core/lib/tools/cli-daemon/commands.js) converts positional args into startRef/endRef but never passes startElement/endElement to the MCP tool
Version
1.60.0
Steps to reproduce
playwright-cli open https://demo.playwright.dev/todomvc/ -> any page which has drag and drop functionality
playwright-cli drag e5 e10
Expected behavior
Expected: Drag-and-drop is performed between the two elements.
Actual behavior
Zod validation error:
Additional context
Root Cause:
The CLI daemon's drag command (playwright-core/lib/tools/cli-daemon/commands.js) converts positional args into startRef/endRef but never passes startElement/endElement to the MCP tool
Environment
System Software Overview: System Version: macOS 26.4 (25E246) Kernel Version: Darwin 25.4.0 Boot Volume: Macintosh HD Boot Mode: Normal Hardware: Model Name: MacBook Pro