Files
breakpilot-compliance/admin-compliance/e2e/specs/iace-project-tabs.spec.ts
T
Benjamin Admin 8a974e1f97 test: CMP E2E tests — Dashboard (20 tests) + EWR/Consent (19 tests)
cmp-dashboard.spec.ts (235 LOC, 20 tests):
- Page load, KPI cards, site selector
- Module navigation grid (8 modules)
- Compliance checklist (9 DSGVO items)
- Cookie category acceptance bars

cmp-ewr-consent.spec.ts (285 LOC, 19 tests):
- First visit banner appearance
- EWR-Only toggle functionality
- Accept all / reject all consent flow
- Consent persistence across reloads
- Cookie FAB button reopens banner
- Consent reset clears everything
- API debug panel verification
- Category toggles (necessary disabled)

Total CMP test coverage: 5 spec files, ~100 test cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-10 11:15:24 +02:00

90 lines
3.7 KiB
TypeScript

import { test, expect } from '@playwright/test'
const BASE = 'https://macmini:3007'
const PROJECT_ID = 'bb7d5b88-469d-401f-a0e3-ae5b867e4a1c' // Kniehebelpresse HP-500
async function dismissBanner(page: import('@playwright/test').Page) {
for (let i = 0; i < 3; i++) {
try {
const btn = page.locator('button', { hasText: 'Nur notwendige Cookies' })
if (await btn.isVisible({ timeout: 2000 })) { await btn.click({ force: true }); await page.waitForTimeout(800) }
else break
} catch { break }
}
}
test.describe('IACE Project — All Tabs', () => {
test.beforeEach(async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'networkidle' })
await dismissBanner(page)
})
test('Overview page loads without error', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'networkidle' })
await dismissBanner(page)
await page.waitForTimeout(2000)
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
// Should show project name in h1 or sidebar
await expect(page.locator('text=Kniehebelpresse').first()).toBeVisible({ timeout: 15000 })
})
test('Components tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/components`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Classification tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/classification`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Hazards tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/hazards`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Mitigations tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/mitigations`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Verification tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/verification`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Evidence tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/evidence`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Tech-File tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/tech-file`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Monitoring tab loads', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/monitoring`, { waitUntil: 'networkidle' })
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
})
test('Interview page loads — Grenzen & Verwendung form', async ({ page }) => {
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/interview`, { waitUntil: 'networkidle' })
await dismissBanner(page)
await page.waitForTimeout(2000)
const body = await page.textContent('body')
expect(body).not.toContain('Application error')
// Interview was redesigned to a form-based flow (Grenzen & Verwendung)
await expect(page.locator('text=Grenzen').first()).toBeVisible({ timeout: 10000 })
})
})