import AxeBuilder from '@axe-core/playwright'; import { expect, test } from '@playwright/test'; const enabled = Boolean(process.env.PULSE_E2E_REAL_BASE_URL); test.beforeEach(async ({ page }) => { test.skip(!enabled, 'Requires an isolated real Pulse stack.'); const login = await page.request.get('/auth/test-login'); expect(login.ok()).toBeTruthy(); }); test('real services and inventory topology retain explicit production states', async ({ page }) => { await page.goto('/services'); await expect(page.getByRole('heading', { name: 'Bereikbaarheid en historie' })).toBeVisible(); await expect(page.getByText('Voor deze service is nog geen probe geconfigureerd.').first()).toBeVisible(); await page.goto('/topology'); await expect(page.getByRole('heading', { name: 'Relaties en services' })).toBeVisible(); await expect(page.getByRole('region', { name: 'Relaties', exact: true }).getByText('Ondersteunt')).toBeVisible(); await expect(page.getByText(/dependency-test-a-/).first()).toBeVisible(); await page.goto('/network'); const dns = page.getByRole('heading', { name: 'DNS' }).locator('../..'); await expect(dns.getByText('Niet geconfigureerd')).toBeVisible(); await expect(dns.getByText('Voor dit signaal is nog geen veilige probe geconfigureerd.')).toBeVisible(); expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1)).toBe(true); const accessibility = await new AxeBuilder({ page }).analyze(); expect(accessibility.violations.filter((violation) => ['serious', 'critical'].includes(violation.impact ?? ''))).toEqual([]); });