agentleFS
platformplatformplatformplatform/PlatformPlatform/.claude/skills/fix-e2e-tests/SKILL.md

fix-e2e-tests

Skill439 starsChanged 6 months agoMITView on GitHub

Systematically fix all failing E2E tests using a phased diagnostic approach. Classifies tests as passing, flaky, or permanently failing, then fixes them one by one with progressive scope expansion.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 18 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Focus on the first failing step only: Do not attempt to fix later steps in a test until the first step passes.

    line 14
  2. Distinctive:

    Never predict failures: Do not speculatively fix things that look like they might fail.

    line 15
  3. Distinctive:

    Apply global fixes: When a fix applies across multiple tests (e.g., a renamed button), apply it everywhere before re-running.

    line 16
  4. Distinctive:

    One test at a time: After global fixes, run each failing test individually.

    line 17
  5. Distinctive:

    Run all smoke tests in Chromium with retries=1 to classify every test:

    line 21
  6. Distinctive:

    If all tests pass, skip to STEP 4.

    line 28
  7. Distinctive:

    Re-run the individual test: If it passes, move to the next failing test.

    line 39
  8. Distinctive:

    Update the diagnostic report after each fix.

    line 41
  9. Distinctive:

    After permanently failing tests are fixed:

    line 45
  10. Distinctive:

    Run each flaky test multiple times individually to confirm flakiness

    line 47
  11. Distinctive:

    Run smoke tests across all browsers.

    line 55
  12. Distinctive:

    Run all tests (smoke + comprehensive, excluding slow) in Chromium.

    line 59
  13. Distinctive:

    Run the full test suite across all browsers.

    line 63
  14. Distinctive:

    Run the full test suite across all browsers one final time.

    line 67
  15. Distinctive:

    Run tests for the specific failing file, not the whole suite, when fixing individual tests

    line 76
  16. Distinctive:

    Do not run all browsers until Chromium passes

    line 78
  17. Distinctive:

    Only fix what is actually failing -- do not refactor passing tests

    line 79
  18. Very specific:

    Read .claude/rules/end-to-end-tests/ before making changes

    line 80
  19. Distinctive:

    If stuck after 3 fix attempts on the same test, escalate to the user

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fix E2E Tests

Systematically fix all failing end-to-end tests by diagnosing first, then fixing one by one, expanding scope progressively. Optimizes for speed of fixing over exhaustive analysis.

Core Principles

  1. Test bug or app bug? For every failure, critically evaluate: is the test wrong, or is the application wrong? A failing test might be correctly catching an application bug. If the application is broken, fix the application -- do not make the test pass by weakening it
  2. Focus on the first failing step only. Do not attempt to fix later steps in a test until the first step passes. You do not know if later steps would actually fail
  3. Never predict failures. Do not speculatively fix things that look like they might fail. Only fix what is actually failing right now
  4. Apply global fixes. When a fix applies across multiple tests (e.g., a renamed button), apply it everywhere before re-running. Do not fix one test at a time when the same change applies to many
  5. One test at a time. After global fixes, run each failing test individually. Fix the first step. Re-run. Iterate

STEP 1: Diagnostic Run -- Smoke Tests in Chromium

Run all smoke tests in Chromium with retries=1 to classify every test:

  • Passing: Passes on first attempt
  • Flaky: Fails first attempt, passes on retry
  • Permanently failing: Fails both attempts

Save a diagnostic report to .workspace/{branch-name}/e2e-diagnostic.md with test counts and, for each failure, the test file, test name, first failing step, and error message.

If all tests pass, skip to STEP 4.

STEP 2: Fix Permanently Failing Tests

Work through permanently failing tests one at a time:

  1. Run the failing test in isolation to confirm it is truly permanently failing and not flaky. A test that failed in the full suite might pass when run alone (resource contention, test ordering). If it passes in isolation, reclassify it as flaky and handle in STEP 3
  2. Read the first failing step and its error message
  3. Evaluate: test bug or app bug? Did we deliberately change something the test is catching? Would a real user see this as broken? If it is an app bug, report it and move on -- do not fix the test
  4. Check for global applicability. Does the same fix apply to other tests? Apply globally first, then re-run diagnostics
  5. Fix the first step. Make the minimal change. Do not touch later steps
  6. Re-run the individual test. If it passes, move to the next failing test. If a new step fails, repeat from step 1

Update the diagnostic report after each fix.

STEP 3: Address Flaky Tests

After permanently failing tests are fixed:

  1. Run each flaky test multiple times individually to confirm flakiness
  2. Identify the root cause -- do not add arbitrary waits or timeouts
  3. Review the E2E test rules in .claude/rules/end-to-end-tests/ for known patterns
  4. Fix the root cause. If the flakiness is caused by an application bug, report it to the user -- the application must be fixed
  5. Re-run the test multiple times to confirm it is now stable. Do not move on until it passes consistently

STEP 4: Expand to All Browsers -- Smoke Tests

Run smoke tests across all browsers. Fix any browser-specific failures using the same one-at-a-time process from STEP 2.

STEP 5: Expand to All Tests in Chromium

Run all tests (smoke + comprehensive, excluding slow) in Chromium. Fix any failures using the same process.

STEP 6: Expand to All Tests in All Browsers

Run the full test suite across all browsers. Fix any remaining failures.

STEP 7: Final Validation

Run the full test suite across all browsers one final time. Every test must pass. Zero failures, zero flaky tests. This skill is not complete until all tests pass consistently.

Update .workspace/{branch-name}/e2e-diagnostic.md with:

  • Final test counts: all must be passing
  • Summary of changes made (test fixes and application fixes)
  • Application bugs that were found and fixed

Key Rules

  • Run tests for the specific failing file, not the whole suite, when fixing individual tests
  • Apply global fixes before re-running diagnostics
  • Do not run all browsers until Chromium passes
  • Only fix what is actually failing -- do not refactor passing tests
  • Read .claude/rules/end-to-end-tests/ before making changes
  • If stuck after 3 fix attempts on the same test, escalate to the user
  • Zero tolerance: this skill is not complete until every test passes in every browser

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.