Add Playwright E2E tests replacing Cypress with MSW integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 16:43:32 +08:00
parent 67a723207f
commit 6e7d010c54
32 changed files with 2276 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
// The Lucia project.
// Copyright 2026-2026 DSP, inc. All rights reserved.
// Authors:
// imacat.yang@dsp.im (imacat), 2026/03/22
import { test, expect } from "@playwright/test";
import { loginWithMSW } from "../helpers";
test.describe("Account Management", () => {
test.beforeEach(async ({ context }) => {
await loginWithMSW(context);
});
test("displays user list on account admin page", async ({ page }) => {
await page.goto("/account-admin");
// Should display users from fixture
await expect(page.getByText("Test Admin").first()).toBeVisible();
await expect(page.getByText("Alice Wang")).toBeVisible();
await expect(page.getByText("Bob Chen")).toBeVisible();
});
test("shows active/inactive status badges", async ({ page }) => {
await page.goto("/account-admin");
await expect(page.getByText("Test Admin").first()).toBeVisible();
// The user list should show status indicators
await expect(page.getByText("testadmin")).toBeVisible();
});
test("navigates to my-account page", async ({ page }) => {
await page.goto("/my-account");
await expect(page).toHaveURL(/\/my-account/);
});
});