// Project-level e2e configuration. Override via env vars per environment.
//
// Local defaults:
//   apps/app  → vite on 7104
//   backend   → Pikku API on 4003

export const config = {
  /** URL of the running frontend (vite dev server or built preview). */
  get appUrl() {
    return process.env.APP_URL ?? 'http://localhost:7104'
  },
  /** URL of the running backend (Pikku API). */
  get apiUrl() {
    return process.env.API_URL ?? 'http://localhost:4003'
  },
  /** Per-step Playwright timeout (ms). */
  get responseTimeout() {
    return Number(process.env.E2E_TIMEOUT ?? 30_000)
  },
  /** Whether the harness should spawn the dev servers itself. */
  get manageServers() {
    return process.env.E2E_MANAGE_SERVERS === '1'
  },
  /** Whether the harness should isolate each scenario with a copied golden DB. */
  get isolatedDb() {
    return process.env.E2E_ISOLATED_DB === '1'
  },
  /**
   * Reset hook URL — POST here to reset the DB to seed state between scenarios.
   * Project must implement this as a sessionless RPC gated behind a test-only flag.
   */
  get resetUrl() {
    return process.env.E2E_RESET_URL
  },
  get resetRpcName() {
    return process.env.E2E_RESET_RPC_NAME
  },
} as const
