Skip to content

Testing

Yinan Zhou edited this page Dec 8, 2025 · 1 revision

Summary

This project includes both unit tests and end-to-end tests. Unit tests are implemented using Vitest, while end-to-end tests use Playwright. Pytest will be implemented in the future for backend testing.

Unit Tests

Framework: Vitest with happy-dom environment
Location: web-app/frontend/src/**/*.test.ts
Configuration: web-app/frontend/vitest.config.ts

Run locally:

cd web-app/frontend
npm test

# To run a specific test file/folder
npx vitest run src/path/to/your.test.ts

End-to-End Tests

Framework: Playwright
Location: web-app/frontend/tests/e2e/
Configuration: web-app/frontend/playwright.config.ts

Prerequisites: Docker Compose services must be running

Run locally:

# Start test environment
docker-compose -f docker-compose-test.yml up -d --build

# Run E2E tests
cd web-app/frontend
npm run test:e2e

# Or run a specific test file/folder
npx playwright test tests/e2e/path/to/your.spec.ts

Setup: The E2E test setup (tests/setup/docker-setup.ts) automatically:

  • Waits for Django server to be ready
  • Runs database migrations
  • Creates test users
  • Imports languages and instruments
  • Indexes data in Solr

Clone this wiki locally