修复 R7E 真机反馈回流与移动入口 WF8-11A R7E-16A R7E-16B BIZ8-12A

这个提交包含在:
2026-05-14 21:53:20 +08:00
父节点 45900e0673
当前提交 5491e922e6
共修改 26 个文件,包含 281 行新增和 56 行删除
@@ -542,6 +542,7 @@ async function mockApis(page: Page, role: RolePreset, notifications: MockNotific
pendingBatchCount: 2,
failedItemCount: 1,
riskCount: 3,
paymentBatchEnabled: false,
href: "/ap-operations",
}
: null,
@@ -765,11 +766,16 @@ async function expectNoMobileShellRegression(page: Page) {
scrollWidth: Math.max(document.documentElement.scrollWidth, document.body?.scrollWidth ?? 0),
visibleTables: Array.from(document.querySelectorAll("table")).filter(isVisible).length,
pcShellGridCount: document.querySelectorAll(".page-shell-grid").length,
clippedStatusSlots: Array.from(document.querySelectorAll<HTMLElement>(".mobile-status-slot"))
.filter(isVisible)
.filter((slot) => slot.scrollWidth > slot.clientWidth + 1)
.map((slot) => slot.innerText.trim()),
};
});
expect(metrics.scrollWidth).toBeLessThanOrEqual(metrics.width + 2);
expect(metrics.visibleTables).toBe(0);
expect(metrics.pcShellGridCount).toBe(0);
expect(metrics.clippedStatusSlots).toEqual([]);
}
async function expectActionTileGapStable(page: Page) {
@@ -1038,10 +1044,13 @@ test.describe("MIF7 移动信息架构整改", () => {
await loginForMobile(financeMobile.page, "finance");
await financeMobile.page.goto("/mobile");
await expect(financeMobile.page.getByTestId("mobile-finance-summary")).toBeVisible();
await expect(financeMobile.page.getByTestId("mobile-finance-summary")).toContainText("待付款");
await expect(financeMobile.page.getByTestId("mobile-finance-summary")).toContainText("台账/导出");
await expect(financeMobile.page.getByTestId("mobile-finance-summary")).toContainText("付款批次未启用");
await expect(financeMobile.page.getByTestId("mobile-finance-disabled-state")).toBeVisible();
await expectNoMobileShellRegression(financeMobile.page);
await financeMobile.page.screenshot({ path: screenshotPath("home-finance-summary"), fullPage: true });
await financeMobile.page.goto("/mobile/me");
await expect(financeMobile.page.getByRole("link", { name: /财务/ })).toBeVisible();
await expectNoMobileShellRegression(financeMobile.page);
} finally {
await financeMobile.context.close();
}
@@ -1052,6 +1061,8 @@ test.describe("MIF7 移动信息架构整改", () => {
await loginForMobile(adminMobile.page, "admin");
await adminMobile.page.goto("/mobile");
await expect(adminMobile.page.getByTestId("mobile-finance-summary")).toHaveCount(0);
await adminMobile.page.goto("/mobile/me");
await expect(adminMobile.page.getByRole("link", { name: /财务/ })).toHaveCount(0);
} finally {
await adminMobile.context.close();
}
@@ -87,7 +87,7 @@ test.describe("R105 pretrial visual acceptance", () => {
await expect(page.getByRole("heading", { name: "票据上传", exact: true })).toBeVisible();
const fileInput = page.getByTestId("mobile-capture-pdf-file");
await expect(fileInput).toHaveAttribute("multiple", "");
await expect(fileInput).toHaveAttribute("accept", "application/pdf");
await expect(fileInput).toHaveAttribute("accept", ".pdf,application/pdf");
await expect(fileInput).not.toHaveAttribute("capture", /.+/);
await expect(page.getByTestId("mobile-capture-upload")).toBeVisible();
await expectNoDesktopTableOnMobile(page);
@@ -146,7 +146,7 @@ test.describe.serial("R110 手机和 PC 路由分流", () => {
await mobile.page.goto("/invoice-pool");
await expect(mobile.page).toHaveURL(/\/mobile\/capture$/);
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toBeAttached();
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toHaveAttribute("accept", "application/pdf");
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toHaveAttribute("accept", ".pdf,application/pdf");
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).not.toHaveAttribute("capture", /.+/);
await expectNoPcShell(mobile.page);
@@ -609,7 +609,7 @@ test.describe("R111 国内报销发票与附件双端体验", () => {
await invoiceDialog.getByRole("button", { name: "上传" }).click();
await expect(invoiceDialog.getByText("选择 PDF 发票")).toBeVisible();
await expect(invoiceDialog.getByText("拍照或选图片")).toHaveCount(0);
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-file")).toHaveAttribute("accept", "application/pdf");
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-file")).toHaveAttribute("accept", ".pdf,application/pdf");
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-file")).not.toHaveAttribute("capture", /.+/);
await mobile.page.getByTestId("reimbursement-invoice-upload-file").setInputFiles({
@@ -454,6 +454,10 @@ async function collectMobileMetrics(page: Page) {
scrollWidth: Math.max(document.documentElement.scrollWidth, document.body?.scrollWidth ?? 0),
tableCount: Array.from(document.querySelectorAll("table")).filter(isVisible).length,
pcShellGridCount: document.querySelectorAll(".page-shell-grid").length,
clippedStatusSlots: Array.from(document.querySelectorAll<HTMLElement>(".mobile-status-slot"))
.filter(isVisible)
.filter((slot) => slot.scrollWidth > slot.clientWidth + 1)
.map((slot) => slot.innerText.trim()),
text: document.body?.innerText ?? "",
};
});
@@ -465,6 +469,7 @@ async function expectMobilePageContract(page: Page) {
expect(metrics.scrollWidth).toBeLessThanOrEqual(metrics.width + 2);
expect(metrics.tableCount).toBe(0);
expect(metrics.pcShellGridCount).toBe(0);
expect(metrics.clippedStatusSlots).toEqual([]);
expect(metrics.text).not.toContain("返回仪表盘");
}
@@ -493,8 +498,14 @@ test.describe("R124 企业微信移动入口矩阵", () => {
await expect(mobile.page.getByTestId("mobile-capture-camera-file")).toHaveCount(0);
await expect(mobile.page.getByTestId("mobile-capture-image-file")).toHaveCount(0);
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toBeAttached();
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toHaveAttribute("accept", "application/pdf");
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).toHaveAttribute("accept", ".pdf,application/pdf");
await expect(mobile.page.getByTestId("mobile-capture-pdf-file")).not.toHaveAttribute("capture", /.+/);
await mobile.page.getByTestId("mobile-capture-pdf-file").setInputFiles({
name: "camera.jpg",
mimeType: "image/jpeg",
buffer: Buffer.from("r124-image"),
});
await expect(mobile.page.getByRole("main").getByText(/发票上传仅支持 PDF,已忽略 camera.jpg/)).toBeVisible();
await mobile.page.getByTestId("mobile-capture-pdf-file").setInputFiles({
name: "r124-invoice.pdf",
mimeType: "application/pdf",