test: add full-stack Playwright integration test infrastructure
Sprint 12 Phase 2: Real integration tests with seed DB - R__seed_test_data.sql (Flyway repeatable, 7 members, strains, batches, docs, board, events) - TestResetController (profile-gated per-test DB reset) - docker-compose.test.yml (self-contained, tmpfs Postgres) - Dockerfile.playwright (v1.60.0, pre-installed deps) - 13 integration spec files, 70+ test cases (@smoke + @full) - seed-constants.ts, selectors.ts, api-client.ts test helpers
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
|
||||
import { ApiClient } from "../api-client"
|
||||
import { SEED } from "../seed-constants"
|
||||
|
||||
const apiClient = new ApiClient()
|
||||
|
||||
test.describe("Compliance Dashboard @full", () => {
|
||||
test.beforeEach(async () => {
|
||||
await apiClient.login(SEED.admin.email, SEED.admin.password)
|
||||
await apiClient.resetDb()
|
||||
})
|
||||
|
||||
test("compliance dashboard loads", async ({ page }) => {
|
||||
await page.goto("/compliance")
|
||||
// Page should load without error
|
||||
await expect(
|
||||
page
|
||||
.getByText(/compliance|konformität/i)
|
||||
.first()
|
||||
.or(page.getByRole("heading").first())
|
||||
).toBeVisible()
|
||||
})
|
||||
|
||||
test("shows area status cards", async ({ page }) => {
|
||||
await page.goto("/compliance")
|
||||
// Should display compliance areas: KCANG, FINANCE, DSGVO, VEREIN
|
||||
await expect(page.getByText(/kcang/i)).toBeVisible()
|
||||
await expect(page.getByText(/finan/i).first()).toBeVisible()
|
||||
await expect(page.getByText(/dsgvo|datenschutz/i).first()).toBeVisible()
|
||||
await expect(page.getByText(/verein/i).first()).toBeVisible()
|
||||
})
|
||||
|
||||
test("overdue deadlines highlighted", async ({ page }) => {
|
||||
await page.goto("/compliance")
|
||||
// EÜR Abgabe should be overdue and highlighted
|
||||
await expect(
|
||||
page.getByText(/EÜR/i).or(page.getByText(/überfällig|overdue/i).first())
|
||||
).toBeVisible()
|
||||
|
||||
// Overdue items should have visual distinction (red text, warning badge, etc.)
|
||||
const overdueIndicator = page
|
||||
.locator("[data-testid*='overdue']")
|
||||
.or(page.locator(".text-destructive, .text-red, [class*='overdue']"))
|
||||
.first()
|
||||
|
||||
if (await overdueIndicator.isVisible()) {
|
||||
await expect(overdueIndicator).toBeVisible()
|
||||
}
|
||||
})
|
||||
|
||||
test("upcoming deadlines show days remaining", async ({ page }) => {
|
||||
await page.goto("/compliance")
|
||||
// Should display upcoming deadlines with days remaining
|
||||
await expect(
|
||||
page
|
||||
.getByText(/tag|day/i)
|
||||
.first()
|
||||
.or(page.locator("[data-testid*='deadline']").first())
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user