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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user