Files
tpf/e2e/onboarding.spec.ts
Felix Förtsch c31948b997 add playwright e2e tests for onboarding, contact tracker
- install playwright, configure for chromium with vite dev server
- add onboarding flow test: redirect, form fill, navigation to prozess
- add contact tracker test: create contact, verify in list
- fix onboarding form navigating to /onboarding instead of /prozess
- fix date rendering crash in contact list (cast datum to text)
- exclude @electric-sql/pglite from vite optimizeDeps (WASM bundle)
- add test-results/, playwright-report/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:42:00 +01:00

19 lines
691 B
TypeScript

import { expect, test } from "@playwright/test";
test("onboarding flow redirects new user and saves profile", async ({
page,
}) => {
await page.goto("/");
// PGlite WASM initialization takes time; wait for the redirect to complete
await expect(page).toHaveURL(/onboarding/, { timeout: 15000 });
await page.getByLabel("Name").fill("Max Mustermann");
await page.getByLabel("PLZ").fill("10115");
await page.getByLabel("Ort").fill("Berlin");
await page.getByLabel("Krankenkasse").fill("TK");
await page.getByRole("button", { name: "Weiter" }).click();
await expect(page).toHaveURL(/prozess/, { timeout: 10000 });
await expect(page.getByText("Dein Fortschritt")).toBeVisible();
});