Playwright Test Prompt
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
Login, token refresh, and everything that must fail: expired tokens, wrong permissions, malicious credentials — auth tested as behavior.
Auth code is tested backwards everywhere: the login-works test exists, the seventeen ways auth must FAIL don't. This setup generates the auth test suite with security as a first-class coverage area: authentication failures (missing, expired, malformed credentials — each its own test), permission boundaries returning the right 403s, malicious input through every credential field, and access to other users' resources by ID rejected — alongside the API failure scenarios: 401 vs 403 distinguished, idempotent refresh behavior, and error shapes that don't leak what exists.
Count the failure tests
A healthy auth suite has more failure tests than success tests — the contract is built to produce that ratio.
Test expiry as a moment
The token that expires BETWEEN two requests is the scenario that separates tested auth from lucky auth.
Verify the cross-user wall
Authenticated-but-wrong-user requests against every resource type — the test that catches IDOR before users do.
The Security and Failure Scenarios areas make failures first-class: missing, expired, and malformed credentials each get their own test, permission boundaries return 403 for the wrong roles, and access to other users' resources by ID is rejected. Test Case Prompt Generator produces the prompt; you run it in your own assistant, and it generates tests only, never modifying the implementation.
Yes, as separate tests. The TEST STRATEGY treats auth as behavior: 401 for missing or expired credentials, 403 for valid-but-forbidden, and they are different tests. The Failure Scenarios also require nonexistent resources to return 404, not 500 or an empty 200, and every response asserts status code, body shape, and the headers that matter.
No. The notFor is explicit: reviewing auth code for vulnerabilities is the Code Review Prompt Generator's job, and pen-testing probes undiscovered attack surface. These tests verify specified behavior, so they close the ASSUMPTIONS and GAPS the prompt lists but don't guarantee your auth is secure; review finds, tests verify, and both stay under human review.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
Mock the dependencies, test the business logic, one behavior per test — the unit testing contract that bans plumbing tests.
Test the two failure directions — does the agent refuse what it must, and does it stay helpful on the benign requests it shouldn't over-refuse?
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Build test generation prompts — unit, integration, or E2E — with framework modes and edge-case coverage rules.
Review code for what an attacker would do, not just what tests catch — anchor the model as a security engineer, run a threat-focused review, then back the findings with auth and input tests.
Four hundred lines of login code and a yes-or-no. You can read every line, find nothing, and still be wrong — because what will hurt you is in the file nobody opened alongside it: a session that outlives a logout, a reset that leaves the old one working.