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
+2 -3
View File
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
import { Actors, loginAs } from './support/actors';
// The dev-only `?scenario=error` toggle forces the scenario.interceptor to fail
// the request WITHOUT ever reaching the real HTTP transport (it substitutes a
@@ -11,9 +12,7 @@ import { expect, test } from '@playwright/test';
// genuinely re-runs and genuinely fails the same way — that's what's asserted
// here: a real reload cycle, not a no-op button.
test('dashboard error state renders, retry re-fetches (and fails again)', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('BSN').fill('123456782');
await page.getByRole('button', { name: 'Inloggen met DigiD' }).click();
await loginAs(page, Actors.zorgverlener);
await expect(page).toHaveURL(/\/dashboard$/);
await page.goto('/dashboard?scenario=error');