playwright-driver
Use this skill when executing web tests via the canonical `playwright` npm package (Microsoft, Apache-2.0). Dispatched by `skills/test-runner/` to execute web…
от Kanevry★ 53 звезды на GitHub
Установить playwright-driver в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Playwright Driver Skill
Soul
Before anything else, read and internalize soul.md in this skill directory. It defines WHO you are — a thin executor, not an orchestrator. Every action in this session should reflect that identity.
Phase 0: Bootstrap Gate
Read skills/_shared/bootstrap-gate.md and execute the gate check. If GATE_CLOSED, invoke skills/bootstrap/SKILL.md and wait for completion. If GATE_OPEN, continue.
Package Note — PRD Correction (Read This First)
The PRD originally referenced @playwright/cli — that wording is WRONG. Do not use it.
| Package | Version (2026-05-14) | Status |
|---|---|---|
playwright |
1.60.0 | Canonical — use this |
@playwright/test |
1.60.0 | Test framework (same release train) |
@playwright/cli |
0.1.13 | Unrelated, unstable — DO NOT USE |
@playwright/mcp |
0.0.75 | MCP adapter — R5 hard-gate blocks this |
Verified via npm view playwright version → 1.60.0 (2026-05-14 probe). The binary the orchestrator dispatches is named playwright (not playwright-cli), and it is deliberately the TARGET repo's own @playwright/test dependency — the driver never relies on a globally installed binary, so scripts/lib/playwright-driver/runner.mjs aborts with exit 2 when the target cannot resolve Playwright locally rather than letting npx download it mid-run. Use playwright@^1.60.0 for compatible-minor updates or pin to [email protected] for reproducibility.
Install
Install into the TARGET repo — that is the only install this driver uses, in CI and locally alike:
npm install --save-dev @playwright/[email protected]
npx playwright install chromium # download browser binaries
Both commands run in the target repo, so npx resolves the local binary. A global install is neither used nor sufficient: the driver's preflight requires @playwright/test (or playwright) under the target's own node_modules.
Canonical Usage
The orchestrator (skills/test-runner/) dispatches this driver via Bash. Session naming follows the artifact-paths contract:
RUN_ID="${pid}-${ms_timestamp}" # from scripts/lib/test-runner/artifact-paths.mjs:makeRunId()
RUN_DIR=".orchestrator/metrics/test-runs/${RUN_ID}"
# Output paths via env vars (Playwright canonical):
# PLAYWRIGHT_HTML_OUTPUT_DIR=${RUN_DIR}/report
# PLAYWRIGHT_JSON_OUTPUT_FILE=${RUN_DIR}/results.json
# PLAYWRIGHT_HTML_OPEN=never
PLAYWRIGHT_HTML_OUTPUT_DIR="${RUN_DIR}/report" \
PLAYWRIGHT_JSON_OUTPUT_FILE="${RUN_DIR}/results.json" \
PLAYWRIGHT_HTML_OPEN=never \
playwright test \
--output "${RUN_DIR}/test-results" \
--reporter html,json \
--trace on \
--project chromium
Canonical: see https://playwright.dev/docs/test-reporters — reporter names are comma-separated; paths flow via env vars. See
scripts/lib/playwright-driver/runner.mjsfor the canonical invocation.
The orchestrator provides RUN_ID and RUN_DIR via environment variables, plus the resolved navigation URL TARGET_URL and expected pages for the selected scope in driver context. The driver executes Playwright and ensures the per-page capture contract below before handing artifacts to the evaluator. --target still names the target repository; it is not the navigation URL.
Artifact Layout
All artifacts land under ${RUN_DIR}/. Structure:
.orchestrator/metrics/test-runs/<run-id>/
results.json # Playwright JSON reporter output — orchestrator parses this
report/
index.html # HTML report (served via `playwright show-report ${RUN_DIR}/report`)
test-results/
<test-name>/
trace.zip # Playwright trace bundle (open via `playwright show-trace`)
screenshots/ # pre-created by runner.mjs; content written by test fixtures
<page-slug>-w1440.png # desktop screenshot
<page-slug>-w390.png # mobile screenshot; additional per-step captures may coexist
ax-snapshots/ # pre-created by runner.mjs; content written by test fixtures
<page-slug>-w1440.yaml # desktop aria snapshot
<page-slug>-w390.yaml # mobile aria snapshot
axe-<route-slug>-<timestamp>.json # axe-core JSON output (written by test fixture using @axe-core/playwright, NOT by driver)
console.log # NDJSON console output (written by test fixture via page.on('console', ...), NOT by driver)
Division of responsibility:
- runner.mjs (driver): spawns
playwright test, sets reporter env vars (PLAYWRIGHT_HTML_OUTPUT_DIR,PLAYWRIGHT_JSON_OUTPUT_FILE,
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- soul.md
FAQ
Что делает скилл playwright-driver?
Use this skill when executing web tests via the canonical `playwright` npm package (Microsoft, Apache-2.0). Dispatched by `skills/test-runner/` to execute web tests against a target, captures token-frugal AX-tree snapshots + screenshots + console output under `.orchestrator/metrics/test-runs/<run-id>/`, and exits with deterministic JSON output the orchestrator can parse.
Как установить скилл playwright-driver?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл playwright-driver запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…