tests/auth.setup.js
// Runs once before the other projects: sign in through the real UI, then
// save cookies + storage to a file every other test starts from (§75).
import { test as setup, expect } from "@playwright/test";
import { login, USERS } from "./fixtures.js";
setup("sign in as Alice", async ({ page }) => {
await login(page, USERS.alice);
await expect(page.getByRole("list", { name: "Your orders" })).toBeVisible();
await page.context().storageState({ path: "playwright/.auth/alice.json" });
});