test(e2e): shared Actors/SeedRefs/loginAs, kill duplicated magic strings (WP-70)

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>
This commit is contained in:
eho
2026-08-18 15:31:12 +02:00
co-authored by Claude Sonnet 5
parent a73a1c6f1e
commit a7bf228ca8
4 changed files with 58 additions and 13 deletions
+6 -6
View File
@@ -1,4 +1,5 @@
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
@@ -11,10 +12,7 @@ import { expect, test } from '@playwright/test';
// 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 page.goto('/login');
await page.getByLabel('BSN').fill('123456782');
await page.getByLabel('Wachtwoord').fill('demo');
await page.getByRole('button', { name: 'Inloggen met DigiD' }).click();
await loginAs(page, Actors.zorgverlener);
await expect(page).toHaveURL(/\/dashboard$/);
await expect(page.getByRole('heading', { level: 1, name: 'Mijn overzicht' })).toBeVisible();
@@ -35,8 +33,10 @@ test('login → dashboard → registratie wizard → submitted', async ({ page }
// 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-d1')).toBeVisible({ timeout: 10_000 });
await page.locator('label[for="diploma-d1"]').click();
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({