playwriter
Browser automation via Playwriter (remorses) using persistent Chrome sessions and the full Playwright Page API.
- License 许可
- MIT
- 最近更新
- 2026-09-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- hats
- [ "developer", "qa_tester" ]
- name
- playwriter
- metadata
- { "internal": true }
- description
- Browser automation via Playwriter (remorses) using persistent Chrome sessions and the full Playwright Page API.
03 SKILL.md 正文
Playwriter
Overview
Use Playwriter to run Playwright Page scripts against your local Chrome session. This preserves logins, cookies, and extensions, which is ideal for web dashboard testing and authenticated flows.
When to Use
- Validating the Ralph web dashboard UI
- Navigating authenticated pages without re-logging in
- Testing flows that require browser extensions or saved state
- Capturing accessibility snapshots for element discovery
Prerequisites
- Install the CLI:
npm i -g playwriter - Install the Playwriter Chrome extension (see the Playwriter repo instructions)
- Ensure Chrome is running and the extension is enabled
Core Workflow
- Create a session:
playwriter session new - List sessions and copy the session id:
playwriter session list - Execute Playwright code against that session:
playwriter -s <session_id> -e "await page.goto('https://example.com')"
Execution Environment
Within -e, these are available in scope:
page(Playwright Page)context(BrowserContext)state(persistent object across calls in the same session)require(for loading helper modules)
Example state persistence:
playwriter -s <session_id> -e "state.lastUrl = page.url()"
playwriter -s <session_id> -e "console.log(state.lastUrl)"
Common Patterns
Navigate + click
playwriter -s <session_id> -e "await page.goto('http://localhost:3000'); await page.getByRole('button', { name: 'Run' }).click();"
Fill forms
playwriter -s <session_id> -e "await page.getByLabel('Email').fill('qa@example.com'); await page.getByLabel('Password').fill('secret'); await page.getByRole('button', { name: 'Sign in' }).click();"
Accessibility snapshots (labeled)
playwriter -s <session_id> -e "const { screenshotWithAccessibilityLabels } = require('playwriter'); await screenshotWithAccessibilityLabels(page, { path: '/tmp/a11y.png' });"
Network interception
playwriter -s <session_id> -e "await page.route('**/api/**', async route => { const res = await route.fetch(); const body = await res.json(); await route.fulfill({ json: { ...body, injected: true } }); });"
Read page content
playwriter -s <session_id> -e "const text = await page.locator('main').innerText(); console.log(text);"
Tips
- Prefer
getByRoleandgetByLabelfor stable selectors. - Use accessibility snapshots to discover reliable roles and labels.
- Keep sessions focused: reset or close them if state becomes messy.
- For multi-step flows, store intermediate data on
state.
04 同仓库更多 Skills
ralph-loop
Run, monitor, resume, merge, and debug Ralph loops. Use this skill whenever the user asks to operate `ralph run` or `ralph loops`, inspect loop state, recover suspended loops, analyze diagnostics, or unblock merge queue issues.
ralph-hats
Create, inspect, validate, explain, and improve Ralph hat collections. Use this skill whenever the user asks to make or refine a `.ralph/hats/*.yml` workflow, debug hat routing, explain event topology, or tune a multi-hat Ralph run.
ralph-docs
Introspect, explain, and improve ralph-jev using the documentation shipped in its repository. Use this skill whenever the user asks questions about Ralph's behavior, wants to understand how a Ralph internal works (event loop, completion gate, judge evidence, Jev hooks, parallel loops, configuration), debug an unfamiliar failure mode, or propose a code change to the ralph-jev repo. The skill teaches the agent to answer from the repo's docs and source before guessing, and to scope improvements through the documented architecture rather than the local checkout alone.
complex-test-skill
A directory-style test skill for smoke testing
tui-validate
Validates Terminal User Interface (TUI) output using freeze for screenshot capture and LLM-as-judge for semantic validation. Supports both visual (PNG/SVG) and text-based validation modes.
tui-debug-in-pane
Use when you need to reproduce or debug TUI rendering issues (garbled output, broken streaming, layout corruption) by running ralph in a tmux split pane and capturing live output.