fix(e2e): networkidle → domcontentloaded fuer IACE E2E Tests
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>
This commit is contained in:
@@ -66,9 +66,11 @@ async function dismissCookieBanner(page: Page) {
|
|||||||
|
|
||||||
/** Navigate, wait for async data, and dismiss cookie overlay. */
|
/** Navigate, wait for async data, and dismiss cookie overlay. */
|
||||||
async function goTo(page: Page, path: string) {
|
async function goTo(page: Page, path: string) {
|
||||||
await page.goto(`${BASE}${path}`, { waitUntil: 'networkidle', timeout: 30000 })
|
// Use domcontentloaded instead of networkidle — some IACE pages have
|
||||||
|
// long-running background requests that prevent networkidle from resolving.
|
||||||
|
await page.goto(`${BASE}${path}`, { waitUntil: 'domcontentloaded', timeout: 30000 })
|
||||||
await dismissCookieBanner(page)
|
await dismissCookieBanner(page)
|
||||||
await page.waitForTimeout(2000)
|
await page.waitForTimeout(3000) // Wait for React hydration + API fetches
|
||||||
await dismissCookieBanner(page) // Retry after content load
|
await dismissCookieBanner(page) // Retry after content load
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ async function dismissBanner(page: import('@playwright/test').Page) {
|
|||||||
|
|
||||||
test.describe('IACE Project — All Tabs', () => {
|
test.describe('IACE Project — All Tabs', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'domcontentloaded' })
|
||||||
await dismissBanner(page)
|
await dismissBanner(page)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Overview page loads without error', async ({ page }) => {
|
test('Overview page loads without error', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}`, { waitUntil: 'domcontentloaded' })
|
||||||
await dismissBanner(page)
|
await dismissBanner(page)
|
||||||
await page.waitForTimeout(2000)
|
await page.waitForTimeout(2000)
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
@@ -30,55 +30,55 @@ test.describe('IACE Project — All Tabs', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Components tab loads', async ({ page }) => {
|
test('Components tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/components`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/components`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Classification tab loads', async ({ page }) => {
|
test('Classification tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/classification`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/classification`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Hazards tab loads', async ({ page }) => {
|
test('Hazards tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/hazards`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/hazards`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Mitigations tab loads', async ({ page }) => {
|
test('Mitigations tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/mitigations`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/mitigations`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Verification tab loads', async ({ page }) => {
|
test('Verification tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/verification`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/verification`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Evidence tab loads', async ({ page }) => {
|
test('Evidence tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/evidence`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/evidence`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Tech-File tab loads', async ({ page }) => {
|
test('Tech-File tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/tech-file`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/tech-file`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Monitoring tab loads', async ({ page }) => {
|
test('Monitoring tab loads', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/monitoring`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/monitoring`, { waitUntil: 'domcontentloaded' })
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
expect(body).not.toContain('Application error')
|
expect(body).not.toContain('Application error')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Interview page loads — Grenzen & Verwendung form', async ({ page }) => {
|
test('Interview page loads — Grenzen & Verwendung form', async ({ page }) => {
|
||||||
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/interview`, { waitUntil: 'networkidle' })
|
await page.goto(`${BASE}/sdk/iace/${PROJECT_ID}/interview`, { waitUntil: 'domcontentloaded' })
|
||||||
await dismissBanner(page)
|
await dismissBanner(page)
|
||||||
await page.waitForTimeout(2000)
|
await page.waitForTimeout(2000)
|
||||||
const body = await page.textContent('body')
|
const body = await page.textContent('body')
|
||||||
|
|||||||
Reference in New Issue
Block a user