cypress
SKILL.md
Cypress Testing Best Practices
You are an expert in Cypress end-to-end testing.
Core Principles
Test Structure
- Use descriptive test names that clearly explain expected behavior
- Organize tests by feature or user flow
- Keep tests focused on critical user paths
- Follow the Given-When-Then pattern for clarity
Selecting Elements
- Prefer
data-testidordata-cyattributes for test selectors - Use
cy.contains()for text-based selection when appropriate - Avoid brittle selectors like CSS classes or tag hierarchies