Agent Skill
2/7/2026

test-fixing-skill

Systematically diagnosis and repair of failing tests using "Self-Healing" methodology.

C
chrysaliscat
0GitHub Stars
1Views
npx skills add chrysaliscat/designgraduation

SKILL.md

Nametest-fixing-skill
DescriptionSystematically diagnosis and repair of failing tests using "Self-Healing" methodology.

name: Test Fixing Skill description: Systematically diagnosis and repair of failing tests using "Self-Healing" methodology.

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, or ReferenceError?
  • 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 expect auto-retries, check await page.waitForLoadState()).
  • Data Issue: Did previous tests dirty the database? (Sol: Ensure DB reset in beforeEach or unique naming).
  • Selector Changed: Did a class name change? (Sol: Update locator to be resilient).

3. The Healing Loop

  1. Reproduce: Confirm failure locally.
  2. Patch: Apply fix (update locator, add wait, fix logic).
  3. Verify: Run test again.
  4. Regression: Run all tests in the file to ensure no side effects.

Common Fixes

ErrorProbable CauseFix
TimeoutError: waiting for selectorElement not in DOMCheck if conditions, ensure correct page navigation.
received: "Loading..." expected: "Data"Assertion too earlyUse await expect().not.toHaveText("Loading...") first.
Element is not clickableOverlay/Modal blockingCheck for sticky headers or previous modals not closing.
Skills Info
Original Name:test-fixing-skillAuthor:chrysaliscat