LP6 完善请假采购体验与审批说明
这个提交包含在:
@@ -89,6 +89,7 @@ test("E2E 请假编辑:草稿保存后保留原单并可继续提交", async (
|
||||
|
||||
const draftRow = page.getByRole("row").filter({ hasText: startDate }).first();
|
||||
await expect(draftRow).toContainText("草稿", { timeout: 30_000 });
|
||||
await expect(draftRow).toContainText("草稿可继续编辑", { timeout: 30_000 });
|
||||
|
||||
const updateResponsePromise = page.waitForResponse((response) => {
|
||||
return response.request().method() === "PATCH" && new URL(response.url()).pathname === `/api/leave-requests/${leaveId}` && response.ok();
|
||||
@@ -110,6 +111,7 @@ test("E2E 请假编辑:草稿保存后保留原单并可继续提交", async (
|
||||
await submitLeave(employeeClient.api, leaveId);
|
||||
await page.goto("/leave-requests");
|
||||
await expect(updatedRow).toContainText("审批中", { timeout: 30_000 });
|
||||
await expect(updatedRow).toContainText("当前节点", { timeout: 30_000 });
|
||||
} finally {
|
||||
await employeeClient.dispose();
|
||||
}
|
||||
@@ -157,9 +159,46 @@ test("E2E 请假主链路:草稿 → 提交 → 撤回 + 提交 → 审批", a
|
||||
|
||||
await login(page, EMPLOYEE);
|
||||
await page.goto("/leave-requests");
|
||||
await expect(page.getByRole("row").filter({ hasText: secondDate }).first()).toContainText("已通过", { timeout: 30_000 });
|
||||
const approvedRow = page.getByRole("row").filter({ hasText: secondDate }).first();
|
||||
await expect(approvedRow).toContainText("已通过", { timeout: 30_000 });
|
||||
await expect(approvedRow).toContainText("已通过,系统会按请假结果更新额度和团队状态", { timeout: 30_000 });
|
||||
await expect(page.getByRole("row").filter({ hasText: firstDate }).first()).toContainText("草稿", { timeout: 30_000 });
|
||||
} finally {
|
||||
await employeeClient.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
test("E2E 请假退回说明:审批退回后员工可看到处理意见", async ({ page, workflowDetail }) => {
|
||||
const employeeClient = await createAuthenticatedApiClient(EMPLOYEE);
|
||||
const baseOffset = uniqueFutureOffset(5200);
|
||||
const leaveDate = formatDate(baseOffset);
|
||||
const returnComment = `请补充外出交接安排 ${Date.now()}`;
|
||||
|
||||
try {
|
||||
await login(page, EMPLOYEE);
|
||||
await (await openNavLink(page, "请假")).click();
|
||||
await expect(page.getByRole("heading", { name: "请假申请" })).toBeVisible();
|
||||
|
||||
const leaveId = await createLeaveDraft(page, leaveDate, leaveDate, `Playwright 退回请假 ${Date.now()}`);
|
||||
const submitResult = await submitLeave(employeeClient.api, leaveId);
|
||||
|
||||
await logout(page, EMPLOYEE.name);
|
||||
|
||||
await login(page, MANAGER);
|
||||
await page.goto(`/workflow/tasks/${submitResult.currentTaskId}`);
|
||||
await workflowDetail.assertLoaded();
|
||||
await workflowDetail.returnTask(returnComment);
|
||||
await expect(workflowDetail.summary).toContainText(/状态:(已处理|completed|已完成)/);
|
||||
|
||||
await logout(page, MANAGER.name);
|
||||
|
||||
await login(page, EMPLOYEE);
|
||||
await page.goto("/leave-requests");
|
||||
const returnedRow = page.getByRole("row").filter({ hasText: leaveDate }).first();
|
||||
await expect(returnedRow).toContainText("草稿", { timeout: 30_000 });
|
||||
await expect(returnedRow).toContainText("审批已退回", { timeout: 30_000 });
|
||||
await expect(returnedRow).toContainText(returnComment, { timeout: 30_000 });
|
||||
} finally {
|
||||
await employeeClient.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户