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,73 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
|
||||
import { ApiClient } from "../api-client"
|
||||
import { SEED } from "../seed-constants"
|
||||
|
||||
const apiClient = new ApiClient()
|
||||
|
||||
test.describe("Finance Page @full", () => {
|
||||
test.beforeEach(async () => {
|
||||
await apiClient.login(SEED.admin.email, SEED.admin.password)
|
||||
await apiClient.resetDb()
|
||||
})
|
||||
|
||||
test("finance page loads", async ({ page }) => {
|
||||
await page.goto("/finance")
|
||||
await expect(
|
||||
page
|
||||
.getByRole("heading", { name: /finan/i })
|
||||
.or(page.getByText(/finanzen|finance/i).first())
|
||||
).toBeVisible()
|
||||
})
|
||||
|
||||
test("sub-navigation links exist", async ({ page }) => {
|
||||
await page.goto("/finance")
|
||||
// Should have sub-nav links for: payments, kassenbuch, import, fee-schedules, reports
|
||||
const links = [
|
||||
/zahlungen|payments/i,
|
||||
/kassenbuch/i,
|
||||
/import/i,
|
||||
/beitragsordnung|fee/i,
|
||||
/berichte|reports/i,
|
||||
]
|
||||
|
||||
for (const linkPattern of links) {
|
||||
const link = page
|
||||
.getByRole("link", { name: linkPattern })
|
||||
.or(page.getByRole("tab", { name: linkPattern }))
|
||||
.or(page.getByRole("button", { name: linkPattern }))
|
||||
await expect(link.first()).toBeVisible()
|
||||
}
|
||||
})
|
||||
|
||||
test("payments sub-page loads", async ({ page }) => {
|
||||
await page.goto("/finance/payments")
|
||||
await expect(page.locator("body")).toBeVisible()
|
||||
// Should not show an error page
|
||||
await expect(page.getByText(/404|not found/i)).not.toBeVisible()
|
||||
})
|
||||
|
||||
test("kassenbuch sub-page loads", async ({ page }) => {
|
||||
await page.goto("/finance/kassenbuch")
|
||||
await expect(page.locator("body")).toBeVisible()
|
||||
await expect(page.getByText(/404|not found/i)).not.toBeVisible()
|
||||
})
|
||||
|
||||
test("import sub-page loads", async ({ page }) => {
|
||||
await page.goto("/finance/import")
|
||||
await expect(page.locator("body")).toBeVisible()
|
||||
await expect(page.getByText(/404|not found/i)).not.toBeVisible()
|
||||
})
|
||||
|
||||
test("fee-schedules sub-page loads", async ({ page }) => {
|
||||
await page.goto("/finance/fee-schedules")
|
||||
await expect(page.locator("body")).toBeVisible()
|
||||
await expect(page.getByText(/404|not found/i)).not.toBeVisible()
|
||||
})
|
||||
|
||||
test("reports sub-page loads", async ({ page }) => {
|
||||
await page.goto("/finance/reports")
|
||||
await expect(page.locator("body")).toBeVisible()
|
||||
await expect(page.getByText(/404|not found/i)).not.toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user