R30-1 R30-9: 建立零人工发布门禁并补齐高频回归

这个提交包含在:
2026-03-23 10:00:26 +08:00
父节点 c17a72830c
当前提交 994d98e74c
共修改 22 个文件,包含 1189 行新增和 41 行删除
+17
查看文件
@@ -1,5 +1,7 @@
import { expect, type Locator, type Page } from "@playwright/test";
import { TEST_IDS } from "./testIds";
export async function openBackupModulesIfNeeded(page: Page) {
const summary = page.locator("summary").filter({ hasText: "备用模块" }).first();
if (await summary.count()) {
@@ -22,3 +24,18 @@ export async function openNavLink(page: Page, name: string | RegExp): Promise<Lo
await expect(link).toBeVisible();
return link;
}
export async function openProfileSettings(page: Page, userDisplayName?: string) {
const profileTrigger = page.getByTestId(TEST_IDS.topbar.profileTrigger).first();
if (await profileTrigger.isVisible().catch(() => false)) {
await profileTrigger.click();
} else if (userDisplayName) {
await page.getByRole("button", { name: userDisplayName, exact: true }).first().click();
} else {
throw new Error("无法定位个人设置入口:缺少 topbar profile trigger");
}
await expect(page.getByRole("menuitem", { name: "个人设置" })).toBeVisible();
await page.getByRole("menuitem", { name: "个人设置" }).click();
await expect(page).toHaveURL(/\/settings\/profile/);
}