94ae2fdc01
Root cause: Die Schwingarm-Rundtaktanlage Seite hat Background-Requests (vermutlich Polling oder SSE) die networkidle verhindern → 30s Timeout → alle Schwingarm-Tests schlagen fehl. Fix: waitUntil: 'domcontentloaded' + 3s Wartezeit fuer React-Hydration und API-Fetches. Verifiziert: Schwingarm-Seite laed korrekt mit domcontentloaded (h1: "Schwingarm-Rundtaktanlage"). iace-project-tabs: 10/10, iace-module: Schwingarm-Tests repariert. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
90 lines
3.7 KiB
TypeScript
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: 'domcontentloaded' })
|
|
await dismissBanner(page)
|
|
})
|
|
|
|
test('Overview page loads without error', async ({ page }) => {
|
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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: 'domcontentloaded' })
|
|
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 })
|
|
})
|
|
})
|