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>
This commit is contained in:
@@ -1,21 +1,32 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
const BASE = 'https://macmini:3007'
|
||||
const PROJECT_ID = '50d16b08-d21c-450a-af62-222f1949acf9' // Kniehebelpresse
|
||||
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 }) => {
|
||||
// Ignore SSL errors
|
||||
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' })
|
||||
// Should not have "Application error"
|
||||
await dismissBanner(page)
|
||||
await page.waitForTimeout(2000)
|
||||
const body = await page.textContent('body')
|
||||
expect(body).not.toContain('Application error')
|
||||
// Should show project name
|
||||
await expect(page.locator('text=Kniehebelpresse')).toBeVisible({ timeout: 10000 })
|
||||
// Should show project name in h1 or sidebar
|
||||
await expect(page.locator('text=Kniehebelpresse').first()).toBeVisible({ timeout: 15000 })
|
||||
})
|
||||
|
||||
test('Components tab loads', async ({ page }) => {
|
||||
@@ -66,13 +77,13 @@ test.describe('IACE Project — All Tabs', () => {
|
||||
expect(body).not.toContain('Application error')
|
||||
})
|
||||
|
||||
test('Interview page loads with 3 modes', async ({ page }) => {
|
||||
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')
|
||||
// Check 3 mode buttons exist
|
||||
await expect(page.locator('text=Interview')).toBeVisible()
|
||||
await expect(page.locator('text=Wizard')).toBeVisible()
|
||||
await expect(page.locator('text=Formular')).toBeVisible()
|
||||
// Interview was redesigned to a form-based flow (Grenzen & Verwendung)
|
||||
await expect(page.locator('text=Grenzen').first()).toBeVisible({ timeout: 10000 })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user