Files
shancheas 67e1e0a74f feat: integrate Playwright for E2E testing and enhance testing framework
- Added Playwright for end-to-end testing in the `apps/web` module, including a new `login.spec.ts` for testing login functionality.
- Updated package.json to include Playwright dependencies and new test commands for E2E testing.
- Enhanced .gitignore to exclude Playwright test results and reports.
- Modified existing documentation to reflect the integration of Playwright and updated testing guidelines.
- Refactored test commands to streamline the testing process, including a dedicated command for E2E tests.

These changes improve the testing framework by providing robust E2E testing capabilities, enhancing the reliability and quality of the application.
2026-08-31 11:52:27 +07:00

45 lines
1.3 KiB
Markdown

---
description: Generate and run frontend journey tests with Playwright for apps/web, plus Vitest/Testing Library for packages. Covers login and FULL_PAGE index/form/detail.
---
# E2E / Journey Command
This command invokes the **e2e-runner** agent to cover critical UI journeys.
## What This Command Does
1. **Identify journeys** — login, FULL_PAGE index / form / detail
2. **Write or update Playwright specs** in `apps/web/e2e/` (copy `e2e/login.spec.ts`)
3. **Run** `pnpm test:e2e:web` (or `pnpm --filter web test:e2e`)
4. **Report** pass/fail
## When to Use
Use `/e2e` when:
- Testing login or a FULL_PAGE module flow
- Verifying index → form → detail navigation
- Checking empty / error states after a UI change
- Preparing a PR that touches routing or providers
## How It Works
The e2e-runner agent will:
1. Copy the login sample in `apps/web/e2e/login.spec.ts` and UI patterns from `example/full-page`
2. Mock the backend with `mockBackend` (`e2e/fixtures/mock-api.ts`) — not a live API
3. Run `pnpm test:e2e:web`
4. Summarize failures
## Example
```
User: /e2e Test the example full-page index and detail flow
```
Canonical UI sample: `example/full-page`. Canonical E2E sample: `apps/web/e2e/login.spec.ts`.
## Related
Agent: `.cursor/agents/e2e-runner.md`