import { expect, test } from "@playwright/test"; test.describe("Frontend", () => { test("guests see the landing page", async ({ page }) => { await page.goto("/"); await expect(page).toHaveTitle(/Polaris Task Force/); await expect(page.getByRole("heading", { level: 1 })).toHaveText("Polaris Task Force"); await expect(page.getByRole("link", { name: "Log in to access the portal" })).toBeVisible(); }); test("a user can log in and reach the dashboard", async ({ page }) => { await page.goto("/login"); await page.getByLabel("Username").fill("dev"); await page.getByLabel("Password").fill("Test123"); await page.getByRole("button", { name: "Log in" }).click(); await page.waitForURL((url) => !url.pathname.startsWith("/login"), { timeout: 30_000 }); await expect(page.getByRole("heading", { level: 1 })).toContainText("Welcome back, J. Fraley"); }); });