[01] LOOP
TestingmanualHardened

E2E Until Green

Run Playwright or Cypress end-to-end tests with annotated failure screenshots, fix root causes, and loop until the suite is green.

by Trooper

Kickoff prompt
Start the "E2E Until Green" loop.

Goal: E2E test suite exits zero with no flaky failures
Max iterations: 10
Between iterations run: npx playwright test || npx cypress run
Exit when: E2E suite exits 0

Step 1: Run E2E tests. On failure, annotate with screenshots, fix root cause, and repeat.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

Paste the kickoff prompt into Cursor, Claude Code, or Codex. Deeplinks do not install hook files.

Steps

1. Run E2E suite

Execute Playwright or Cypress against the target environment.

2. Annotate failures

Capture screenshots, trace files, and label the failing step.

3. Fix and re-run

Patch root cause, then re-run the failing spec or full suite.

Flow diagram

Guardrails

Rules the agent must follow so it cannot cheat the exit condition.

  • Do not disable or delete failing tests to force green
  • Attach annotated screenshots for every failure
  • Fix the smallest root cause per iteration

More Testing loops