/dev10x-qa:playwrightfrom dev10x-qa
Runs Playwright Python scripts against ExampleCorp staging with CF Access headers, credential injection, syntax validation, and uv run wrapping. Use for browser automation on staging-app.example.com.
Ships in dev10x-qa. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill follows the core dev10x plugin's
references/task-orchestration.md patterns.
Create a task at invocation, mark completed when done:
REQUIRED: Create a task at invocation. Execute at startup:
TaskCreate(subject="Run Playwright script", activeForm="Running Playwright")Mark completed when done: TaskUpdate(taskId, status="completed")
Wraps uv run --with playwright python3 with:
python -m py_compile before any browser launches/work/example/app-e2e/settings.secrets.env and passed as env vars, never
hardcoded in scriptsScripts live in /tmp/Dev10x/playwright/qa-<ticket>-<description>.py. They must read
credentials from environment variables injected by the wrapper:
import os
CF_CLIENT_ID = os.environ["CF_CLIENT_ID"]
CF_SECRET = os.environ["CF_SECRET"]
STAGING_URL = os.environ["STAGING_URL"]
CRM_USERNAME = os.environ["CRM_USERNAME"]
CRM_PASSWORD = os.environ["CRM_PASSWORD"]
All five are set by the wrapper, so read them with os.environ[...] and
let a missing one fail loudly at import. A
os.environ.get("STAGING_URL", "<host>") default here is dead code
that reads as a working fallback — and while the wrapper's own
assignment was unconditional, that dead default was exactly what made
the resulting ERR_NAME_NOT_RESOLVED confusing to diagnose (GH-1130).
To point a run at a different deployment, set STAGING_URL in the
wrapper's environment; it now defers to a caller's value.
CF headers (all *.example.com requests):
def setup_cf_headers(page):
def add_cf_headers(route):
headers = route.request.all_headers()
headers["cf-access-client-id"] = CF_CLIENT_ID
headers["cf-access-client-secret"] = CF_SECRET
route.continue_(headers=headers)
page.route("**/*.example.com/**", add_cf_headers)
Viewport + video (always 1680x1050):
os.makedirs(VIDEO_DIR, exist_ok=True)
context = browser.new_context(
viewport={"width": 1680, "height": 1050},
record_video_dir=VIDEO_DIR,
record_video_size={"width": 1680, "height": 1050},
)
Flush video — close context before browser:
context.close() # flushes video
browser.close()
Login:
def login(page):
page.goto(f"{STAGING_URL}/login", wait_until="networkidle")
page.get_by_role("textbox", name="Username").fill(CRM_USERNAME)
page.get_by_label("Password", exact=True).fill(CRM_PASSWORD)
page.get_by_label("Remember Me").check()
page.get_by_role("button", name="Continue").click()
page.wait_for_url(re.compile(r"^(?!.*login)"), timeout=15000)
page.wait_for_load_state("networkidle")
GraphQL response capture:
def setup_response_capture(page):
def on_response(response):
if "/graphql" in response.url:
try:
body = response.json()
if "errors" in body:
print(f" [GraphQL ERROR] {json.dumps(body['errors'])[:500]}")
except Exception:
pass
page.on("response", on_response)
Wait for mutation before screenshot:
with page.expect_response(
lambda resp: "/graphql" in resp.url, timeout=15000
) as response_info:
save_btn.click()
Phone input (mui-phone-number quirk — always prepend 1 for US):
phone_input.click()
page.keyboard.press("Control+a")
page.keyboard.press("Backspace")
phone_input.type("16175551234", delay=50)
Button clicks — always scroll first:
btn.scroll_into_view_if_needed()
time.sleep(0.5)
btn.click()
For a recorded run, use Annotator.tap(btn, announce=..., then=...)
from lib/annotate.py instead — it scrolls the target to the centre of
the frame, asserts it is actually inside the viewport, points at it,
narrates, acts, and holds a beat, in the order a viewer needs. Every click on the recorded path goes
through it; a bare locator.click() cuts between two states with
nothing showing what was pressed.
See references/recording-for-humans.md.
Video pacing — add sleeps for reviewable playback:
time.sleep(1) # after form fills
time.sleep(2) # after result appears
The account map lives in the secrets file, not in this script (GH-1130). Accounts are keyed by an optional suffix shared between a username and a password key:
CRM_USERNAME=<standard-level> CRM_PASSWORD=… # the default profile
CRM_USERNAME2=<admin-level> CRM_PASSWORD2=… # --profile 2
CRM_USERNAME_QA=<a bot> CRM_PASSWORD_QA=… # --profile _QA
The suffixes are the contract; the usernames are yours. Which accounts exist, and at what permission level, is a property of your deployment — so this table names roles rather than accounts on purpose.
A third credential pair is two lines of config — no edit to the wrapper, and no fork (a fork loses the syntax validation and the no-hardcoded-credentials guarantee the wrapper exists to provide).
Select one either by name, which is resolved against the file:
${CLAUDE_PLUGIN_ROOT}/skills/playwright/scripts/run-playwright.sh \
/tmp/Dev10x/playwright/qa-xxx.py --user <admin-level-username>
or by suffix, which skips the lookup:
${CLAUDE_PLUGIN_ROOT}/skills/playwright/scripts/run-playwright.sh \
/tmp/Dev10x/playwright/qa-xxx.py --profile 2
--user with an unknown name lists what the secrets file does offer and
names the two keys to add. A secrets file carrying only CRM_PASSWORD
keeps working unsuffixed: the username falls back to $CRM_USERNAME,
then $PLAYWRIGHT_DEFAULT_USER, then the wrapper's legacy built-in
(e2e_test_user). That last one is a pre-GH-1130 default and matches
only the deployment it came from — set PLAYWRIGHT_DEFAULT_USER rather
than relying on it.
Which account a given feature needs — permission level, dealer scoping — is a property of the deployment, not of this plugin. Record it in the project's own notes alongside the secrets file.
${CLAUDE_PLUGIN_ROOT}/skills/playwright/scripts/run-playwright.sh \
/tmp/Dev10x/playwright/qa-xxx.py --validate-only
${CLAUDE_PLUGIN_ROOT}/skills/playwright/scripts/run-playwright.sh /tmp/Dev10x/playwright/qa-xxx.py
Pass the per-run knobs as flags, never as an environment prefix:
${CLAUDE_PLUGIN_ROOT}/skills/playwright/scripts/run-playwright.sh \
/tmp/Dev10x/playwright/qa-xxx.py \
--staging-url https://<preview-host> \
--secrets-file <path-to-settings.secrets.env> \
--tail 40
STAGING_URL=… run-playwright.sh … prompts for approval on every run
and cannot be silenced: an allow rule matches the command prefix, and
an env prefix moves the command away from the script path the rule
covers. | tail -40 extends it past the rule for the same reason —
--tail <n> prints the last n lines without a pipe, and still exits
non-zero when the run failed. STAGING_URL and PLAYWRIGHT_SECRETS_FILE
keep working for existing callers; a flag wins over them (GH-1263).
The wrapper:
/work/example/app-e2e/settings.secrets.envpython -m py_compileVIRTUAL_ENV="" uv run --with playwright python3 <script>Pin the version — an unbounded resolve picked up a release that refused to install a browser on a current Linux distro, reporting it as an OS problem rather than a resolver one (GH-1129):
uv run --with 'playwright>=1.47,<2' python3 -m playwright install chromium
PLAYWRIGHT_SPEC overrides the pin the wrapper runs scripts with.
| Symptom | Fix |
|---|---|
KeyError: CF_CLIENT_ID | Script uses hardcoded creds — replace with os.environ[...] |
net::ERR_NAME_NOT_RESOLVED on the first goto | The run is pointed at the placeholder host. Set STAGING_URL in the wrapper's environment — it defers to a caller's value (GH-1130) |
--user rejects an account that exists | Its CRM_USERNAME<suffix> / CRM_PASSWORD<suffix> pair is missing from the secrets file. The error names the two keys to add |
| Clicking Print hangs the run with no error | window.print() opens a browser modal that stops Playwright dead. Patch print in both realms — see references/print-capture.md |
| PII wandered into frame | Annotator(page, redact=[...]) — opaque masks that survive navigation. See references/redaction.md |
| Phone shows +61 | Prepend 1 for US country code |
| Button click doesn't register | scroll_into_view_if_needed() + time.sleep(0.5) |
| Screenshot misses snackbar | Screenshot immediately after wait_for_selector, not after sleep |
| Video 0 bytes | context.close() before browser.close() |
| Dialog closes, DB unchanged | Use page.expect_response() to confirm mutation fired |
VIRTUAL_ENV warning | Wrapper suppresses with VIRTUAL_ENV="" |
dev10x-qa:playwright
├── Called by: dev10x-qa:qa-self (Phase 3 execution)
├── Reads: /work/example/app-e2e/settings.secrets.env (credentials)
├── Scripts: run-playwright.sh (validate + inject + run)
└── Output: /tmp/Dev10x/playwright/ (screenshots, video)
lib/annotate.py (opens in a new tab)lib/narration.py (opens in a new tab)references/overlay-shapes.md (opens in a new tab)references/print-capture.md (opens in a new tab)references/recording-for-humans.md (opens in a new tab)references/redaction.md (opens in a new tab)scripts/run-playwright.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub dev10x-guru/dev10x-claude --plugin dev10x-qa6 skills in this plugin
/qa-publishdev10x-qa:qa-publishPublish a finished QA run to the ticket and the PR as a readable verdict with a watchable video and inline screenshots — instead of raw files left in a temp directory, a ticket comment that never reaches Jira watchers, or evidence that silently claims coverage the run never had. TRIGGER when: a QA run has produced screenshots and a screen recording and the results need to reach a ticket and a PR. DO NOT TRIGGER when: executing the QA test cases (use dev10x-qa:qa-self), analyzing a PR for QA needs (use dev10x-coding:qa-scope), or publishing a single video with no ticket write-up (use dev10x-qa:yt-upload directly).
/qa-selfdev10x-qa:qa-selfExecute QA test cases on staging using headless Playwright, capture screenshot and video evidence, upload to Linear, and post structured results. TRIGGER when: QA ticket has test cases to execute against staging and evidence is needed. DO NOT TRIGGER when: analyzing PR for QA needs (use dev10x-coding:qa-scope), or running unit/integration tests (use test skill).
/review-packdev10x-qa:review-packBuild the review pack a human reviewer opens before the diff — the change shown in screenshots, video or before/after API evidence, a 60-second test recipe, what is already verified, and the open judgment calls — so a reviewer understands, sees and can test the change without checking out the branch. TRIGGER when: requesting human review, flipping a PR out of draft, or asked to make a change "easy to review". DO NOT TRIGGER when: capturing a QA run (use dev10x-qa:qa-self), publishing a QA verdict to a ticket (use dev10x-qa:qa-publish), or assigning reviewers and notifying chat (use dev10x-coding:request-review).
/ttsdev10x-qa:ttsSynthesize narration audio from text with a local voice — Kokoro for English, Piper for Polish and everything else — and lay rendered lines onto a timeline as a single voice-over track for muxing over a screen recording. TRIGGER when: narration or voice-over audio is needed for a walkthrough recording, or a dev10x-qa:qa-self capture should be narrated. DO NOT TRIGGER when: capturing the recording itself (use dev10x-qa:qa-self), or converting/verifying evidence files (use qa-self's own scripts).
/yt-uploaddev10x-qa:yt-uploadPublish a recording to YouTube as unlisted and hand back the embed form each destination can actually use — a bare watch URL for Linear (the only thing its editor will turn into a player) and a clickable poster frame for GitHub (which strips iframes). TRIGGER when: a video file needs to become a shareable link — a QA walkthrough, a demo recording, a bug repro. DO NOT TRIGGER when: capturing the recording (use dev10x-qa:qa-self), converting or verifying evidence files (use qa-self's own scripts), or publishing a full QA evidence set to a ticket and PR (use dev10x-qa:qa-publish, which calls this skill).