test: 相对位置冒烟缺少本机夹具时自动跳过
This commit is contained in:
parent
c90584670d
commit
f0fca2ebfe
@ -1,3 +1,4 @@
|
|||||||
|
import { existsSync } from "node:fs";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { getHandler } from "../engine/registry";
|
import { getHandler } from "../engine/registry";
|
||||||
import type { CatalogComponent, FlowNode } from "../../shared/types";
|
import type { CatalogComponent, FlowNode } from "../../shared/types";
|
||||||
@ -13,8 +14,13 @@ const ctx = {
|
|||||||
} as unknown as RunContext;
|
} as unknown as RunContext;
|
||||||
|
|
||||||
const node = { id: "smoke-rp", componentId: "Image_RelativePosition", position: { x: 0, y: 0 }, values: {}, options: {} };
|
const node = { id: "smoke-rp", componentId: "Image_RelativePosition", position: { x: 0, y: 0 }, values: {}, options: {} };
|
||||||
|
const relativePositionFixtures = [
|
||||||
|
"D:/office-test2/ocr-test/general.png",
|
||||||
|
"D:/office-test2/ocr-test/order-template.png",
|
||||||
|
];
|
||||||
|
const relativePositionFixturesReady = relativePositionFixtures.every((file) => existsSync(file));
|
||||||
|
|
||||||
describe("对比图像相对位置冒烟", () => {
|
describe.skipIf(!relativePositionFixturesReady)("对比图像相对位置冒烟", () => {
|
||||||
it("小图在大图中命中并返回坐标", async () => {
|
it("小图在大图中命中并返回坐标", async () => {
|
||||||
const handler = getHandler("Image_RelativePosition");
|
const handler = getHandler("Image_RelativePosition");
|
||||||
expect(handler).toBeTruthy();
|
expect(handler).toBeTruthy();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user