fix: 修复远程catalog变更引入的3个测试失败(数量658→654, canonical链断→V3, 8字段缺type, 3字段widget非法→text, counts.fields 4297→4294, overrides描述与catalog同步)

This commit is contained in:
yu committed 2026-11-03 14:41:08 +08:00
1 parent 8176bf7c75
commit 5b1b41663f
5 files changed
+43 -32

No files matched your search

+2 -2
View File
@@ -3315,14 +3315,14 @@
{ {
"id": "Image_Click_V1", "id": "Image_Click_V1",
"name": "点击图像", "name": "点击图像",
"canonical": "Image_Click_V2", "canonical": "Image_Click_V3",
"status": "hide", "status": "hide",
"reason": "同名旧版本或重复别名,保留执行兼容" "reason": "同名旧版本或重复别名,保留执行兼容"
}, },
{ {
"id": "Image_Click", "id": "Image_Click",
"name": "点击图像", "name": "点击图像",
"canonical": "Image_Click_V2", "canonical": "Image_Click_V3",
"status": "hide", "status": "hide",
"reason": "同名旧版本或重复别名,保留执行兼容" "reason": "同名旧版本或重复别名,保留执行兼容"
}, },
+12 -13
View File
@@ -315,7 +315,7 @@
"description": "图片文件的完整路径,用于匹配或识别;点右侧按钮选择文件" "description": "图片文件的完整路径,用于匹配或识别;点右侧按钮选择文件"
}, },
"accuracy": { "accuracy": {
"description": "填写参数值,支持 ${变量} 引用上游输出", "description": "模板相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。框选的模板与实际界面光照/渲染略有差异时可适当调低,如无特殊需求建议 0.8。",
"placeholder": "输入内容或 ${变量}" "placeholder": "输入内容或 ${变量}"
}, },
"accuracy2": { "accuracy2": {
@@ -345,7 +345,7 @@
"Image_Find_V1": { "Image_Find_V1": {
"fields": { "fields": {
"window_obj": { "window_obj": {
"description": "目标窗口对象;留空则作用于当前活动窗口" "description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择"
}, },
"action": { "action": {
"description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成", "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成",
@@ -356,40 +356,39 @@
"placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}" "placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}"
}, },
"image": { "image": {
"description": "图片文件的完整路径,用于匹配或识别;点右侧按钮选择文件" "description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案"
} }
} }
}, },
"Image_Exists_V1": { "Image_Exists_V1": {
"fields": { "fields": {
"image": { "image": {
"description": "图片文件的完整路径,用于匹配或识别;点右侧按钮选择文件" "description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案"
}, },
"accuracy": { "accuracy": {
"description": "填写参数值,支持 ${变量} 引用上游输出", "description": "相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。建议 0.8~0.9。"
"placeholder": "输入内容或 ${变量}"
} }
} }
}, },
"Image_CropImg": { "Image_CropImg": {
"fields": { "fields": {
"file_path": { "file_path": {
"description": "图片文件的完整路径,用于匹配或识别;点右侧按钮选择文件" "description": "要被裁剪的源图片完整路径——本组件从已有图片文件中裁出区域,不是截屏;截屏请用「截图图像」组件"
}, },
"imagePath": { "imagePath": {
"description": "文件夹的完整路径;点右侧按钮浏览选择,支持 ${变量} 引用" "description": "文件夹的完整路径;点右侧按钮浏览选择,支持 ${变量} 引用"
}, },
"xstart": { "xstart": {
"description": "填写参数值,支持 ${变量} 引用上游输出" "description": "裁剪区域左上角的 x 坐标(图片上的像素)"
}, },
"xend": { "xend": {
"description": "填写参数值,支持 ${变量} 引用上游输出" "description": "裁剪区域右下角的 x 坐标,需大于起点 x"
}, },
"ystart": { "ystart": {
"description": "填写参数值,支持 ${变量} 引用上游输出" "description": "裁剪区域左上角的 y 坐标(图片上的像素)"
}, },
"yend": { "yend": {
"description": "填写参数值,支持 ${变量} 引用上游输出" "description": "裁剪区域右下角的 y 坐标,需大于起点 y"
} }
} }
}, },
@@ -406,7 +405,7 @@
"Image_Click_V3": { "Image_Click_V3": {
"fields": { "fields": {
"window_obj": { "window_obj": {
"description": "目标窗口对象;留空则作用于当前活动窗口" "description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择"
}, },
"action": { "action": {
"description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成", "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成",
@@ -1231,4 +1230,4 @@
} }
} }
} }
} }
+26 -14
View File
@@ -10,7 +10,7 @@
"vendor": 997, "vendor": 997,
"native": 16, "native": 16,
"triggers": 3, "triggers": 3,
"fields": 4297 "fields": 4294
}, },
"groups": [ "groups": [
{ {
@@ -67155,7 +67155,7 @@
"required": false, "required": false,
"defaultValue": "", "defaultValue": "",
"placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}", "placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}",
"description": "截图范围为「框选区域」时生效:点右侧「屏幕框选」在屏幕上框选生成区域坐标", "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成",
"advanced": false, "advanced": false,
"valueTypes": [] "valueTypes": []
}, },
@@ -68037,7 +68037,11 @@
"value": "2" "value": "2"
} }
], ],
"description": "在整个虚拟桌面(含副屏)中查找,或仅在指定窗口范围内查找" "description": "在整个虚拟桌面(含副屏)中查找,或仅在指定窗口范围内查找",
"valueTypes": [
"string"
],
"type": "string"
}, },
{ {
"key": "window_obj", "key": "window_obj",
@@ -68046,7 +68050,8 @@
"displayType": "text-expression", "displayType": "text-expression",
"defaultValue": "", "defaultValue": "",
"required": false, "required": false,
"description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择" "description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择",
"type": "string"
}, },
{ {
"key": "image", "key": "image",
@@ -68055,16 +68060,18 @@
"displayType": "imageSelector", "displayType": "imageSelector",
"defaultValue": "", "defaultValue": "",
"required": true, "required": true,
"description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案" "description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案",
"type": "string"
}, },
{ {
"key": "accuracy", "key": "accuracy",
"label": "模板相似度", "label": "模板相似度",
"widget": "similaritySlider", "widget": "text",
"displayType": "similaritySlider", "displayType": "similaritySlider",
"defaultValue": "0.9", "defaultValue": "0.9",
"required": true, "required": true,
"description": "相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。建议 0.8~0.9。" "description": "相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。建议 0.8~0.9。",
"type": "string"
} }
], ],
"output": { "output": {
@@ -68137,7 +68144,8 @@
"value": "2" "value": "2"
} }
], ],
"description": "在整个虚拟桌面(含副屏)中查找,或仅在指定窗口范围内查找" "description": "在整个虚拟桌面(含副屏)中查找,或仅在指定窗口范围内查找",
"type": "string"
}, },
{ {
"key": "window_obj", "key": "window_obj",
@@ -68146,7 +68154,8 @@
"displayType": "text-expression", "displayType": "text-expression",
"defaultValue": "", "defaultValue": "",
"required": false, "required": false,
"description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择" "description": "目标窗口标题,留空则作用于当前活动窗口;点「选窗口」从可见窗口列表中选择",
"type": "string"
}, },
{ {
"key": "image", "key": "image",
@@ -68155,16 +68164,18 @@
"displayType": "imageSelector", "displayType": "imageSelector",
"defaultValue": "", "defaultValue": "",
"required": true, "required": true,
"description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案" "description": "模板图片文件的完整路径,用于匹配识别;点右侧「屏幕截取」可框选屏幕上的目标图案",
"type": "string"
}, },
{ {
"key": "accuracy", "key": "accuracy",
"label": "模板相似度", "label": "模板相似度",
"widget": "similaritySlider", "widget": "text",
"displayType": "similaritySlider", "displayType": "similaritySlider",
"defaultValue": "0.9", "defaultValue": "0.9",
"required": true, "required": true,
"description": "相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。建议 0.8~0.9。" "description": "相似度阈值(0~1,越大越严格):0.9 表示屏幕上至少 90% 像素与模板一致才算找到。建议 0.8~0.9。",
"type": "string"
}, },
{ {
"key": "timeout", "key": "timeout",
@@ -68173,7 +68184,8 @@
"displayType": "text-expression", "displayType": "text-expression",
"defaultValue": "0", "defaultValue": "0",
"required": false, "required": false,
"description": "大于 0 时在该时间内每隔 0.3 秒重试查找,超时仍未找到才返回 false" "description": "大于 0 时在该时间内每隔 0.3 秒重试查找,超时仍未找到才返回 false",
"type": "string"
} }
], ],
"output": { "output": {
@@ -68669,7 +68681,7 @@
{ {
"key": "accuracy", "key": "accuracy",
"label": "相似度", "label": "相似度",
"widget": "similaritySlider", "widget": "text",
"type": "string", "type": "string",
"displayType": "similaritySlider", "displayType": "similaritySlider",
"required": true, "required": true,
@@ -31,7 +31,7 @@ describe("catalog capability properties", () => {
const excludedIds = new Set(excluded.ids); const excludedIds = new Set(excluded.ids);
const hidden = new Set((duplicates.decisions as Array<{ id: string; status: string; canonical?: string }>).filter((item) => item.status === "hide").map((item) => item.id)); const hidden = new Set((duplicates.decisions as Array<{ id: string; status: string; canonical?: string }>).filter((item) => item.status === "hide").map((item) => item.id));
const visible: CatalogComponent[] = catalog.components.filter((component) => !excludedIds.has(component.id) && !hidden.has(component.id)); const visible: CatalogComponent[] = catalog.components.filter((component) => !excludedIds.has(component.id) && !hidden.has(component.id));
expect(visible).toHaveLength(658); expect(visible).toHaveLength(654);
const ids = visible.map((component) => component.id); const ids = visible.map((component) => component.id);
expect(new Set(ids).size).toBe(ids.length); expect(new Set(ids).size).toBe(ids.length);
@@ -7,8 +7,8 @@ describe("duplicate capability policy", () => {
const decisions = audit.decisions as Array<{ id: string; status: string; canonical?: string }>; const decisions = audit.decisions as Array<{ id: string; status: string; canonical?: string }>;
const kept = decisions.filter((item) => item.status === "keep"); const kept = decisions.filter((item) => item.status === "keep");
const hidden = decisions.filter((item) => item.status === "hide"); const hidden = decisions.filter((item) => item.status === "hide");
expect(kept.length).toBe(658); expect(kept.length).toBe(654);
expect(hidden.length).toBe(236); expect(hidden.length).toBe(240);
expect(audit.editableBefore).toBe(kept.length + hidden.length); expect(audit.editableBefore).toBe(kept.length + hidden.length);
expect(audit.editableAfter).toBe(kept.length); expect(audit.editableAfter).toBe(kept.length);
const keptIds = new Set(kept.map((item) => item.id)); const keptIds = new Set(kept.map((item) => item.id));