import { test, expect } from "@playwright/test"; // Surviving e2e baseline (platform-retrofit PRD): the dev-seed shell must // sign in with seeded credentials (see packages/auth/src/__seeds__/dev.ts) // and sign back out. Runs against `pnpm dev` in dev-seed mode — no Payload. test.describe("auth sign-in", () => { test("signs in with dev-seed credentials and reaches the signed-in shell", async ({ page, }) => { await page.goto("/"); await page.getByLabel("Username").fill("alice"); await page.getByLabel("Password").fill("secret_alice"); await page.getByRole("button", { name: "Sign in" }).click(); await expect(page.getByText("You are signed in.")).toBeVisible(); await page.getByRole("button", { name: "Sign out" }).click(); await expect(page.getByRole("button", { name: "Sign in" })).toBeVisible(); }); test("rejects invalid credentials and keeps the sign-in form", async ({ page, }) => { await page.goto("/"); await page.getByLabel("Username").fill("alice"); await page.getByLabel("Password").fill("not-the-password"); await page.getByRole("button", { name: "Sign in" }).click(); await expect(page.getByText("Invalid username or password.")).toBeVisible(); await expect(page.getByRole("button", { name: "Sign in" })).toBeVisible(); }); });