Skip to main content

Keep Tests Healthy with Minimal Effort

Most maintenance is already handled via healing and focused regeneration. Use this page as a hub for quick practices and links.

Essentials

  • Prefer regeneration over manual rewrites for broad changes
  • Apply auto-healing for selector drift, waits, and fixtures
  • Use diff scope to update only impacted tests
  • Keep PRD and acceptance criteria current

Shift Left (TDD with TestSprite)

Generate and run tests while coding—even before features are complete—to reveal gaps early.
diff
  • Use testScope: "diff" to target in-progress changes
  • Run small subsets frequently via testIds
  • Let healing suggestions guide selectors, waits, and data setup from the start

Create Tests for New Change

Learn how to create tests for new features and changes

Common Tasks

Rerun quickly: testsprite_rerun_tests({ projectPath: "/abs/path" })

Best Practices

Use semantic selectors and explicit ready states
Keep deterministic test data and clean state between cases
Commit changes frequently so diff-based updates are accurate
Run a small subset (by testIds) while iterating

Where Artifacts Live

delete
  • Results, PRD, plans, and logs under testsprite_tests/
  • Reports: Markdown/HTML plus machine-readable JSON for automation