import { readFileSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) // Reads the seeded IDs that E2EBaselineSeeder wrote during globalSetup. // Tests use these IDs to construct API URLs and verify response shapes. export interface E2EFixtures { user_email: string user_password: string organisation_id: string event_id: string stage_id: string performance_id: string } const FIXTURES_PATH = path.resolve( __dirname, '..', '..', '..', '..', '..', 'api', 'storage', 'app', 'e2e-fixtures.json', ) let cached: E2EFixtures | null = null export function readFixtures(): E2EFixtures { if (cached) return cached cached = JSON.parse(readFileSync(FIXTURES_PATH, 'utf-8')) as E2EFixtures return cached }