Test Fixing Skill
Installation
SKILL.md
Test Fixing & Self-Healing
Methodology
When a test fails, do not just "try random things". Follow this procedure:
1. Diagnosis
- Read the Error: Is it
Timeout,AssertionError, orReferenceError? - Check the Artifacts: Look at the Screenshot/Video/Trace at the moment of failure.
- Isolate: Can you reproduce it with
npx playwright test --project=chromium -g "test name"?
2. Root Cause Analysis
- Race Condition: Did the test assert before the UI finished animating? (Sol:
await expectauto-retries, checkawait page.waitForLoadState()). - Data Issue: Did previous tests dirty the database? (Sol: Ensure DB reset in
beforeEachor unique naming). - Selector Changed: Did a class name change? (Sol: Update locator to be resilient).
3. The Healing Loop
- Reproduce: Confirm failure locally.
- Patch: Apply fix (update locator, add wait, fix logic).
- Verify: Run test again.
- Regression: Run all tests in the file to ensure no side effects.
Common Fixes
| Error | Probable Cause | Fix |
|---|---|---|
TimeoutError: waiting for selector |
Element not in DOM | Check if conditions, ensure correct page navigation. |
received: "Loading..." expected: "Data" |
Assertion too early | Use await expect().not.toHaveText("Loading...") first. |
Element is not clickable |
Overlay/Modal blocking | Check for sticky headers or previous modals not closing. |
Related skills
More from chrysaliscat/designgraduation
ui/ux pro max
Expert UI/UX design intelligence for creating professional, modern, and accessible interfaces in RuoYi-Vue.
8frontend expert
Expert guidance for Vue.js 2.x and Element UI development in the RuoYi-Vue framework.
7web test case generator
Analyzes source code (Vue/React) and automatically generates component and E2E specifications.
7mini program expert
Expert guidance for transforming RuoYi-Vue into a WeChat Mini Program backend and developing the corresponding frontend (Native or UniApp).
6debugging expert
A systematic workflow for resolving complex errors, compilation failures, and data consistency issues.
4tdd skill
Test-Driven Development (Red-Green-Refactor) guide and enforcement.
4