The demo BSN, password, and DigiD login sequence were copy-pasted verbatim into all three specs; the diploma id #diploma-d1 was coupled to SeedData.cs's ordering by comment only, with no compile-time check if the seed shape changed. e2e/support/actors.ts names both: Actors.zorgverlener + loginAs() for the login sequence, SeedRefs.diplomaZonderPolicyVragen for the seed coupling (with the "why d1" reasoning attached to the name, not scattered across specs). Zero assertions changed — pure extract-and-rename of test setup. e2e test-isolation (the shared mutable backend) is a documented follow-up, not fixed here — see ADR-0006. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
60 lines
3.0 KiB
TypeScript
60 lines
3.0 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
import { Actors, loginAs, SeedRefs } from './support/actors';
|
|
|
|
// One happy-path flow through the real FE+backend: log in, land on the real
|
|
// dashboard, run the registratie wizard's minimum required path (a DUO diploma
|
|
// with zero policy questions, so the only required upload is identiteit), submit,
|
|
// and see the real confirmation. Not a full wizard-coverage suite — see WP-19.
|
|
//
|
|
// The backend is in-memory and shared across runs; this test mutates real state
|
|
// (creates a registratie application for the fixed demo identity). Restart the
|
|
// backend between CI runs — a second run would see a leftover Concept/submitted
|
|
// application on the dashboard, which this test doesn't assert against, but a
|
|
// stricter future test might.
|
|
test('login → dashboard → registratie wizard → submitted', async ({ page }) => {
|
|
await loginAs(page, Actors.zorgverlener);
|
|
|
|
await expect(page).toHaveURL(/\/dashboard$/);
|
|
await expect(page.getByRole('heading', { level: 1, name: 'Mijn overzicht' })).toBeVisible();
|
|
// Real backend content, not a loading/error state.
|
|
await expect(page.getByText('Persoonsgegevens (BRP)')).toBeVisible();
|
|
|
|
await page.goto('/registreren');
|
|
await expect(
|
|
page.getByRole('heading', { level: 1, name: 'Inschrijven in het BIG-register' }),
|
|
).toBeVisible();
|
|
|
|
// Step 1 — adres: BRP prefill is real backend data; "Post" skips the email field.
|
|
// The CIBG-styled radio hides the native input behind its label, so click the
|
|
// label (real user interaction) rather than `.check()` the covered input.
|
|
await expect(page.getByText('Vooraf ingevuld op basis van de BRP')).toBeVisible();
|
|
await page.locator('label[for="correspondentie-post"]').click();
|
|
await page.locator('button[type="submit"]').click();
|
|
|
|
// Step 2 — beroep: the first DUO diploma (Geneeskunde, non-English) carries zero
|
|
// policy questions, so the only required document is identiteit.
|
|
await expect(page.locator(`#diploma-${SeedRefs.diplomaZonderPolicyVragen}`)).toBeVisible({
|
|
timeout: 10_000,
|
|
});
|
|
await page.locator(`label[for="diploma-${SeedRefs.diplomaZonderPolicyVragen}"]`).click();
|
|
await expect(page.getByText('Beroep (afgeleid uit diploma)')).toBeVisible();
|
|
|
|
await page.locator('#identiteit-file').setInputFiles({
|
|
name: 'identiteit.pdf',
|
|
mimeType: 'application/pdf',
|
|
buffer: Buffer.from('%PDF-1.4 fake e2e fixture'),
|
|
});
|
|
// Real upload against the backend: wait for the row to leave "uploading".
|
|
await expect(page.locator('.upload-progress')).toHaveCount(0, { timeout: 10_000 });
|
|
await expect(page.locator('.icon-remove')).toBeVisible();
|
|
|
|
await page.locator('button[type="submit"]').click();
|
|
|
|
// Step 3 — controle: review + real submit.
|
|
await expect(page.getByText('Controleer uw gegevens en dien de registratie in.')).toBeVisible();
|
|
await page.locator('button[type="submit"]').click();
|
|
|
|
await expect(page.getByText('Uw registratie is ontvangen')).toBeVisible({ timeout: 10_000 });
|
|
await expect(page.getByText(/Uw referentienummer is/)).toBeVisible();
|
|
});
|