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
- Automattic/wp-calypsotheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Automattic/wp-calypso★ 13ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- aspire-restartSkill
- aspire-stopSkill
- buildSkill
- commitSkill
- create-prdSkill
- create-pull-requestSkill
- db-querySkill
- e2eSkill
- enhanced-message-contextSkill
- formatSkill
- lingui-best-practicesSkill
- lintSkill
- pull-platformplatform-changesSkill
- rebrandSkill
- rebuild-branchSkill
- swc-plugin-compatibilitySkill
- team-interruptSkill
- testSkill
- ultra-reviewSkill
- upgrade-packagesSkill
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
- Distinctive: line 14
Focus on the first failing step only: Do not attempt to fix later steps in a test until the first step passes.
- Distinctive: line 15
Never predict failures: Do not speculatively fix things that look like they might fail.
- Distinctive: line 16
Apply global fixes: When a fix applies across multiple tests (e.g., a renamed button), apply it everywhere before re-running.
- Distinctive: line 17
One test at a time: After global fixes, run each failing test individually.
- Distinctive: line 21
Run all smoke tests in Chromium with retries=1 to classify every test:
- Distinctive: line 28
If all tests pass, skip to STEP 4.
- Distinctive: line 39
Re-run the individual test: If it passes, move to the next failing test.
- Distinctive: line 41
Update the diagnostic report after each fix.
- Distinctive: line 45
After permanently failing tests are fixed:
- Distinctive: line 47
Run each flaky test multiple times individually to confirm flakiness
- Distinctive: line 55
Run smoke tests across all browsers.
- Distinctive: line 59
Run all tests (smoke + comprehensive, excluding slow) in Chromium.
- Distinctive: line 63
Run the full test suite across all browsers.
- Distinctive: line 67
Run the full test suite across all browsers one final time.
- Distinctive: line 76
Run tests for the specific failing file, not the whole suite, when fixing individual tests
- Distinctive: line 78
Do not run all browsers until Chromium passes
- Distinctive: line 79
Only fix what is actually failing -- do not refactor passing tests
- Very specific: line 80
Read .claude/rules/end-to-end-tests/ before making changes
- Distinctive: line 81
If stuck after 3 fix attempts on the same test, escalate to the user
≈ “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.
Files
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
- 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
- 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
- Never predict failures. Do not speculatively fix things that look like they might fail. Only fix what is actually failing right now
- 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
- 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:
- 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
- Read the first failing step and its error message
- 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
- Check for global applicability. Does the same fix apply to other tests? Apply globally first, then re-run diagnostics
- Fix the first step. Make the minimal change. Do not touch later steps
- 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:
- Run each flaky test multiple times individually to confirm flakiness
- Identify the root cause -- do not add arbitrary waits or timeouts
- Review the E2E test rules in
.claude/rules/end-to-end-tests/for known patterns - Fix the root cause. If the flakiness is caused by an application bug, report it to the user -- the application must be fixed
- 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
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
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.

