feat: define SuperAPI binding-level skill forcing
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / platform-infra-gitea-nc01- Failed
Pipelines as Code CI / unidesk-host- Success

This commit is contained in:
pikastech
2026-07-19 12:18:37 +02:00
parent 0908df59ac
commit aa04334e68
3 changed files with 74 additions and 3 deletions
+23 -2
View File
@@ -262,13 +262,34 @@ export default async function superApiManagementSmoke({ page, goto, wait, screen
width: Math.round(rect.width),
};
});
const bindingControls = await dialog.locator(".binding-row").evaluateAll((rows) =>
rows.map((row) => {
const inputs = Array.from(row.querySelectorAll("input[type='checkbox']"));
const enabled = inputs.find((input) => input.getAttribute("aria-label")?.startsWith("启用 "));
const force = inputs.find((input) => input.getAttribute("aria-label")?.startsWith("强制注入 "));
return {
enabledControl: enabled !== undefined,
forceControl: force !== undefined,
forceDisabled: force instanceof HTMLInputElement ? force.disabled : null,
};
}));
const bindingControlsOk = bindingControls.every((row) =>
row.enabledControl && row.forceControl);
const ok = bindingEvidence.placeholder === "请选择要绑定的 Skill"
&& bindingEvidence.visible
&& bindingEvidence.width >= 240;
&& bindingEvidence.width >= 240
&& bindingControlsOk;
if (!ok) addFailure("API Key Skill 下拉框占位符或布局不完整");
const interactionShot = await screenshot("superapi-api-key-bindings.png");
screenshots.push(interactionShot);
interactions.push({ id: item.interaction, ok, ...bindingEvidence, screenshot: interactionShot });
interactions.push({
id: item.interaction,
ok,
...bindingEvidence,
bindingControls,
bindingControlsOk,
screenshot: interactionShot,
});
await dialog.getByLabel("关闭", { exact: true }).click();
if (config.actor === "admin") {
await page.getByRole("button", { name: "注册 API Key", exact: true }).click();