e2e/README.md
Wealthfolio E2E tests use Playwright and run against the web app (not the Tauri desktop app). There are no mocks — both frontend and backend must be running against a fresh database.
pnpm installedThe easiest way to run the entire suite. Handles everything automatically: prepares a fresh database, starts the web app, waits for both servers, runs Playwright, and shuts everything down.
pnpm test:e2e
To open the Playwright UI instead:
pnpm test:e2e:ui
Use this when you want to run a subset of tests or iterate quickly without restarting the server on every run.
node scripts/prep-e2e.mjs
This creates a new timestamped SQLite database (e.g.
db/app-testing-20260411T120000Z.db) and writes its path to .env.web. Run
this every time before starting the server — it ensures test isolation.
Option A — watch the terminal output directly:
pnpm run dev:web
Wait until you see Vite's "ready in Xms" and the Rust server binding messages, then move on to Step 3 in a separate terminal.
Option B — redirect output to a log file and use the wait script:
pnpm run dev:web > /tmp/wealthfolio-dev2.log 2>&1 &
./scripts/wait-for-both-servers-to-be-ready.sh
wait-for-both-servers-to-be-ready.sh polls the log file until it detects both
"ready in" (Vite) and the Axum server binding on port 8088, then prints the last
few lines and exits. The output redirect is required — the script reads from a
file, not from a live terminal.
If the web app is already running: Stop it first (Ctrl+C), then re-run
prep-e2e.mjsand restart. The running instance is using a stale database — tests assume an empty DB and will silently skip asset creation if data already exists, causing failures for unrelated reasons.
# Run a specific spec file
npx playwright test e2e/10-symbol-mapping-validation.spec.ts
# Run with browser visible (useful for debugging)
npx playwright test e2e/10-symbol-mapping-validation.spec.ts --headed
# Run all tests
npx playwright test
# Run and open the HTML report afterwards
npx playwright test && npx playwright show-report
prep-e2e.mjs before starting the server. Tests assume an
empty database. If you run against an existing database, setup steps may
silently skip asset creation and tests may fail for unrelated reasons.http://localhost:1420.pnpm tauri dev) is
running on the same ports — they conflict.| File | What it tests |
|---|---|
01-happy-path.spec.ts | Onboarding, accounts, deposits, trades |
02-activities.spec.ts | All activity types |
03-fx-cash-balance.spec.ts | FX cash balances |
04-csv-import.spec.ts | CSV activity import |
05-form-validation.spec.ts | Form field validation errors |
06-activity-data-grid.spec.ts | Activity data grid interactions |
07-asset-creation.spec.ts | Manual asset creation and editing |
08-holdings-and-performance.spec.ts | Holdings and performance views |
09-bulk-holdings.spec.ts | Bulk holdings CSV import |
10-symbol-mapping-validation.spec.ts | Symbol mapping real-time validation (Yahoo Finance, Börse Frankfurt) |
Dependency:
10-symbol-mapping-validation.spec.tsrequires01-happy-path.spec.tsto have run first on the same database. Test 0 (setup) callsloginIfNeeded, which expects either a login page or a dashboard — neither exists on a fresh DB until onboarding is complete. Always run spec 01 before spec 10 on a fresh database:bashnpx playwright test e2e/01-happy-path.spec.ts e2e/10-symbol-mapping-validation.spec.ts
# Run with Playwright inspector (step through actions)
npx playwright test e2e/<spec>.spec.ts --debug
# Show the last HTML report
npx playwright show-report
# Record a trace for a failing test (trace is saved on retry)
# Already configured in playwright.config.ts: trace: "on-first-retry"