From 7c0d1fe56bcb6cf9883f5f5c279b68c1e6813ac0 Mon Sep 17 00:00:00 2001 From: Backend Developer 1 Date: Fri, 10 Jul 2026 05:34:14 +0000 Subject: [PATCH] [3e552255] feat(docker): re-add Playwright chromium-headless-shell to QA images --- agents/prompts/identities/fe-qa.md | 16 ++++++++++++++++ agents/prompts/identities/ux-qa.md | 16 ++++++++++++++++ docker/agent-qa-fe.Dockerfile | 11 +++++++++++ docker/agent-ux.Dockerfile | 16 ++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/agents/prompts/identities/fe-qa.md b/agents/prompts/identities/fe-qa.md index 2b2964d2..dd2e00c8 100644 --- a/agents/prompts/identities/fe-qa.md +++ b/agents/prompts/identities/fe-qa.md @@ -10,3 +10,19 @@ reports_to: fe-pm ``` You are the QA agent for the Frontend Cell. + +## Browser verification (Playwright) + +This image ships Playwright with `chromium-headless-shell` pre-installed (`docker/agent-qa-fe.Dockerfile`) — no install step needed. Reach for it when an acceptance criterion needs an actual rendered check (computed styles, an a11y tree, a DOM assertion after JS runs) that reading the diff can't confirm — reading the diff stays your default; this is for the cases it can't settle. Launch it headless via `Bash`: + + /app/.venv/bin/python -c " + from playwright.sync_api import sync_playwright + with sync_playwright() as p: + browser = p.chromium.launch() + page = browser.new_page() + page.goto('http://localhost:3000/some-route') + print(page.accessibility.snapshot()) + browser.close() + " + +Only `chromium-headless-shell` is installed (no firefox/webkit) — `p.chromium` is the only browser type available, and `p.chromium.launch()` uses it automatically in headless mode. This is a manual verification aid, not an MCP tool or a substitute for `evidence(task_id)`; note what you checked (`note(scope='learning', ...)`) same as any other review evidence. diff --git a/agents/prompts/identities/ux-qa.md b/agents/prompts/identities/ux-qa.md index 86d1c271..b9f016ec 100644 --- a/agents/prompts/identities/ux-qa.md +++ b/agents/prompts/identities/ux-qa.md @@ -10,3 +10,19 @@ reports_to: ux-pm ``` You are the QA agent for the UX/UI Cell. + +## Browser verification (Playwright) + +This image ships Playwright with `chromium-headless-shell` pre-installed (`docker/agent-ux.Dockerfile` — the same image ux-dev runs, per orchestrator's IMAGE_MAP; no install step needed). Reach for it when a design/rendering acceptance criterion needs an actual rendered check (layout, computed styles, a screenshot for visual review) that reading the diff can't confirm — reading the diff stays your default; this is for the cases it can't settle. Launch it headless via `Bash`: + + /app/.venv/bin/python -c " + from playwright.sync_api import sync_playwright + with sync_playwright() as p: + browser = p.chromium.launch() + page = browser.new_page(viewport={'width': 1280, 'height': 800}) + page.goto('http://localhost:3000/some-route') + page.screenshot(path='/tmp/review.png') + browser.close() + " + +Only `chromium-headless-shell` is installed (no firefox/webkit) — `p.chromium` is the only browser type available, and `p.chromium.launch()` uses it automatically in headless mode. This is a manual verification aid, not an MCP tool or a substitute for `evidence(task_id)`; note what you checked (`note(scope='learning', ...)`) same as any other review evidence. diff --git a/docker/agent-qa-fe.Dockerfile b/docker/agent-qa-fe.Dockerfile index 6d0da2de..02e6c03e 100644 --- a/docker/agent-qa-fe.Dockerfile +++ b/docker/agent-qa-fe.Dockerfile @@ -7,6 +7,17 @@ USER root RUN npm install -g pnpm +# Playwright + chromium-headless-shell (not full chromium) for FE QA's +# browser-based rendering/a11y checks — scoped to this image so agent-dev-fe +# stays lean. Browsers land in /app/.playwright (not /app/.venv) so the +# closing chown only touches this new ~small dir, never the pre-owned .venv +# tree (a chown -R over .venv would COW-duplicate the whole thing into this +# layer — see the 0.19.0 lean-images CHANGELOG note on agent-grok's chown -R). +ENV PLAYWRIGHT_BROWSERS_PATH=/app/.playwright +RUN uv pip install --python /app/.venv/bin/python playwright \ + && /app/.venv/bin/playwright install --with-deps chromium-headless-shell \ + && chown -R agent:agent /app/.playwright + USER agent LABEL role="frontend-qa" diff --git a/docker/agent-ux.Dockerfile b/docker/agent-ux.Dockerfile index 772e5787..67044bc4 100644 --- a/docker/agent-ux.Dockerfile +++ b/docker/agent-ux.Dockerfile @@ -8,5 +8,21 @@ FROM roboco-agent-base # - Image generation tools # - Design token management +USER root + +# Playwright + chromium-headless-shell for UX-QA's browser-based design/ +# rendering verification. No dedicated ux-qa image exists — ux-qa runs this +# same image as ux-dev (see orchestrator.py IMAGE_MAP), so ux-dev picks this +# up too. Browsers land in /app/.playwright (not /app/.venv) so the closing +# chown only touches this new dir, never the pre-owned .venv tree (a +# chown -R over .venv would COW-duplicate the whole thing into this layer — +# see the 0.19.0 lean-images CHANGELOG note on agent-grok's chown -R). +ENV PLAYWRIGHT_BROWSERS_PATH=/app/.playwright +RUN uv pip install --python /app/.venv/bin/python playwright \ + && /app/.venv/bin/playwright install --with-deps chromium-headless-shell \ + && chown -R agent:agent /app/.playwright + +USER agent + LABEL role="ux-designer" LABEL description="UX/UI agent - design, prototyping, design system"