C1 收口公网真实OCR复核

这个提交包含在:
2026-05-09 08:53:48 +08:00
父节点 485328426a
当前提交 e347580a0d
共修改 2 个文件,包含 20 行新增和 1 行删除
@@ -4,7 +4,7 @@ import { test, expect } from "../helpers/fixtures";
import { EMPLOYEE, login } from "../helpers/auth";
import { openInvoicePool, resolveLiveOcrUser, uploadLiveInvoiceAndWait } from "../helpers/liveInvoiceOcr";
test("手工 live 腾讯 OCR 辅助复核:真实 VAT 发票上传后进入可处理状态", async ({ page }) => {
test("手工 live 腾讯 OCR 辅助复核:真实 VAT 发票上传后进入可处理状态", async ({ page }, testInfo) => {
test.skip(process.env.PLAYWRIGHT_MANUAL !== "1", "仅在显式手工 Playwright 模式下执行");
test.skip(process.env.PLAYWRIGHT_OCR_LIVE !== "1", "仅在显式 live OCR 辅助复核模式下执行");
@@ -17,6 +17,23 @@ test("手工 live 腾讯 OCR 辅助复核:真实 VAT 发票上传后进入可
await openInvoicePool(page);
const result = await uploadLiveInvoiceAndWait(page, invoiceFilePath);
const evidence = {
status: result.status,
durationMs: result.durationMs,
invoiceId: result.invoiceId,
invoiceCode: result.invoiceCode,
invoiceNumber: result.invoiceNumber,
sellerName: result.sellerName,
totalAmount: result.totalAmount,
invoiceDate: result.invoiceDate,
bannerText: result.bannerText,
};
console.log(`[live-ocr] ${JSON.stringify(evidence)}`);
await testInfo.attach("live-ocr-result.json", {
body: JSON.stringify(evidence, null, 2),
contentType: "application/json",
});
if (result.status === "ocr_failed") {
const allowDuplicate = process.env.PLAYWRIGHT_OCR_ALLOW_DUPLICATE === "1";
const duplicateDetected = `${result.bannerText}\n${result.detailText}`.includes("重复");