Repository navigation
Replies: 2 comments
|
This is the only thing stopping me from ditching playwright-cli for my agentic qa workflows and agentic demo video creation workflows. I'd love this feature |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
Playwright 1.59 (Nov 2025) shipped a set of primitives explicitly aimed at AI-driven / agentic workflows. A few of them overlap with existing agent-browser features, but most are still missing. This umbrella issue catalogs the gaps and proposes a direction. I'm happy to break it into separate tickets if preferred.
Reference: Playwright 1.59 release notes and community write-ups.
Status matrix (against agent-browser 0.26.0)
page.screencastAPI (start/stop,showActions,showChapter,onFrame, HTML overlays)record start/stop(WebM, no annotations) +stream enable(runtime WS) + PR #1224 addsscreencast <duration_ms> --gifbrowser.bind({ name, workspaceDir })— one running browser exposed to multiple clients simultaneously (CLI, MCP, API consumers)--auto-connect/--cdp <port>can attach to a pre-existing Chrome;--session <name>sessions are isolatedplaywright-mcpandagent-browserCLI and the dashboard all attached to the same logical session by nameplaywright-cli show,PLAYWRIGHT_DASHBOARD=1)agent-browser dashboard start(embedded since 0.25.1)npx playwright test --debug=cli,attach <id>,step-over,step-into)inspectopens Chrome DevTools GUI;get cdp-urlexposes the WS URL for external debuggersnpx playwright traceto explore traces without the GUI)trace start/stopandprofiler start/stopcapture Chrome tracing JSONchrome://tracingor Perfetto GUIProposed gaps to close
1. Annotated screencast (builds on PR #1224)
The WIP in #1224 adds raw CDP screencast + GIF. To reach parity with Playwright 1.59 the API needs:
screencast start [--path x.webm] [--actions top-right] [--size WxH] [--chapter-overlay]screencast showActions [on|off]— highlight each interacted element as actions landscreencast showChapter <title> [--description ...] [--duration ms]— burned-in overlay, also recorded in stream metadatascreencast showOverlay <html>/screencast hideOverlay— arbitrary HTML chrome for 'agentic receipts'onFrameequivalent: continuous JPEG frame stream to stdout / WS, so a vision model can subscribe (different intent fromrecord— this is for live validation, not archival)screencast stopThese map cleanly onto CDP
Page.startScreencast/screencastFrameplus a small DOM overlay layer, so no new deps should be needed beyond what #1224 already pulls in.2. Named browser bind / multi-client attach
Today, two clients pointed at the same session either step on each other (daemon socket races) or have to go through
--cdp <port>. Playwright 1.59'sbrowser.bind('my-session', { workspaceDir })exposes a stable, named endpoint over WS that multiple clients can open simultaneously.Concretely:
agent-browser bind <name> [--host 127.0.0.1] [--port 0] [--workspace-dir .]returns a stable WS endpoint and prints it as JSONagent-browser attach <name>/--endpoint <url>for additional clients (CLI, MCP, custom API users) joining the same sessionUse case: an AI agent runs a long flow; a developer attaches from another terminal to snapshot / screenshot / intervene without killing the agent's browser.
3. CLI debugger for agents (
--debug=cliequivalent)inspectis GUI-only, which works for humans but not for a headless AI loop. Playwright's--debug=clipauses a test and exposesstep-over/step-into/continue/resumeoverplaywright-cli. An agent-browser analogue:agent-browser debug start— pauses command dispatch, returns a session idagent-browser debug step/step-into/continue/break <selector>batchso an agent can step through a scripted flowdiff snapshotafter each step for 'what changed' reasoning4. CLI trace viewer / summarizer
trace start/stopalready produces Chrome Trace Event JSON. What's missing is a way for an agent to actually read that trace without a GUI:agent-browser trace show <path>— structured JSON or text summary: timeline of actions, network requests, console events, frame timingsagent-browser trace query <path> --filter 'category:network status:>=400'— filter/select from CLIagent-browser trace diff <a.json> <b.json>— what changed between two runs (composes with the existingdiff snapshot/diff screenshotcommands)Priority suggestion
Going from highest leverage down:
inspect+ logs)Related existing issues / PRs
All reactions