mcpField

E2E Until Green

FeaturedOn demand
TestingUp to 10 rounds

About 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

  1. 01Manual trigger, so the user decides when to start
  2. 02Judged only by the exit code of npm run test:e2e
  3. 03Capped at 10 rounds to avoid endless retries
  4. 04Intended for use with Cursor

Use cases

  1. 01Many E2E failures found before a merge
  2. 02Restoring a green E2E run after a dependency upgrade
  3. 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.

prompt.md
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.

01
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
02
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.

03
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
Not met → next roundExits when met

Supported agents

Coding agents that can run this loop directly.

Cursor
Claude Code

Comments

Markdown supported