// Project-level e2e configuration. Override via env vars per environment.
//
// Defaults match the kanban-board-template's default ports:
//   apps/kanban → tanstack-start (ssr) on 7104
//   backend   → wrangler/cfw worker on 4003 (or whatever the project wires)

export const config = {
  /** URL of the running frontend (vite dev server or built preview). */
  appUrl: process.env.APP_URL ?? 'http://localhost:7104',
  /** URL of the running backend (Pikku API / CFW worker). */
  apiUrl: process.env.API_URL ?? 'http://localhost:4003',
  /** Per-step Playwright timeout (ms). */
  responseTimeout: Number(process.env.E2E_TIMEOUT ?? 30_000),
  /** Whether the harness should spawn the dev servers itself. */
  manageServers: process.env.E2E_MANAGE_SERVERS === '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 (e.g. NODE_ENV !== 'production'). Leave undefined to skip reset.
   */
  resetUrl: process.env.E2E_RESET_URL,
  /**
   * RPC name to invoke at resetUrl. When set, the reset hook posts
   * `{rpcName, data: {}}` as the body — matching pikku's public /rpc/:name
   * envelope. Leave unset for non-pikku reset endpoints.
   */
  resetRpcName: process.env.E2E_RESET_RPC_NAME,
} as const
