文件
PRA-only-demo/packages/rpa-core/src/capabilities/captcha-recon.test.ts
T
yu 5ef797dcc0 feat: 添加算术验证码与字符验证码处理能力
新增算术验证码解析、字符清洗能力及测试文件,注册OCR_CalculationCode和OCR_CommonEnglishNumbersCode两个新能力,补充验证码处理逻辑
2026-11-05 16:48:20 +08:00

21 行
1009 B
TypeScript

import { describe, expect, it } from "vitest";
import { getHandler } from "../engine/registry";
import type { CatalogComponent, FlowNode } from "../types";
import type { RunContext } from "../engine/types";
import "./remaining-core";
const ctx = { signal: new AbortController().signal, log: () => {}, vars: {}, evidenceDir: "D:/office-test2/ocr-test" } as unknown as RunContext;
const node: FlowNode = { id: "smoke", componentId: "smoke", position: { x: 0, y: 0 }, values: {}, options: {} };
describe("算术验证码现状侦察", () => {
const files = ["captcha_0_3p5_q", "captcha_1_12m7_q", "captcha_2_6t4_q", "captcha_3_15p28_q", "captcha_4_9t9_q"];
it("当前 OCR 原始输出", async () => {
for (const f of files) {
const handler = getHandler("OCR_CalculationCode");
const out = await handler!(ctx, node, { path: `D:/office-test2/ocr-test/${f}.png` }, {} as CatalogComponent);
console.log(`[${f}]`, JSON.stringify(out));
}
expect(true).toBe(true);
}, 600000);
});