Add Playwright fixtures with 5 test user types for e2e tests

Creates test infrastructure to enable previously skipped e2e tests:
- Onboarding user (no period data) for setup flow tests
- Established user (period 14 days ago) for normal usage tests
- Calendar user (with calendarToken) for ICS feed tests
- Garmin user (valid tokens) for connected state tests
- Garmin expired user (expired tokens) for expiry warning tests

Also fixes ICS feed route to strip .ics suffix from Next.js dynamic
route param, adds calendarToken to /api/user response, and sets
viewRule on users collection for unauthenticated ICS access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 05:54:49 +00:00
parent b221acee40
commit ff3d8fad2c
9 changed files with 1434 additions and 1148 deletions

View File

@@ -45,11 +45,12 @@ export default defineConfig({
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
// Run dev server before starting tests
// Note: POCKETBASE_URL is set by global-setup.ts for the test PocketBase instance
// Note: POCKETBASE_URL is set for the test PocketBase instance on port 8091
// We never reuse existing servers to ensure the correct PocketBase URL is used
webServer: {
command: "pnpm dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
reuseExistingServer: false,
timeout: 120 * 1000, // 2 minutes for Next.js to start
env: {
// Use the test PocketBase instance (port 8091)