Some checks failed
Tests / Go Tests (push) Has been cancelled
Tests / Python Tests (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / Go Lint (push) Has been cancelled
Tests / Python Lint (push) Has been cancelled
Tests / Security Scan (push) Has been cancelled
Tests / All Checks Passed (push) Has been cancelled
Security Scanning / Secret Scanning (push) Has been cancelled
Security Scanning / Dependency Vulnerability Scan (push) Has been cancelled
Security Scanning / Go Security Scan (push) Has been cancelled
Security Scanning / Python Security Scan (push) Has been cancelled
Security Scanning / Node.js Security Scan (push) Has been cancelled
Security Scanning / Docker Image Security (push) Has been cancelled
Security Scanning / Security Summary (push) Has been cancelled
CI/CD Pipeline / Go Tests (push) Has been cancelled
CI/CD Pipeline / Python Tests (push) Has been cancelled
CI/CD Pipeline / Website Tests (push) Has been cancelled
CI/CD Pipeline / Linting (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Docker Build & Push (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / CI Summary (push) Has been cancelled
ci/woodpecker/manual/build-ci-image Pipeline was successful
ci/woodpecker/manual/main Pipeline failed
All services: admin-v2, studio-v2, website, ai-compliance-sdk, consent-service, klausur-service, voice-service, and infrastructure. Large PDFs and compiled binaries excluded via .gitignore.
133 lines
5.2 KiB
TypeScript
133 lines
5.2 KiB
TypeScript
/**
|
|
* E2E Tests: SDK Navigation
|
|
*
|
|
* Tests for navigating through the SDK workflow,
|
|
* sidebar functionality, and step transitions.
|
|
*/
|
|
|
|
import { test, expect, selectors, navigateToStep, getStepUrl } from '../fixtures/sdk-fixtures'
|
|
|
|
test.describe('SDK Navigation', () => {
|
|
test('should display SDK dashboard', async ({ sdkPage }) => {
|
|
await expect(sdkPage).toHaveURL(/\/sdk/)
|
|
})
|
|
|
|
test('should navigate to Use Case Workshop', async ({ sdkPage }) => {
|
|
await sdkPage.click('text=Use Case Workshop')
|
|
await expect(sdkPage).toHaveURL('/sdk/advisory-board')
|
|
})
|
|
|
|
test('should navigate through all Phase 1 steps', async ({ sdkPage }) => {
|
|
const phase1Steps = [
|
|
{ id: 'use-case-workshop', url: '/sdk/advisory-board', name: 'Use Case Workshop' },
|
|
{ id: 'screening', url: '/sdk/screening', name: 'System Screening' },
|
|
{ id: 'modules', url: '/sdk/modules', name: 'Compliance Modules' },
|
|
{ id: 'requirements', url: '/sdk/requirements', name: 'Requirements' },
|
|
{ id: 'controls', url: '/sdk/controls', name: 'Controls' },
|
|
{ id: 'evidence', url: '/sdk/evidence', name: 'Evidence' },
|
|
{ id: 'audit-checklist', url: '/sdk/audit-checklist', name: 'Audit Checklist' },
|
|
{ id: 'risks', url: '/sdk/risks', name: 'Risk Matrix' },
|
|
]
|
|
|
|
for (const step of phase1Steps) {
|
|
await navigateToStep(sdkPage, step.id)
|
|
await expect(sdkPage).toHaveURL(step.url)
|
|
// Verify page loaded (no error state)
|
|
await expect(sdkPage.locator('body')).not.toContainText('Error')
|
|
}
|
|
})
|
|
|
|
test('should navigate through all Phase 2 steps', async ({ sdkPage }) => {
|
|
const phase2Steps = [
|
|
{ id: 'ai-act', url: '/sdk/ai-act', name: 'AI Act Klassifizierung' },
|
|
{ id: 'obligations', url: '/sdk/obligations', name: 'Pflichtenübersicht' },
|
|
{ id: 'dsfa', url: '/sdk/dsfa', name: 'DSFA' },
|
|
{ id: 'tom', url: '/sdk/tom', name: 'TOMs' },
|
|
{ id: 'loeschfristen', url: '/sdk/loeschfristen', name: 'Löschfristen' },
|
|
{ id: 'vvt', url: '/sdk/vvt', name: 'Verarbeitungsverzeichnis' },
|
|
{ id: 'consent', url: '/sdk/consent', name: 'Rechtliche Vorlagen' },
|
|
{ id: 'cookie-banner', url: '/sdk/cookie-banner', name: 'Cookie Banner' },
|
|
{ id: 'einwilligungen', url: '/sdk/einwilligungen', name: 'Einwilligungen' },
|
|
{ id: 'dsr', url: '/sdk/dsr', name: 'DSR Portal' },
|
|
{ id: 'escalations', url: '/sdk/escalations', name: 'Escalations' },
|
|
]
|
|
|
|
for (const step of phase2Steps) {
|
|
await navigateToStep(sdkPage, step.id)
|
|
await expect(sdkPage).toHaveURL(step.url)
|
|
await expect(sdkPage.locator('body')).not.toContainText('Error')
|
|
}
|
|
})
|
|
|
|
test('should use next/previous buttons for navigation', async ({ sdkPage }) => {
|
|
// Start at Use Case Workshop
|
|
await navigateToStep(sdkPage, 'use-case-workshop')
|
|
|
|
// Check that prev button is disabled on first step
|
|
const prevButton = sdkPage.locator(selectors.prevButton)
|
|
if (await prevButton.isVisible()) {
|
|
await expect(prevButton).toBeDisabled()
|
|
}
|
|
|
|
// Click next button
|
|
const nextButton = sdkPage.locator(selectors.nextButton)
|
|
if (await nextButton.isVisible()) {
|
|
await nextButton.click()
|
|
await expect(sdkPage).toHaveURL('/sdk/screening')
|
|
}
|
|
})
|
|
|
|
test('sidebar should highlight current step', async ({ sdkPage }) => {
|
|
await navigateToStep(sdkPage, 'requirements')
|
|
|
|
// The current step in sidebar should have active styling
|
|
const sidebarStep = sdkPage.locator(selectors.sidebarStep('requirements'))
|
|
if (await sidebarStep.isVisible()) {
|
|
await expect(sidebarStep).toHaveAttribute('aria-current', 'page')
|
|
}
|
|
})
|
|
})
|
|
|
|
test.describe('SDK Navigation with Demo Data', () => {
|
|
test('should display progress bar with demo data', async ({ withDemoData }) => {
|
|
const progressBar = withDemoData.locator(selectors.progressBar)
|
|
if (await progressBar.isVisible()) {
|
|
// Demo data has completed steps, so progress should be > 0
|
|
const progressValue = await progressBar.getAttribute('aria-valuenow')
|
|
expect(parseInt(progressValue || '0')).toBeGreaterThan(0)
|
|
}
|
|
})
|
|
|
|
test('should show completed steps in sidebar', async ({ withDemoData }) => {
|
|
// With demo data, some steps should be marked as completed
|
|
const sidebar = withDemoData.locator(selectors.sidebar)
|
|
if (await sidebar.isVisible()) {
|
|
// Look for completed step indicators
|
|
const completedSteps = sidebar.locator('[data-completed="true"]')
|
|
const count = await completedSteps.count()
|
|
expect(count).toBeGreaterThan(0)
|
|
}
|
|
})
|
|
})
|
|
|
|
test.describe('Deep Linking', () => {
|
|
test('should load correct step from direct URL', async ({ page }) => {
|
|
// Navigate directly to a specific step
|
|
await page.goto('/sdk/risks')
|
|
await page.waitForLoadState('networkidle')
|
|
|
|
// Page should display Risk Matrix content
|
|
await expect(page).toHaveURL('/sdk/risks')
|
|
})
|
|
|
|
test('should handle invalid step URL gracefully', async ({ page }) => {
|
|
// Navigate to non-existent step
|
|
await page.goto('/sdk/non-existent-step')
|
|
await page.waitForLoadState('networkidle')
|
|
|
|
// Should redirect to dashboard or show 404
|
|
// Verify no crash
|
|
await expect(page.locator('body')).not.toContainText('Unhandled')
|
|
})
|
|
})
|