Junior QA (subagents)
The per-page subagent that explores, models, tests, and reports.
Junior QA is the workhorse. One instance per page. Implemented as the prd-e2e-orchestrator skill at skills/prd-e2e-orchestrator/.
Each Junior QA:
- Explores the page until no new elements are discovered (saturation)
- Builds a Derived UI Model: fields, actions, validations, conditionals, API calls
- Asks for approval: presents a TL;DR summary for human-in-the-loop kickoff
- Generates Playwright tests: 20+ tests per page across 19 categories
- Runs tests: executes Playwright, classifies failures
- Retries intelligently: each failure gets a classified fix ladder
- Reports: per-page compliance or behavioural report
The phases
| Phase | What it does |
|---|---|
| 0 | Parse inputs (PRD or URL list) |
| 1 | Generate static contracts (PRD mode only; skipped in URL-list mode) |
| 2 | Explore the page multiple passes, broad → deep → adversarial |
| 3 | Synthesize the Derived UI Model from exploration evidence |
| 3.5 | Present Page Understanding to the user for approval |
| 4 | Generate Playwright tests from the model |
| 5 | Execute tests, classify failures, retry with escalating fixes |
| 6 | Produce compliance / behavioural report |
Test categories (V1)
Junior QA generates tests across these categories, per page:
- Page structure, all elements present
- Full submission
- Required-only submission
- Empty submission
- Per-field required enforcement
- Per-field validation rules
- Dropdown options
- Checkbox / toggle lifecycle
- Conditional activation
- Conditional deactivation
- State round-trip
- Double-toggle consistency
- Terminal action guard (exists, never clicked)
- Navigation
- UI ambiguity assertion
- Data persistence (reload survives)
- Conditional element discovery
- Negative reachability (bad actions can’t reach success)
- API validation (fetch/XHR status codes)
Plus wizard flow tests when the page is part of a multi-step wizard.
The retry system
When a test fails, Junior QA classifies it:
| Category | Fix |
|---|---|
| Timing | Add .toBeVisible() wait, then longer timeouts |
| Selector drift | Try alternate locators from the model |
| Data collision | Regenerate test data with UUID |
| Test logic bug | Fix the assertion to match the model |
| Genuine app bug | Report. No retries. |
| Environment | Retry without changes, max 2 attempts |
Each classification has an escalation ladder. Same fix fails twice → escalate. After 4 failed escalations of the same category → reclassify.
Early pattern flag at 5: if a test fails 5 times with the same classification AND same error, flag persistent immediately. Don’t burn the remaining retry budget.
Parallel execution
Multiple Junior QAs run in parallel one per page. The orchestrator dispatches them via delegatePageTest(), and each runs in its own working directory.
Tests within a single Junior QA’s run are also parallel (Playwright’s fullyParallel: true). Flow tests use test.describe.serial where step ordering matters.