fix: R27-5 R27-6 收口本地回归基线与E2E适配
这个提交包含在:
@@ -1,5 +1,7 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
|
||||
import { openNavLink } from "./helpers/navigation";
|
||||
|
||||
const EMPLOYEE = { identifier: "[email protected]", password: "EmployeePassword1234", name: "Employee" };
|
||||
const MANAGER = { identifier: "[email protected]", password: "ManagerPassword1234", name: "Manager" };
|
||||
const FINANCE = { identifier: "[email protected]", password: "FinancePassword1234", name: "Finance" };
|
||||
@@ -30,7 +32,7 @@ test("E2E 主链路:登录→报销→待办审批→票据OCR→支付→登
|
||||
// 1) employee: create reimbursement
|
||||
await login(page, EMPLOYEE);
|
||||
|
||||
await page.getByRole("link", { name: "我的报销" }).click();
|
||||
await page.locator("nav").getByRole("link", { name: "我的报销", exact: true }).click();
|
||||
const createResponsePromise = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return response.request().method() === "POST" && url.pathname === "/api/reimbursements" && response.ok();
|
||||
@@ -47,7 +49,7 @@ test("E2E 主链路:登录→报销→待办审批→票据OCR→支付→登
|
||||
const reimbursementSummaryText = await page.getByTestId("reimbursement-summary").innerText();
|
||||
|
||||
// 2) employee: upload invoice and wait OCR
|
||||
await page.getByRole("link", { name: "票据中心" }).click();
|
||||
await (await openNavLink(page, "票据中心")).click();
|
||||
const marker = `MOCK_E2E_${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
||||
await page.getByTestId("invoice-upload-file").setInputFiles({
|
||||
name: `e2e-${Date.now()}.png`,
|
||||
@@ -87,7 +89,7 @@ test("E2E 主链路:登录→报销→待办审批→票据OCR→支付→登
|
||||
await logout(page, EMPLOYEE.name);
|
||||
await login(page, MANAGER);
|
||||
|
||||
await page.getByRole("link", { name: "待我处理" }).click();
|
||||
await (await openNavLink(page, "待我处理")).click();
|
||||
await expect(page.getByTestId("workflow-tasks-table")).toBeVisible();
|
||||
const managerTaskRow = page.getByTestId("workflow-task-row").filter({ hasText: reimbursementId }).first();
|
||||
await expect(managerTaskRow).toBeVisible();
|
||||
@@ -99,7 +101,7 @@ test("E2E 主链路:登录→报销→待办审批→票据OCR→支付→登
|
||||
|
||||
// 6) finance approve + pay
|
||||
await login(page, FINANCE);
|
||||
await page.getByRole("link", { name: "待我处理" }).click();
|
||||
await (await openNavLink(page, "待我处理")).click();
|
||||
const financeTaskRow = page.getByTestId("workflow-task-row").filter({ hasText: reimbursementId }).first();
|
||||
await expect(financeTaskRow).toBeVisible();
|
||||
await financeTaskRow.getByTestId("workflow-task-detail-link").click();
|
||||
|
||||
在新工单中引用
屏蔽一个用户