Testing with Playwright and Vitest

Run E2E and unit tests with the scripts currently shipped in the repo.

The repo uses:

  • Playwright for E2E tests in apps/e2e
  • Vitest for package-level unit tests

Quick Start

Run unit tests:

pnpm test:unit

Run E2E tests against a built web app:

pnpm --filter web build:test
PLAYWRIGHT_SERVER_COMMAND='pnpm --filter web start:test' pnpm --filter web-e2e test:slow

If you prefer to start the app yourself in another terminal:

pnpm --filter web start:test
pnpm --filter web-e2e test:slow

What Is Covered

  • auth flows
  • invitations and members flows
  • admin flows
  • settings flows
  • package-level service and utility tests

Environment Setup

E2E tests expect:

  • PostgreSQL running
  • apps/e2e/.env configured
  • Mailpit available for email-based flows

The E2E suite seeds the database in Playwright global setup.

Topics

  1. E2E Testing with Playwright
  2. Unit Testing with Vitest
  3. Writing Your Own Tests