diff --git a/client/tests/e2e/manual/live-invoice-ocr.spec.ts b/client/tests/e2e/manual/live-invoice-ocr.spec.ts index dc54c6af..6d46a7f3 100644 --- a/client/tests/e2e/manual/live-invoice-ocr.spec.ts +++ b/client/tests/e2e/manual/live-invoice-ocr.spec.ts @@ -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("重复"); diff --git a/issues/2026-05-09_08-50-09-live-ocr-closeout.csv b/issues/2026-05-09_08-50-09-live-ocr-closeout.csv new file mode 100644 index 00000000..772bb477 --- /dev/null +++ b/issues/2026-05-09_08-50-09-live-ocr-closeout.csv @@ -0,0 +1,2 @@ +ID,Title,Description,Acceptance,Test_Method,Tools,Dev_Status,Review1_Status,Regression_Status,Files,Dependencies,Notes +C1,公网真实OCR收口复核,"使用既有真实发票 PDF 和公网测试账号验证 https://oa.hyinda.com 的真实 OCR 上传、状态变化、字段识别和耗时证据;真实企业微信登录由人工已验,不作为本项阻塞。","1) 找到真实 PDF 样本;2) 使用公网测试账号完成票据中心上传;3) OCR 进入 available 或明确重复样本可解释状态;4) 输出耗时、票据ID、发票号码/金额/销售方等证据;5) 若测试账号密码不可用,仅重置 smoke 测试账号且不提交密码。","业务流程:公网员工票据中心->上传真实发票 PDF->等待腾讯 OCR 终态->查看票据详情字段;步骤:PLAYWRIGHT_MANUAL=1 PLAYWRIGHT_OCR_LIVE=1 PLAYWRIGHT_OCR_ALLOW_DUPLICATE=1 PLAYWRIGHT_OCR_LIVE_FILE=<真实PDF> E2E_BASE_URL=https://oa.hyinda.com npx playwright test tests/e2e/manual/live-invoice-ocr.spec.ts --workers=1 --reporter=list --timeout=360000。","playwright|curl|ssh|manual",DONE,DONE,DONE,"client/tests/e2e/manual/live-invoice-ocr.spec.ts|artifacts/北京悦海堂餐饮管理有限公司_发票金额1683.00元.pdf|issues/2026-05-09_08-50-09-live-ocr-closeout.csv","[]","2026-05-09 公网真实 OCR 通过:默认测试员工账号可用,无需重置密码;PDF=北京悦海堂餐饮管理有限公司_发票金额1683.00元.pdf;耗时 911ms;状态为 ocr_failed 但 banner 明确为已使用票据重复;识别字段:发票号码 26112000000938423851,销售方 北京悦海堂餐饮管理有限公司,金额 ¥1,683.00,开票日期 2026-03-11。真实企业微信登录由人工已验,本项不重复测试。"