test(R12-1/P25-6/P26-6/P28-6/P24-6/P29-6): 收口E2E基线与特性矩阵

关联 Issue: R12-1, P25-6, P26-6, P28-6, P24-6, P29-6
这个提交包含在:
2026-03-21 18:04:10 +08:00
父节点 9905c1c79d
当前提交 0826693a8f
共修改 5 个文件,包含 24 行新增和 9 行删除
+1 -1
查看文件
@@ -8,7 +8,7 @@ async function login(page: Page, user: { identifier: string; password: string })
await page.getByTestId("login-identifier").fill(user.identifier);
await page.getByTestId("login-password").fill(user.password);
await page.getByTestId("login-submit").click();
await expect(page).toHaveURL(/\/dashboard/);
await expect(page).toHaveURL(/\/portal/);
}
async function logout(page: Page, userDisplayName: string) {
+1 -1
查看文件
@@ -77,7 +77,7 @@ export async function login(page: Page, user: E2EUser) {
await page.getByTestId("login-identifier").fill(user.identifier);
await page.getByTestId("login-password").fill(user.password);
await page.getByTestId("login-submit").click();
await expect(page).toHaveURL(/\/dashboard/);
await expect(page).toHaveURL(/\/portal/);
}
export async function logout(page: Page, userDisplayName: string) {
+11 -6
查看文件
@@ -9,7 +9,7 @@ async function login(page: Page, user: { identifier: string; password: string })
await page.getByTestId("login-identifier").fill(user.identifier);
await page.getByTestId("login-password").fill(user.password);
await page.getByTestId("login-submit").click();
await expect(page).toHaveURL(/\/dashboard/);
await expect(page).toHaveURL(/\/portal/);
}
async function logout(page: Page, userDisplayName: string) {
@@ -31,15 +31,20 @@ test("E2E 主链路:登录→报销→待办审批→票据OCR→支付→登
await login(page, EMPLOYEE);
await page.getByRole("link", { name: "我的报销" }).click();
const createResponsePromise = page.waitForResponse((response) => {
const url = new URL(response.url());
return response.request().method() === "POST" && url.pathname === "/api/reimbursements" && response.ok();
});
await page.getByTestId("reimbursements-create").click();
await expect(page.getByTestId("reimbursements-table")).toBeVisible();
const firstRow = page.getByTestId("reimbursements-table").getByTestId("reimbursement-row").first();
await expect(firstRow).toBeVisible();
await firstRow.getByTestId("reimbursement-detail-link").click();
const createPayload = (await (await createResponsePromise).json()) as { data?: { id?: string } };
const reimbursementId = createPayload.data?.id;
if (!reimbursementId) {
throw new Error(`创建报销单后未返回 id: ${JSON.stringify(createPayload)}`);
}
await page.goto(`/reimbursements/${reimbursementId}`);
await expect(page.getByTestId("reimbursement-summary")).toBeVisible();
const reimbursementSummaryText = await page.getByTestId("reimbursement-summary").innerText();
const reimbursementId = extractId(reimbursementSummaryText, "报销ID");
// 2) employee: upload invoice and wait OCR
await page.getByRole("link", { name: "票据中心" }).click();
+1 -1
查看文件
@@ -9,7 +9,7 @@ async function login(page: Page, user: { identifier: string; password: string })
await page.getByTestId("login-identifier").fill(user.identifier);
await page.getByTestId("login-password").fill(user.password);
await page.getByTestId("login-submit").click();
await expect(page).toHaveURL(/\/dashboard/);
await expect(page).toHaveURL(/\/portal/);
}
async function logout(page: Page, userDisplayName: string) {