agentleFS
nora-weissernora-weisser/ai-assisted-testing-demo/.claude/skills/implement-test-case/SKILL.md

implement-test-case

Skill2 starsChanged 25 days agoMITView on GitHub

Implement a test case from docs/test-plan.md by its ID (e.g. TC-S06), exploring the real UI with playwright-cli before writing any test code. Use whenever a case ID from the test plan is to be automated, or a new spec is added to tests/specs.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the playwright-cli skill to drive the running app (npm run app:up) through whatever this case actually does, and read the emitted …

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Implementing a test case from the plan

Given a case ID such as TC-S06, produce the spec that automates it — and nothing more than it.

1. Read before writing

  • docs/test-plan.md — the case's own line: what it does and what it asserts. Do not widen the case beyond it.
  • AGENTS.md — the MUST/SHOULD/WON'T rules and "How the app behaves". They are binding, not advisory.
  • docs/app.md §2 (screens) and §6 (behavioural decisions) — behaviour the test must match rather than guess at.
  • tests/specs/*.spec.ts and tests/pages/*.ts — match the shape of what is already there.

2. Explore the real UI — before writing any test code

Use the playwright-cli skill to drive the running app (npm run app:up) through whatever this case actually does, and read the emitted snapshot at each step.

The point is to replace assumptions with observations. Never infer from the docs alone:

  • the role and accessible name of any control the test touches;
  • the exact text of anything the test asserts on;
  • what actually changes after each step — what appears, what disappears, what the URL does, which requests fire.

Front Row specifics while exploring:

  • The browser session is its own customer (fr_uid cookie). Data seeded with curl belongs to a different customer, so create holds and favourites in the browser.
  • Seats are shared with the test suite. Explore on row F, which parallel test workers don't use.

Close the browser when done. The .playwright-cli/ snapshots are gitignored — leave no exploratory files behind.

3. Implement

  • Spec under tests/specs/, title <TC-ID>: what is exercised, exactly two tags: one level tag (@e2e or @api) plus @smoke.
  • Book seats through the seats fixture. Seed and check preconditions through the api fixture — it is the same customer as the page.
  • Reach elements through the page objects. If the case needs a control they lack, add it there — locators and actions only, no assertions, and nothing the specs do not use.
  • Locators: getByRole → getByLabel → getByPlaceholder → getByText, stopping at the first that works. No getByTestId, no CSS, no XPath, no .nth().
  • Web-first assertions only. Respect the timing in "How the app behaves":
    • optimistic UI isn't proof the server stored anything — wait for the write's response before a reload or an API check;
    • 202 means not done yet — expect.poll until the state you assert on;
    • timers run on the browser clock — use page.clock, never wait in real time.
  • End on an assertion, not a bare action — a trailing click can leave its request in flight when the test finishes.

4. Verify — then report

cd tests && npm run typecheck && npx playwright test specs/<file>.spec.ts --repeat-each=20

Both must pass, 20 of 20. Report the actual pass count; never claim a green run you did not see. If the case cannot be written cleanly because of an app-side problem — a missing accessible name, an ambiguous role — say so and stop. app/ is read-only.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.