# Running integration (e2e) tests ## One-time setup Create a `.env` file in the project root: ``` APP_URL=http://localhost:3000 API_URL=http://localhost:8080 TOKENS_DIR="/` at the project root. Playwright runs tests in parallel (8 workers by default; see `tests/playwright.config.js`), and each worker's server-side user storage is isolated by its worker ID: - `storage/0/`, `storage/1/`, …, `storage/7/` - per-worker user filesystems. `tests/sync.spec.js` `beforeEach` wipes and recreates the current worker's directory on every test, so state never leaks between tests. - `storage/-1/` - shared tokens directory. Contains one file per worker, named by `sha256(workerIndex + salt)`, whose contents are the worker's user ID. Used by the server's token middleware to authenticate incoming sync requests from the test browser. Feel free to delete `storage/` whenever - it's rebuilt on the next `beforeEach`.