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:

  1. Explores the page until no new elements are discovered (saturation)
  2. Builds a Derived UI Model: fields, actions, validations, conditionals, API calls
  3. Asks for approval: presents a TL;DR summary for human-in-the-loop kickoff
  4. Generates Playwright tests: 20+ tests per page across 19 categories
  5. Runs tests: executes Playwright, classifies failures
  6. Retries intelligently: each failure gets a classified fix ladder
  7. Reports: per-page compliance or behavioural report

The phases

PhaseWhat it does
0Parse inputs (PRD or URL list)
1Generate static contracts (PRD mode only; skipped in URL-list mode)
2Explore the page multiple passes, broad → deep → adversarial
3Synthesize the Derived UI Model from exploration evidence
3.5Present Page Understanding to the user for approval
4Generate Playwright tests from the model
5Execute tests, classify failures, retry with escalating fixes
6Produce compliance / behavioural report

Test categories (V1)

Junior QA generates tests across these categories, per page:

  1. Page structure, all elements present
  2. Full submission
  3. Required-only submission
  4. Empty submission
  5. Per-field required enforcement
  6. Per-field validation rules
  7. Dropdown options
  8. Checkbox / toggle lifecycle
  9. Conditional activation
  10. Conditional deactivation
  11. State round-trip
  12. Double-toggle consistency
  13. Terminal action guard (exists, never clicked)
  14. Navigation
  15. UI ambiguity assertion
  16. Data persistence (reload survives)
  17. Conditional element discovery
  18. Negative reachability (bad actions can’t reach success)
  19. 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:

CategoryFix
TimingAdd .toBeVisible() wait, then longer timeouts
Selector driftTry alternate locators from the model
Data collisionRegenerate test data with UUID
Test logic bugFix the assertion to match the model
Genuine app bugReport. No retries.
EnvironmentRetry 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.