P2AUTO 收口自动化回归和样票门禁

这个提交包含在:
2026-05-16 20:53:08 +08:00
父节点 7a59fd715f
当前提交 edabce8561
共修改 7 个文件,包含 387 行新增和 8 行删除
+15 -4
查看文件
@@ -6,6 +6,7 @@ import { TEST_IDS } from "./helpers/testIds";
test.use({ serviceWorkers: "block" });
const ADMIN = { identifier: "[email protected]", password: "AdminPassword1234", name: "Admin" };
const MANAGER = { identifier: "[email protected]", password: "ManagerPassword1234", name: "Manager" };
function envelope(data: unknown) {
return {
@@ -52,6 +53,16 @@ function mockPasswordLogin(page: import("@playwright/test").Page) {
})),
});
}),
page.route("**/api/auth/refresh", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify(envelope({
accessToken: "test-access-token",
expiresIn: 900,
})),
});
}),
]);
}
@@ -310,9 +321,9 @@ test("Portal 管理视角重排正确,备用模块默认折叠", async ({ page
await mockPortalHome(page, "manager");
await mockAttendanceToday(page);
await mockNotificationList(page);
await mockMe(page, ["admin"], "Admin");
await mockMe(page, ["manager"], "Manager");
await login(page, ADMIN);
await login(page, MANAGER);
await expect(page.locator('[aria-label^="portal-card-"]').first()).toBeVisible();
@@ -326,7 +337,7 @@ test("Portal 管理视角重排正确,备用模块默认折叠", async ({ page
"portal-card-weekly_help",
]);
await expect(page.locator("summary").filter({ hasText: "今日管理重点 / 常用入口" })).toBeVisible();
await expect(page.locator("summary").filter({ hasText: "角色重点 / 常用入口" })).toBeVisible();
await expect(page.getByText("试点观测摘要")).toBeVisible();
await expect(page.getByRole("link", { name: "采购申请" })).not.toBeVisible();
await page.locator("summary").filter({ hasText: "备用模块" }).click();
@@ -419,7 +430,7 @@ test("Portal 域管理角色也进入经理视图", async ({ page }) => {
await login(page, EMPLOYEE);
await expect(page.locator("summary").filter({ hasText: "今日管理重点 / 常用入口" })).toBeVisible();
await expect(page.locator("summary").filter({ hasText: "角色重点 / 常用入口" })).toBeVisible();
await expect(page.locator('[aria-label="portal-card-pending_approvals"]')).toBeVisible();
await expect(page.locator('[aria-label="portal-card-team_presence"]')).toBeVisible();
});
@@ -554,7 +554,7 @@ async function exerciseMobileRendering(page: Page, key: string, label: string) {
const detailMetrics = await expectRenderingStable(page, label, `${key}-mobile-reimbursement-detail`);
expect(detailMetrics.stickyActionsVisible, `${label} sticky actions visible`).toBe(true);
expect(detailMetrics.stickyButtonsSameRow, `${label} sticky buttons same row`).toBe(true);
expect(detailMetrics.stickyButtonMinHeight, `${label} sticky buttons touch height`).toBeGreaterThanOrEqual(44);
expect(Math.round(detailMetrics.stickyButtonMinHeight), `${label} sticky buttons touch height`).toBeGreaterThanOrEqual(44);
}
test.describe("WCM6 企业微信多手机移动渲染稳定化", () => {