1.2 KiB
1.2 KiB
apply
| apply |
|---|
| always |
Frontend Testing Rules
These rules apply to Vue changes, browser flows, and frontend test updates.
- Add or update tests for every new feature, bug fix, API integration change, or auth, booking, POS, or i18n workflow change.
- Browser validation runs through Playwright. Legacy browser-driver tooling is outside the supported workflow.
- Use
npm run test:unitfor Vitest coverage of isolated logic and component behavior. - Use
npm run test:e2e:smokefor the narrow Playwright browser pass on changed user flows. - Use
npm run test:e2e:ciwhen a change affects shared navigation, authentication, release-critical flows, or multiple browser projects. - Use
npx playwright test --debugfor interactive debugging and trace capture. - Prefer stable selectors, explicit fixtures, and assertions about user-visible behavior.
- Avoid manual sleeps. Let Playwright waiting and expectations drive synchronization.
- If a bug fix needs a browser regression test, prove the failure first and then keep the test with the fix.
Canonical workflow reference: .ai-workflow/workflow.md.