What problem does it solve?
End-to-end (E2E) tests are critical but often flaky and hard to maintain due to UI changes and complex system interactions. This Skill provides expert guidance for writing resilient E2E tests that reliably simulate user behavior, reducing test failures and maintenance overhead.
Core Features & Use Cases
- Self-Contained Tests: Enforces isolated test states and dedicated data for reliable execution, preventing inter-test dependencies.
- User-Facing Locators: Guides on using ARIA-based selectors (
getByRole, getByLabel) for UI resilience, making tests less prone to breaking from cosmetic changes.
- Smart Waiting Strategies: Eliminates arbitrary timeouts, leveraging auto-retriable assertions for stability and faster test execution.
- Use Case: Refactor an existing E2E test suite to replace fragile CSS selectors with resilient ARIA-based locators and implement semantic helper functions for clearer, more maintainable user journeys.
Quick Start
Review the attached login.e2e.test.ts file and refactor it to use only getByRole or getByLabel selectors, removing any CSS or XPath locators.