add playwright tests

This commit is contained in:
2026-08-01 21:24:48 -04:00
parent 250a18cfbb
commit 61ea97265c
12 changed files with 299 additions and 9 deletions
+21
View File
@@ -62,3 +62,24 @@ cargo fmt --all -- --check
cargo check
cargo test
```
### End-to-end tests (Playwright)
The e2e tests live in `e2e/` and use Playwright with a real browser. Each test
starts its own server against a fresh, throwaway database on a unique port, so
tests are fully isolated from each other and from your real `sustenance.db`.
```sh
# one-time setup
cd e2e
npm install
npx playwright install chromium
# run the tests (builds the server automatically via globalSetup)
cd e2e
npx playwright test
```
The Playwright `globalSetup` runs `cargo build` before the suite, and each test
launches its own server against a fresh database, so no manual build or server
start is required.