R6-ISSUE-002 对齐报销 E2E 导航口径
这个提交包含在:
@@ -33,6 +33,26 @@ export class ReimbursementDetailPageObject {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.workflowProgress);
|
||||
}
|
||||
|
||||
get invoices() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.invoices);
|
||||
}
|
||||
|
||||
get invoiceAddBtn() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.invoiceAdd);
|
||||
}
|
||||
|
||||
get invoiceDialog() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.invoiceDialog);
|
||||
}
|
||||
|
||||
get invoiceUploadFile() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.invoiceUploadFile);
|
||||
}
|
||||
|
||||
get invoiceUploadSubmit() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.invoiceUploadSubmit);
|
||||
}
|
||||
|
||||
get erpExport() {
|
||||
return this.page.getByTestId(TEST_IDS.reimbursement.erpExport);
|
||||
}
|
||||
@@ -58,6 +78,36 @@ export class ReimbursementDetailPageObject {
|
||||
await expect(this.summary).toContainText(statusText);
|
||||
}
|
||||
|
||||
async uploadInvoicePdf(fileName: string, buffer: Buffer) {
|
||||
await this.invoiceAddBtn.click();
|
||||
await expect(this.invoiceDialog).toBeVisible();
|
||||
|
||||
const uploadResponsePromise = this.page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return response.request().method() === "POST" && url.pathname === "/api/invoice-pool/upload" && response.ok();
|
||||
});
|
||||
|
||||
await this.invoiceUploadFile.setInputFiles({
|
||||
name: fileName,
|
||||
mimeType: "application/pdf",
|
||||
buffer,
|
||||
});
|
||||
await this.invoiceUploadSubmit.scrollIntoViewIfNeeded();
|
||||
await this.invoiceUploadSubmit.click();
|
||||
|
||||
const uploadPayload = (await (await uploadResponsePromise).json()) as { data?: { invoicePoolId?: string | null } };
|
||||
const invoiceId = uploadPayload.data?.invoicePoolId;
|
||||
if (!invoiceId) {
|
||||
throw new Error(`上传发票后未返回票据 ID: ${JSON.stringify(uploadPayload)}`);
|
||||
}
|
||||
|
||||
await expect(this.invoices).toContainText(fileName, { timeout: 90_000 });
|
||||
await this.page.keyboard.press("Escape");
|
||||
await expect(this.invoiceDialog).toHaveCount(0);
|
||||
|
||||
return invoiceId;
|
||||
}
|
||||
|
||||
// 当前 seed 保证 precheck 不触发 warn/manual_review;若 seed 变更,此处需相应调整。
|
||||
async submitReimbursement(acceptConfirm = true) {
|
||||
const dialogPromise = acceptConfirm
|
||||
|
||||
在新工单中引用
屏蔽一个用户