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.
This commit is contained in:
shancheas
2026-08-31 11:52:27 +07:00
parent 166e0d40ac
commit 67e1e0a74f
23 changed files with 318 additions and 108 deletions
@@ -25,7 +25,7 @@ Reference this skill when working on this project. It contains:
- **Apps**: React 19 + Vite (`apps/web`, `apps/showcase`, `apps/landing`) + Electron (`apps/desktop`) + VitePress (`apps/docs-dev`)
- **Packages**: `@repo/ui` (Mantine), `@repo/core-api`, `@repo/core-storage`, `@repo/core-i18n`, `@repo/core-events`, `@repo/utils`, `@repo/brand`, `packages/configs`
- **Testing**: Vitest; Testing Library in `packages/ui` and `packages/core-events`
- **Testing**: Vitest; Playwright E2E in `apps/web/e2e/`; Testing Library in `packages/ui` and `packages/core-events`
- **Package manager**: pnpm 8.15.6 + Turbo
**Where to work:** product in `apps/web`; copy UI/API usage from `apps/showcase`; concepts from `apps/docs-dev`. Do not invent a parallel UI kit.
@@ -128,6 +128,7 @@ export const createFullPageSchema = (t: (key: string) => string) =>
```bash
pnpm test
pnpm --filter web test
pnpm test:e2e:web
pnpm --filter @repo/ui test
pnpm typecheck:web
pnpm check:all
@@ -135,7 +136,7 @@ pnpm check:all
- Unit tests colocated as `*.test.ts(x)`
- Component tests with Testing Library in packages that already have it
- App journeys: browser-verify login and FULL_PAGE index / form / detail
- App journeys: Playwright in `apps/web/e2e/` (login is the first sample)
- Minimum 80% coverage; TDD (red → green → refactor)
---
@@ -149,6 +150,7 @@ pnpm dev:docs-dev
pnpm lint
pnpm typecheck:web
pnpm test
pnpm test:e2e:web
pnpm check:all
```