From 927b18551fcbeb7190e52f849209b7a840d84acf Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Mon, 2 Nov 2026 13:24:48 +0800 Subject: [PATCH] fix: use runtime registry in app system acceptance --- scripts/app-system-tests.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/app-system-tests.mjs b/scripts/app-system-tests.mjs index bfe9939..6ed04f3 100644 --- a/scripts/app-system-tests.mjs +++ b/scripts/app-system-tests.mjs @@ -47,9 +47,13 @@ export async function validator() { export async function verifyBundle(catalog = staticCatalog()) { const { manifest, groups } = readBundle(); - const expected = catalog.components.filter(c => c.group === "app" && c.registered).map(c => c.id).sort(); + const expected = catalog.components.filter(c => c.group === "app" && (c.registered || c.implemented)).map(c => c.id).sort(); const actual = groups.flatMap(g => g.entry.components).sort(); - if (groups.length !== 13 || actual.length !== 50 || new Set(actual).size !== 50 || JSON.stringify(actual) !== JSON.stringify(expected)) throw new Error("流程包与当前 50 项验收清单不一致,请重新生成并核对覆盖范围。"); + if (groups.length !== 13 || actual.length !== 50 || new Set(actual).size !== 50 || JSON.stringify(actual) !== JSON.stringify(expected)) { + const expectedOnly = expected.filter(id => !actual.includes(id)); + const actualOnly = actual.filter(id => !expected.includes(id)); + throw new Error(`流程包与当前 50 项验收清单不一致;expectedOnly=${JSON.stringify(expectedOnly)};actualOnly=${JSON.stringify(actualOnly)}`); + } const validateFlow = await validator(); const validation = {}; for (const { flow, entry } of groups) { @@ -248,6 +252,9 @@ export async function runSafe(outputDirectory, checkUi = false) { const info = await evaluate(page, "window.rpa.app.info()"); if (path.resolve(info.userData).toLowerCase() !== profile.toLowerCase()) throw new Error("隔离用户目录不匹配,已拒绝执行测试。"); const catalog = await evaluate(page, "window.rpa.catalog.get()"); + const runtime = await evaluate(page, "window.rpa.run.capabilities()"); + const registered = new Set(runtime.ids || []); + for (const component of catalog.components) component.registered = registered.has(component.id) || registered.has(component.functionName); const checked = await verifyBundle(catalog); for (const { flow, entry } of checked.groups) { const issues = checked.validation[entry.id];