write-playwright-test

write-playwright-test is a command for coding agents from DIGI-UW/OpenELIS-Global-2. It costs 0 tokens per session (605 once invoked), scanned A, original, MPL-2.0.

A command for writing new Playwright end-to-end tests, which operate a web browser to check a complete user flow. It starts from the feature requirements and the application's source code.

In plain words
What is it for?
Use it to create or target a test file, choose the appropriate test project, inspect components and helpers, reuse the test template, and write checks for visible behavior.
Why use it?
It reduces errors caused by writing tests before understanding the page or using unstable selectors. It also helps place the test in the correct project and follow the repository's test conventions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/digi-uw/openelis-global-2/write-playwright-test
Clone the repo
git clone --depth 1 https://github.com/DIGI-UW/OpenELIS-Global-2

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-playwright-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/digi-uw/openelis-global-2/write-playwright-test.svg)](https://agentmods.dev/commands/digi-uw/openelis-global-2/write-playwright-test)
Your own site
<a href="https://agentmods.dev/commands/digi-uw/openelis-global-2/write-playwright-test"><img src="https://agentmods.dev/badge/commands/digi-uw/openelis-global-2/write-playwright-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00605
Opus 5 $0.00000 $0.00302
Sonnet 5 $0.00000 $0.00121
Haiku 4.5 $0.00000 $0.00060

Measured 5d ago against content hash 05dd4fdad11c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-playwright-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.ai/skills/playwright/commands/write-playwright-test.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write Playwright Test

Use this command to author new Playwright tests using a source-first, first-time-correct workflow.

User Input

$ARGUMENTS

Interpret input best-effort:

  • /write-playwright-test - scaffold a new Playwright test from requirements
  • /write-playwright-test <spec-file> - target/create a specific spec file
  • /write-playwright-test <spec-file> --project <name> - force target project

Workflow

  1. Preflight (TDD Red phase)

    • Confirm target user story / acceptance criteria.
    • Identify feature route and expected user-visible behavior.
    • Decide project target: core-app, core-demo, harness, harness-demo, or the matching *-demo-video for recording.
  2. Read source before writing selectors

    • Read relevant component source for the page under test.
    • Read existing Playwright fixture/helper patterns to reuse.
    • If selectors are unstable, add/plan data-testid support first.
  3. Write from template

    • Start from .ai/skills/playwright/templates/PlaywrightE2E.spec.ts.template.
    • Keep testInfo and videoPause() conventions.
    • Prefer getByRole / getByLabel / data-testid selectors.
    • Add debug-context capture hooks for fragile or async-heavy workflows.
    • NEVER use response.ok() as assertion — use waitForResponse for sync only, then assert on visible UI
    • For Carbon checkboxes/radios, click the <label> (NEVER { force: true })
    • For autocomplete fields, wait for suggestion dropdown and click (do NOT just type + Tab)
    • Use test.step() for multi-step workflows
    • Call isVisible() directly — never add .catch(() => false)
  4. Register spec in Playwright config

    • Add new spec to the correct testMatch project list in frontend/playwright.config.ts.
    • For demo workflow tests, update CORE_DEMO_TESTS or HARNESS_DEMO_TESTS.
  5. Validate and run narrow scope

    • Validate registration: python3 .ai/skills/playwright/scripts/validate-playwright-project.py <spec>
    • Run the narrowest command: cd frontend && npm run pw:test -- <spec> --project=<project>

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 71 lines · 0 tokens per session scan A 05dd4fdad11c

Subscribe to this mod's changes

write-playwright-test is a command published in the GitHub repository DIGI-UW/OpenELIS-Global-2 (251 stars, last pushed today), licensed MPL-2.0. It costs nothing until one of its globs matches a file; then it loads 605 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.