import { expect } from "@playwright/test"; import { test } from "../fixtures"; import { registerAndLogin } from "../helpers"; test("a user can register and log in", async ({ page }) => { await registerAndLogin(page, "alice@example.com"); await expect(page.locator("h1")).toContainText("Grocery lists"); }); test("a user can log out", async ({ page }) => { await registerAndLogin(page, "alice@example.com"); await page.click('button:has-text("Sign out")'); await expect(page).toHaveURL(/\/login/); await expect(page.locator("h1")).toContainText("Welcome back"); });