Playwright Test Prompt
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
Turn real interactions into a labeled eval set — sample for coverage, label each with the expected behavior, and balance the set so the score means something.
The best evaluation set comes from real usage, but raw logs aren't a dataset — they're unlabeled, unbalanced, and full of duplicates. This prompt builds an eval dataset from real interactions: sampling for coverage across intents and difficulty, labeling each with the expected/correct behavior, deduping near-identical cases, and balancing so common cases don't drown out the rare-but-critical ones.
Assemble the raw interactions
Gather real usage logs across the range of intents and difficulty. The builder turns them into a labeled set, but it needs coverage to sample from.
Open this resource in Test Case Prompt Generator
Load the prompt into Test Case Prompt Generator and paste in the interactions. It samples for coverage, labels each with the expected behavior, and dedupes near-identical cases.
Review the labeled, balanced set
Check the sampled cases, their expected-behavior labels, and the balance so common cases do not drown out the rare-but-critical ones.
Refine the set and re-sample
Adjust the labels or coverage where the set is thin or skewed, then regenerate so the score it produces actually means something.
The gold labels are the expected/correct behavior, not the agent's current output: a rule states this outright, so you grade the agent against the set rather than against itself. Each selected case gets a label specific enough to grade against, output as input + gold label + category. The test-case-prompt-generator builds the prompt; you paste real logs, run it in your assistant, and review the labels.
Two of its six steps handle that: SAMPLE FOR COVERAGE selects across every category and difficulty tier (easy/typical/hard/edge), noting which are thin, and BALANCE flags when common cases vastly outnumber rare-but-critical ones and recommends a target mix. A HOLD-OUT NOTE reserves cases from the iteration set. Coverage over volume is the governing rule. The generator produces the prompt; you re-sample where the set is skewed.
It builds a dataset from real interaction logs you paste, sampling and labeling existing usage; it doesn't invent cases from scratch. The notFor routes synthetic scenario generation to the Agent Test Scenario Prompt and scoring the finished set to the Agent Evaluation Scorecard. Without raw interactions there's nothing to sample for coverage. The test-case-prompt-generator produces the labeling prompt; supplying the logs is on you.
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.
Turn an agent's instructions, allowed tools and business rules into scenarios you can actually run — a fixed situation, an expected behavior you can observe, and a pass or fail that two people would agree on.