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
这个提交包含在:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户