From 8a974e1f9796ffeb39114e3c55c6aa199e8f50e4 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Sun, 10 May 2026 11:15:24 +0200 Subject: [PATCH] =?UTF-8?q?test:=20CMP=20E2E=20tests=20=E2=80=94=20Dashboa?= =?UTF-8?q?rd=20(20=20tests)=20+=20EWR/Consent=20(19=20tests)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../e2e/specs/cmp-dashboard.spec.ts | 235 +++++++++++++++ .../e2e/specs/cmp-ewr-consent.spec.ts | 285 ++++++++++++++++++ .../e2e/specs/iace-module.spec.ts | 80 ++--- .../e2e/specs/iace-project-tabs.spec.ts | 31 +- 4 files changed, 585 insertions(+), 46 deletions(-) create mode 100644 admin-compliance/e2e/specs/cmp-dashboard.spec.ts create mode 100644 admin-compliance/e2e/specs/cmp-ewr-consent.spec.ts diff --git a/admin-compliance/e2e/specs/cmp-dashboard.spec.ts b/admin-compliance/e2e/specs/cmp-dashboard.spec.ts new file mode 100644 index 0000000..6aed9eb --- /dev/null +++ b/admin-compliance/e2e/specs/cmp-dashboard.spec.ts @@ -0,0 +1,235 @@ +import { test, expect } from '@playwright/test' +import { navigateToSDK, waitForPageLoad } from '../utils/test-helpers' + +/** + * CMP Dashboard E2E Tests + * + * Tests the Consent Management Platform overview page (/sdk/cmp): + * - Page load and header + * - KPI cards (4 cards) + * - Site selector dropdown + * - Module navigation grid (8 modules) + * - Module click navigation + * - Compliance checklist items + * - Cookie category acceptance bars + */ + +test.describe('CMP Dashboard — Page Load', () => { + test.beforeEach(async ({ page }) => { + await navigateToSDK(page, '/cmp') + }) + + test('should load without errors', async ({ page }) => { + await expect(page.getByRole('heading', { name: 'Consent Management Platform' })).toBeVisible({ + timeout: 10000, + }) + }) + + test('should display subtitle text', async ({ page }) => { + await expect(page.getByText('Einwilligungen, Betroffenenrechte und Vendor-Compliance')).toBeVisible() + }) + + test('should have "Banner testen" link to preview', async ({ page }) => { + const link = page.locator('a[href="/sdk/cookie-banner/preview"]', { hasText: 'Banner testen' }) + await expect(link).toBeVisible() + }) +}) + + +test.describe('CMP Dashboard — KPI Cards', () => { + test.beforeEach(async ({ page }) => { + await navigateToSDK(page, '/cmp') + }) + + test('should display 4 KPI cards', async ({ page }) => { + await page.waitForTimeout(1000) + + await expect(page.getByText('Consents gesamt')).toBeVisible() + await expect(page.getByText('Aktive Einwilligungen')).toBeVisible() + await expect(page.getByText('Offene DSR-Anfragen')).toBeVisible() + await expect(page.getByText('Konfigurierte Sites')).toBeVisible() + }) + + test('should show numeric values in KPI cards (not loading forever)', async ({ page }) => { + // Wait for loading to finish (values should not be "..." after 5s) + await page.waitForTimeout(5000) + + const kpiContainer = page.locator('.grid.grid-cols-2.md\\:grid-cols-4') + await expect(kpiContainer).toBeVisible() + + // At least one card should have a numeric value (not "...") + const cardTexts = await kpiContainer.textContent() + expect(cardTexts).toBeTruthy() + // After loading, "..." should be replaced by actual numbers + const hasNumber = /\d/.test(cardTexts || '') + expect(hasNumber).toBeTruthy() + }) +}) + + +test.describe('CMP Dashboard — Site Selector', () => { + test.beforeEach(async ({ page }) => { + await navigateToSDK(page, '/cmp') + await page.waitForTimeout(2000) + }) + + test('should show site selector if sites exist', async ({ page }) => { + // The site selector is a