import { expect, test } from "@playwright/test"; test.beforeEach(async ({ page }) => { await page.goto("/onboarding"); // Wait for PGlite to initialize and the form to render await page.getByLabel("Name").waitFor({ timeout: 15000 }); await page.getByLabel("Name").fill("Test User"); 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 }); }); test("add a new contact and see it in the list", async ({ page }) => { await page.getByRole("link", { name: "Kontakte" }).click(); await expect(page).toHaveURL(/kontakte/); await page.getByRole("link", { name: /Neu/ }).click(); await expect(page).toHaveURL(/kontakte\/neu/); await page.getByLabel("Name", { exact: false }).first().fill("Dr. Schmidt"); await page.getByLabel("Stadt").fill("Berlin"); await page.getByRole("button", { name: "Speichern" }).click(); await expect(page).toHaveURL(/\/kontakte$/, { timeout: 10000 }); await expect(page.getByText("Dr. Schmidt")).toBeVisible({ timeout: 10000 }); });