import type { Page } from '@playwright/test'; /** * A demo identity the fake DigiD login accepts. Auth is faked (CLAUDE.md) — the * form only ever emits `bsn` on submit, so `wachtwoord` is never actually checked; * it's filled in anyway because the field is marked required in the UI. */ export interface Actor { readonly bsn: string; readonly wachtwoord: string; } /** * The demo identities seeded by the backend. Today there is exactly one seeded * citizen (`backend/src/BigRegister.Api/Data/SeedData.cs`'s `Person`/`Registration`, * whose BSN also matches `DocumentStore.DemoOwner`) — named for the ROLE it plays * in a spec, not its BSN, so a spec reads as "log in as the zorgverlener", not * "log in as 123456782". */ export const Actors = { zorgverlener: { bsn: '123456782', wachtwoord: 'demo' }, } as const satisfies Record; /** The shared DigiD-style mock login sequence every e2e spec starts from. */ export async function loginAs(page: Page, actor: Actor): Promise { await page.goto('/login'); await page.getByLabel('BSN').fill(actor.bsn); await page.getByLabel('Wachtwoord').fill(actor.wachtwoord); await page.getByRole('button', { name: 'Inloggen met DigiD' }).click(); } /** * Seeded fixtures specs depend on by id, named by * `backend/src/BigRegister.Api/Data/SeedData.cs`'s seed order — reseeding that * file in a different order silently breaks these with no compile error, so give * the raw id a name instead of leaving it a bare literal in each spec. */ export const SeedRefs = { /** * The first DUO diploma (id "d1": Geneeskunde, Universiteit Leiden, non-English). * Chosen deliberately, not arbitrarily: it's the one seeded diploma that carries * zero policy questions, so it drives the wizard down its minimum required path * — the only required upload is identiteit. */ diplomaZonderPolicyVragen: 'd1', /** The seeded registration's BIG-nummer (`SeedData.Registration`). */ bigNummer: '19012345601', } as const;