R69 完成业务验收与会话稳定性修复

这个提交包含在:
2026-04-26 21:02:00 +08:00
父节点 63acc2db92
当前提交 87316044d1
共修改 15 个文件,包含 158 行新增和 21 行删除
+12 -6
查看文件
@@ -41,9 +41,8 @@ test("E2E 采购主链路:员工提单→经理审批→财务归档", async (
data: { purchaseRequest: { id: string } };
};
const purchaseRequestId = createPayload.data.purchaseRequest.id;
await page.waitForResponse(
(response) => response.request().method() === "GET" && new URL(response.url()).pathname === `/api/purchase-requests/${purchaseRequestId}`,
);
await page.goto(`/purchase-requests?id=${purchaseRequestId}`);
await expect(page).toHaveURL(new RegExp(`id=${purchaseRequestId}`));
await expect(page.getByTestId("purchase-title")).toBeVisible();
await page.getByTestId("purchase-title").fill(title);
@@ -51,14 +50,21 @@ test("E2E 采购主链路:员工提单→经理审批→财务归档", async (
await selectFirstBusinessOption(page.getByTestId("purchase-cost-center"));
await selectFirstBusinessOption(page.getByTestId("purchase-supplier"));
await selectFirstBusinessOption(page.getByTestId("purchase-document-category"));
await page.getByTestId("purchase-add-item").click();
await page.locator('[data-testid^="purchase-item-description-"]').first().fill("Playwright Laptop");
const itemDescriptionInputs = page.locator('[data-testid^="purchase-item-description-"]');
if (!(await itemDescriptionInputs.first().isVisible().catch(() => false))) {
await page.getByTestId("purchase-add-item").click();
}
await expect(itemDescriptionInputs.first()).toBeVisible({ timeout: 30_000 });
await itemDescriptionInputs.first().fill("Playwright Laptop");
await page.locator('[data-testid^="purchase-item-quantity-"]').first().fill("2");
await page.locator('[data-testid^="purchase-item-unit-price-"]').first().fill("100");
const submitResponsePromise = page.waitForResponse(
(response) => response.request().method() === "POST" && /\/api\/purchase-requests\/[^/]+\/submit$/.test(new URL(response.url()).pathname),
(response) =>
response.request().method() === "POST" &&
new URL(response.url()).pathname === `/api/purchase-requests/${purchaseRequestId}/submit`,
);
await page.getByTestId("purchase-submit").click();
const submitResponse = await submitResponsePromise;