E2E Until Green
FeaturedOn demandAbout E2E Until Green
This loop drives an end-to-end suite to a passing state. Each round runs npm run test:e2e, edits code based on the failures, then runs the same command again to confirm. It allows up to 10 rounds and lists Cursor as the supported agent.
Key features
- 01Manual trigger, so the user decides when to start
- 02Judged only by the exit code of npm run test:e2e
- 03Capped at 10 rounds to avoid endless retries
- 04Intended for use with Cursor
Use cases
- 01Many E2E failures found before a merge
- 02Restoring a green E2E run after a dependency upgrade
- 03Tracking down failing user-flow tests
- Goal
- The E2E suite run by npm run test:e2e passes completely.
- Exit when
- Stop when npm run test:e2e exits with code 0, or when the 10-round limit is reached.
- Between iterations run
- npm run test:e2e
Launch prompt
Paste into Cursor. The agent repeats the steps below until the exit condition is met.
Start the "E2E Until Green" loop. Goal: The E2E suite run by npm run test:e2e passes completely. Max iterations: 10. Step 1: Run E2E — Execute npm run test:e2e and note the failing cases and error messages. If the command already exits 0, the loop ends here. `npm run test:e2e` Step 2: Diagnose and fix — Decide from the failure output whether the cause is a code defect, a test script problem or the environment, and make a targeted change. Step 3: Re-run E2E — Execute npm run test:e2e again to see whether earlier failures are gone and whether new ones appeared. Stop on exit code 0, otherwise start the next round. `npm run test:e2e` Between iterations run: `npm run test:e2e` Exit when: Stop when npm run test:e2e exits with code 0, or when the 10-round limit is reached.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 10.
Execute npm run test:e2e and note the failing cases and error messages. If the command already exits 0, the loop ends here.
npm run test:e2eDecide from the failure output whether the cause is a code defect, a test script problem or the environment, and make a targeted change.
Execute npm run test:e2e again to see whether earlier failures are gone and whether new ones appeared. Stop on exit code 0, otherwise start the next round.
npm run test:e2eSupported agents
Coding agents that can run this loop directly.