E2E Until Stable
This loop automatically identifies and fixes end-to-end test failures by iteratively running the test suite, analyzing failures, and applying targeted fixes until all tests pass or the maximum iteration limit is reached.
Goal
Fix end-to-end failures
How to Run
Initiate this loop using the kickoff prompt in your preferred AI coding environment. The agent will automatically run E2E tests, identify failures, and apply fixes until the suite passes or max iterations are exhausted.
- 01
Initialize Loop
Paste the kickoff prompt into your AI coding environment (Cursor, Claude Code, Codex, etc.) to start the automated E2E fixing process
- 02
Monitor Progress
The agent will self-pace through test runs and fixes. Review proposed changes before they're applied if needed
- 03
Completion
The loop will automatically stop once E2E tests pass or after 10 iterations, whichever comes first
Workflow Steps
- 01
Run E2E test suite using npm run test:e2e
Identify current failing tests
- 02
Analyze test output and failure patterns
Determine root cause of failures
- 03
Apply targeted fixes to resolve identified issues
Eliminate specific test failures
- 04
Repeat process until tests pass or iteration limit reached
Ensure complete resolution of E2E instability
Kickoff Prompt
Start the "E2E Until Stable" loop. Goal: Fix end-to-end failures Max iterations: 10 Between iterations run: npm run test:e2e Exit when: E2E suite passes You are an automated E2E test fixing agent. Your task is to run the command 'npm run test:e2e' and continue fixing any failing tests until they all pass. Follow this workflow: 1. Execute the check command and capture output 2. If tests fail, analyze the error messages and stack traces 3. Identify the root cause in the application code or test setup 4. Make minimal, targeted fixes to resolve the failures 5. Repeat from step 1 until tests pass or you've reached 10 iterations Be careful to only modify code that directly impacts the failing tests. Do not make unrelated changes or introduce new features. Stop immediately if you cannot determine how to fix the failures. The loop should exit when the E2E suite passes. Self-pace this loop. After each iteration, run `npm run test:e2e` and evaluate the output, and only continue if the exit condition is not met (E2E suite passes). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Only modify code related to failing E2E tests
- ·Preserve existing functionality not related to test failures
- ·Do not introduce new dependencies or major refactors
- ·Focus on test stability rather than feature changes
- ·Stop immediately if unable to resolve failures after 10 iterations
Flow Diagram
Related loops — Testing
Testing
Test Coverage Builder
This loop identifies gaps in test coverage and systematically writes targeted unit/integration tests to increase code coverage. It analyzes coverage reports, prioritizes uncovered code paths, and iterates until the coverage target is achieved, ensuring your codebase remains well-tested without compromising production quality.
Testing
Regression Prevention Loop
This loop ensures that newly discovered bugs or edge cases are covered by automated regression tests to prevent future incidents. It iterates through identifying missing test coverage, implementing appropriate tests, and validating that the regression suite passes without failures.