docker-playwright
Installation
SKILL.md
Run Playwright tests for the current project inside a shared Docker container.
Constants (edit these if your setup differs)
CONTAINER=pw— container nameIMAGE=mcr.microsoft.com/playwright:v1.59.1-noble— must match the project's@playwright/testversion (browser binaries are baked into the image)HOST_ROOT=$HOME/gitsmounted atMOUNT=/work— the host→container path mapping
Arguments
Everything passed after the skill name is forwarded verbatim to playwright test
(e.g. tests/smoke.spec.ts --grep @smoke --project chromium). A bare invocation runs the full suite.
Gotchas
- Never use
docker exec -it— the-itflags fail with "cannot attach stdin to a TTY-enabled container" when not run from a real terminal (scripts, CI, this agent). Use plaindocker exec. - Headed runs (
--headed/--ui/--debug) need a display the container lacks. If the user wants headed, tell them to prefix withxvfb-run:xvfb-run npx playwright test --headed. Note--ui/--debugalso need VNC/X-forwarding to actually view — impractical without extra setup. Default runs are headless.