import { expect, test } from "@playwright/test" test.describe("Authentication", () => { test("should show login page", async ({ page }) => { await page.goto("/login") await expect(page).toHaveTitle(/登录|Login/i) }) test("should show register page", async ({ page }) => { await page.goto("/register") await expect(page).toHaveTitle(/注册|Register/i) }) test("should show privacy policy", async ({ page }) => { await page.goto("/privacy") await expect(page.locator("body")).toContainText(/隐私/) }) test("should show terms", async ({ page }) => { await page.goto("/terms") await expect(page.locator("body")).toContainText(/协议/) }) test("should redirect to login when not authenticated", async ({ page }) => { await page.goto("/dashboard") await expect(page).toHaveURL(/\/login/) }) })