/** * `pnpm e2e:shell` (scripts/db-sandbox.sh e2e-shell): the authenticated /app * shell in Chromium against the isolated stack of `pnpm db:sandbox`, never DEV. * The dev server is built with a Supabase URL that resolves nowhere and runs * on a loopback port of its own; e2e/support/sandbox.ts replays its calls on * the sandbox. No trace is kept: it would hold the session tokens. */ import { defineConfig } from '@playwright/test' import type { GuardOptions } from './support/browser' import { PROJECTS } from './support/browser' const ORIGIN = 'http://127.0.0.1:5192' const FAKE_SUPABASE_ORIGIN = 'http://sandbox.faunosteo.invalid' const anonKey = process.env.SANDBOX_ANON_KEY if (!anonKey) throw new Error( 'SANDBOX_ANON_KEY missing: run pnpm e2e:shell (the sandbox must be up)', ) export default defineConfig({ testDir: './shell', outputDir: './test-results/shell', fullyParallel: true, forbidOnly: true, retries: 0, reporter: [ ['list'], ['html', { outputFolder: './playwright-report/shell', open: 'never' }], ], use: { baseURL: ORIGIN, allowedOrigins: [ORIGIN, FAKE_SUPABASE_ORIGIN], trace: 'off', screenshot: 'only-on-failure', }, projects: PROJECTS, webServer: { command: 'node_modules/.bin/vite --host 127.0.0.1 --port 5192 --strictPort', cwd: '..', url: `${ORIGIN}/`, reuseExistingServer: false, timeout: 120_000, env: { VITE_SUPABASE_URL: FAKE_SUPABASE_ORIGIN, VITE_SUPABASE_ANON_KEY: anonKey, }, }, })