d3b43250b8
New E2E test specs: - sdk-module-reachability: Tests 40+ SDK routes for 404/crash - scope-profiling: Three customer profiles (Startup/KMU/Enterprise) with screenshots at each step — data NOT cleaned up - document-generator: Template library, categories, recommendations - vendor-transfers: Transfer tab, explanations, adequacy list - isms-assets: Asset register tab, form, CRUD All tests configured to run against https://macmini:3007 Screenshots saved to e2e/test-results/ for manual review Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
/**
|
|
* ISMS Asset Register E2E Test
|
|
*
|
|
* Prueft: Assets-Tab, CRUD, Filter, CSV-Export
|
|
*/
|
|
|
|
import { test, expect } from '@playwright/test'
|
|
|
|
const BASE = process.env.PLAYWRIGHT_BASE_URL || 'https://macmini:3007'
|
|
|
|
test.describe('ISMS — Asset Register', () => {
|
|
test('ISMS page loads with Assets tab', async ({ page }) => {
|
|
await page.goto(`${BASE}/sdk/isms`)
|
|
await page.waitForLoadState('networkidle')
|
|
|
|
// Check that Assets tab exists
|
|
const assetsTab = page.locator('button', { hasText: 'Assets' })
|
|
expect(await assetsTab.isVisible()).toBeTruthy()
|
|
|
|
await page.screenshot({ path: 'e2e/test-results/isms-overview.png' })
|
|
})
|
|
|
|
test('Assets tab shows empty state', async ({ page }) => {
|
|
await page.goto(`${BASE}/sdk/isms`)
|
|
await page.waitForLoadState('networkidle')
|
|
|
|
// Click Assets tab
|
|
const assetsTab = page.locator('button', { hasText: 'Assets' })
|
|
await assetsTab.click()
|
|
await page.waitForTimeout(500)
|
|
|
|
// Check for empty state or asset table
|
|
const body = await page.textContent('body')
|
|
const hasAssets = body?.includes('Gesamt') || false
|
|
|
|
await page.screenshot({ path: 'e2e/test-results/isms-assets-tab.png' })
|
|
expect(hasAssets).toBeTruthy()
|
|
})
|
|
|
|
test('Add asset form is accessible', async ({ page }) => {
|
|
await page.goto(`${BASE}/sdk/isms`)
|
|
await page.waitForLoadState('networkidle')
|
|
|
|
// Click Assets tab
|
|
const assetsTab = page.locator('button', { hasText: 'Assets' })
|
|
await assetsTab.click()
|
|
await page.waitForTimeout(500)
|
|
|
|
// Click "Asset hinzufuegen" button
|
|
const addButton = page.locator('button', { hasText: 'Asset hinzufuegen' })
|
|
if (await addButton.isVisible()) {
|
|
await addButton.click()
|
|
await page.waitForTimeout(300)
|
|
|
|
// Check form fields are visible
|
|
const body = await page.textContent('body')
|
|
expect(body).toContain('Name')
|
|
expect(body).toContain('Kategorie')
|
|
expect(body).toContain('Schutzbedarf')
|
|
|
|
await page.screenshot({ path: 'e2e/test-results/isms-assets-form.png' })
|
|
}
|
|
})
|
|
})
|