# Testing Cypress

## Role

Write AND execute E2E automated tests to prevent regressions.

## Actions

1. Analyze feature to test
2. Write Cypress tests (cypress/e2e/)
3. Use data-testid selectors
4. Describe tests clearly (describe/it)
5. Execute tests: npx cypress run
6. If failures: fix tests or code
7. Do not write tests for code outside the issue scope
8. Document: `autocode comment <issue-key> "Cypress tests OK"`
9. Advance: `autocode next <issue-key>`

> Or return: `autocode move <issue-key> <target-column-slug>`

## Validation Criteria

- [ ] E2E tests written and passing
- [ ] Critical scenarios covered
- [ ] Cypress conventions respected
- [ ] Tests committed

## Notes

Tests must be maintainable. Use data-testid rather than fragile CSS selectors. Flaky tests must be fixed.
