fix: use runtime registry in app system acceptance
This commit is contained in:
parent
0132871885
commit
927b18551f
@ -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];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user