R74-A2 A3 A4 压榨试运行自动化空间

这个提交包含在:
2026-04-28 22:06:15 +08:00
父节点 2370a7745e
当前提交 5eeeebcdf7
共修改 13 个文件,包含 611 行新增和 40 行删除
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
import { test, expect } from "../helpers/fixtures";
import { EMPLOYEE, login, logout } from "../helpers/auth";
import { openNavLink } from "../helpers/navigation";
import { openInvoicePool, uploadLiveInvoiceAndWait } from "../helpers/liveInvoiceOcr";
test("手工 live 腾讯 OCR 辅助复核:真实 VAT 发票上传后进入可处理状态", async ({ page }) => {
test.skip(process.env.PLAYWRIGHT_MANUAL !== "1", "仅在显式手工 Playwright 模式下执行");
@@ -12,23 +12,11 @@ test("手工 live 腾讯 OCR 辅助复核:真实 VAT 发票上传后进入可
test.skip(!invoiceFilePath || !existsSync(invoiceFilePath), "需要提供存在的 PLAYWRIGHT_OCR_LIVE_FILE");
await login(page, EMPLOYEE);
await (await openNavLink(page, "票据中心")).click();
await expect(page.getByTestId("invoice-pool-table")).toBeVisible();
await openInvoicePool(page);
await page.getByTestId("invoice-upload-file").setInputFiles(invoiceFilePath);
await page.getByTestId("invoice-upload-submit").click();
await expect.poll(async () => {
const text = await page.getByTestId("invoice-detail-panel").innerText().catch(() => "");
if (text.includes("状态:available")) return "available";
if (text.includes("状态:ocr_failed")) return "ocr_failed";
return "pending_ocr";
}, { timeout: 180_000 }).not.toBe("pending_ocr");
const detailText = await page.getByTestId("invoice-detail-panel").innerText();
if (detailText.includes("状态:ocr_failed")) {
const bannerText = await page.getByTestId("invoice-ocr-status-banner").innerText().catch(() => "OCR 失败");
throw new Error(`live 腾讯 OCR 失败:${bannerText}`);
const result = await uploadLiveInvoiceAndWait(page, invoiceFilePath);
if (result.status === "ocr_failed") {
throw new Error(`live 腾讯 OCR 失败:${result.bannerText || result.detailText}`);
}
await expect(page.getByTestId("invoice-detail-panel")).not.toContainText("发票号:---");