Overview
The FE Monorepo uses different testing frameworks for each application type:- SPA & Web: Playwright for browser-based E2E testing
- Expo: Maestro for mobile E2E testing
SPA Testing (Playwright)
The SPA uses Playwright 1.58.2 for end-to-end testing.Setup
Running Tests
The
test script automatically loads environment variables from .env.dev using dotenvx.Test Configuration
Playwright tests for SPA use the following configuration:- Browser: Chromium only (for CI efficiency)
- Sharding: 4 shards in CI for parallel execution
- Reports: HTML reports stored in
apps/spa/playwright-report - Environment: Development mode with
.env.dev
CI Integration
The CI workflow runs SPA tests in parallel across 4 shards:.github/workflows/ci.yml
Tests can be skipped by including
e2e skip or skip e2e in the commit message.Web Testing (Playwright)
The Web app also uses Playwright 1.58.2 for end-to-end testing.Setup
Ensure Environment File Exists
Make sure
apps/web/.env.dev exists with database and auth configuration.Running Tests
Test Configuration
Playwright tests for Web use similar configuration to SPA:- Browser: Chromium only
- Sharding: 4 shards for parallel execution
- Reports: HTML reports stored in
apps/web/playwright-report - Environment: Development mode with
.env.dev
Expo Testing (Maestro)
The Expo app uses Maestro for mobile end-to-end testing.Prerequisites
Install Maestro CLI
Follow the Maestro installation guide to install the CLI.
Running Tests
Maestro Studio opens an interactive UI at
http://localhost:9999/interact to help write and debug test flows.Test Flow Configuration
Maestro tests use environment variables to target the correct app variant:Maestro Studio
Maestro Studio is a visual tool for writing and debugging test flows:Upgrading Test Dependencies
Playwright
When upgrading Playwright to a new MINOR version:Maestro
Maestro CLI is installed globally and managed separately:CI/CD Considerations
GitHub Actions
The monorepo uses GitHub Actions for running Playwright tests:- Parallel Execution: Tests run in 4 parallel shards
- Artifact Upload: Test reports are saved for 7 days
- Environment: Uses
devenvironment secrets - Skip Option: Add
e2e skipto commit message to skip tests
Maestro in CI
Performance Tips
Playwright:
- Use
--shardoption to parallelize tests in CI - Run tests in headless mode by default
- Only install Chromium (not all browsers) for faster setup
- Keep test flows focused and concise
- Use Maestro Studio for faster debugging
- Test on development builds first before production
Troubleshooting
Playwright Issues
Tests fail to start:- Ensure browsers are installed:
bun spa test:install - Check that
.env.devfile exists - Verify the development server isn’t already running
- Add proper wait conditions
- Use
test.uimode to debug - Check network conditions and API responses
Maestro Issues
Unable to launch app:- Ensure only one Maestro process is running
- Verify the app is installed on the device/simulator
- Check the
MAESTRO_APP_IDenvironment variable matches your build
- Ensure a simulator is booted:
xcrun simctl list devices | grep Booted - Boot a simulator from Xcode before running tests
Quick Reference
| Task | SPA | Web | Expo |
|---|---|---|---|
| Install test tools | bun spa test:install | bun web test:install | Install Maestro CLI |
| Run tests | bun spa test | bun web test | bun expo test:dev |
| Interactive mode | bun spa test:ui | bun web test:ui | bun expo test:ui |
| View report | bun spa test:report | bun web test:report | N/A |
| Framework | Playwright 1.58.2 | Playwright 1.58.2 | Maestro |
