HEL-741: restore workflow filters, header and result actions to sample

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-21 22:44:37 +08:00
co-authored by multica-agent
parent 7bf63d0587
commit b6b3a9fed3
8 changed files with 418 additions and 99 deletions
+4 -4
View File
@@ -107,13 +107,13 @@ async function shot(p, name) {
"一位女孩站在海岸,清晨柔光。",
);
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
await p.locator(".modal-panel input[type=number]").first().fill("99");
await p.getByRole("button", { name: "取消", exact: true }).click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
ok(
@@ -155,7 +155,7 @@ async function shot(p, name) {
await p.getByRole("button", { name: "收起提示词", exact: true }).click();
await p.locator("#desk-prompt").fill("这是当前输入,不随历史变化");
// Previously unseen workflow inherits semantic prompts, returning restores its own parameters.
await p.locator(".rail-tools input[type=search]").fill("文生图");
await p.locator(".rail-tools input[type=search]").fill("文生图·回归");
await p
.locator(".workflow-pick")
.filter({ hasText: "文生图·回归" })
@@ -180,7 +180,7 @@ async function shot(p, name) {
await p.locator(".rail-tools input[type=search]").fill("Qwen");
await p.locator(".workflow-pick").first().click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
ok(
+169 -7
View File
@@ -38,6 +38,16 @@ async function metrics(page, sample = false) {
history: ".hist",
actions: "#actbar",
pop: "#paramPop",
search: "#wfSearch",
searchBox: "#wfSearch",
filter: "#taskChips .chip",
meta: ".wfb-meta",
head: ".cc > .ph",
file: "#hdFile",
action: "#actbar > button",
separator: "#actbar .sep",
remove: "#actbar [data-act=del]",
icon: "#genBtn svg",
}
: {
button: ".dock .gen",
@@ -49,11 +59,22 @@ async function metrics(page, sample = false) {
history: ".history-rail",
actions: ".artboard-footer",
pop: ".anchored .modal-panel",
search: ".rail-search input",
searchBox: ".rail-search",
filter: ".filters button",
meta: ".list-meta",
head: ".studio-heading",
file: ".workflow-file",
action: ".artboard-footer > button",
separator: ".action-separator",
remove: ".delete-output",
icon: ".dock .gen svg",
};
return Object.fromEntries(
Object.entries(selectors).map(([key, sel]) => {
let e = document.querySelector(sel);
if (!e) return [key, null];
if (sample && key === "searchBox") e = e.parentElement;
let r = e.getBoundingClientRect(),
s = getComputedStyle(e);
return [
@@ -215,6 +236,47 @@ async function shot(page, name) {
);
})),
);
ok(
`${width}/${theme} R1 搜索与筛选chips几何`,
actual.searchBox.height === sample.searchBox.height &&
actual.searchBox.radius === sample.searchBox.radius &&
actual.search.font === sample.search.font &&
actual.filter.height === sample.filter.height &&
actual.filter.font === sample.filter.font &&
actual.filter.radius === sample.filter.radius,
);
ok(
`${width}/${theme} R2 头行与裸文本文件名`,
actual.head.height === sample.head.height &&
Math.abs(actual.name.height - sample.name.height) < 0.1 &&
actual.name.font === sample.name.font &&
actual.name.weight === sample.name.weight &&
actual.file.font === sample.file.font &&
(await p.locator(".studio-heading button").count()) === 0,
);
ok(
`${width}/${theme} R3 删除钮与分隔线`,
actual.action.radius === sample.action.radius &&
actual.remove.width === 26 &&
actual.remove.height === 26 &&
actual.separator.width === 1 &&
(await p.locator(".action-separator").count()) === 2,
);
ok(
`${width}/${theme} R4 14px图标及主题按钮宽度`,
actual.icon.width === 14 &&
Math.abs(actual.button.width - sample.button.width) <= 0.5,
);
ok(
`${width}/${theme} meta真实未知且无横向溢出`,
(await p
.locator(".list-meta")
.innerText()
.then((t) => t.includes("仓库文件数未知"))) &&
(await p.evaluate(
() => document.documentElement.scrollWidth <= innerWidth,
)),
);
await shot(s, `${width}-${theme}-sample`);
await shot(p, `${width}-${theme}-actual`);
const actions = p.locator(
@@ -223,7 +285,7 @@ async function shot(page, name) {
ok(`${width}/${theme} 八入口显式存在`, (await actions.count()) === 8);
}
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
await pause(250);
@@ -261,7 +323,7 @@ async function shot(page, name) {
ok(
`${width} Escape归还焦点`,
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.evaluate((e) => e === document.activeElement),
);
@@ -290,7 +352,7 @@ async function shot(page, name) {
);
await p.getByRole("button", { name: "返回当前创作", exact: true }).click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
const dialog = p.locator(".anchored .modal-panel");
@@ -303,7 +365,7 @@ async function shot(page, name) {
await p.locator(".anchored input[type=number]").first().fill("234");
await p.getByRole("button", { name: "取消", exact: true }).click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
ok(
@@ -314,7 +376,7 @@ async function shot(page, name) {
await p.locator(".anchored input[type=number]").first().fill("235");
await p.getByRole("button", { name: "保存设置", exact: true }).click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
ok(
@@ -327,7 +389,7 @@ async function shot(page, name) {
.click();
await p.getByRole("button", { name: "保存设置", exact: true }).click();
await p
.getByRole("button", { name: "创作设置", exact: true })
.getByRole("button", { name: "创作设置⌄", exact: true })
.first()
.click();
ok(
@@ -352,9 +414,109 @@ async function shot(page, name) {
await p.getByRole("button", { name: "放大查看", exact: true }).click();
await shot(p, "zoom");
await p.keyboard.press("Escape");
await p.getByRole("button", { name: "更多", exact: true }).click();
await p
.getByRole("button", { name: "作品详情与操作", exact: true })
.click();
await shot(p, "more-actions");
await p.keyboard.press("Escape");
// HEL-741: real filtering, retained entries and deletion of isolated data.
const search = p.getByRole("searchbox", { name: "搜索工作流" });
await search.fill("遮罩图生图测试");
ok(
"搜索更新真实筛选数",
await p
.locator(".list-meta")
.innerText()
.then((t) => t.startsWith("1 个")),
);
const usageGroup = p.getByRole("group", { name: "筛选工作流用途" });
await usageGroup
.getByRole("button", { name: "文生图", exact: true })
.click();
ok(
"用途chips与搜索组合筛选",
(await p.locator(".workflow-pick").count()) === 0,
);
await usageGroup.getByRole("button", { name: "全部", exact: true }).click();
if (
(await p
.locator(".row-actions button")
.last()
.getAttribute("aria-pressed")) !== "true"
)
await p.locator(".row-actions button").last().click();
await usageGroup
.getByRole("button", { name: "☆ 收藏", exact: true })
.click();
ok(
"收藏chip保留真实收藏筛选",
(await p.locator(".workflow-pick").count()) === 1,
);
await shot(p, "filters-favorite");
await usageGroup
.getByRole("button", { name: "☆ 收藏", exact: true })
.click();
await search.fill("");
await p.locator("[data-workflow-details]").click();
await p.getByRole("dialog").waitFor();
await shot(p, "workflow-details");
await p.keyboard.press("Escape");
ok(
"说明入口关闭归还焦点",
await p
.locator("[data-workflow-details]")
.evaluate((e) => e === document.activeElement),
);
await p.getByRole("button", { name: "创作设置⌄", exact: true }).click();
await p.getByRole("button", { name: "专注创作 ⤢", exact: true }).click();
await p.keyboard.press("Escape");
ok("参数层保留专注功能", !(await p.locator(".workflow-rail").isVisible()));
await shot(p, "focus-mode");
await p.getByRole("button", { name: "创作设置⌄", exact: true }).click();
await p.getByRole("button", { name: "退出专注 ⤢", exact: true }).click();
await p.keyboard.press("Escape");
const deleteTarget = (await api("/api/playground/jobs")).find(
(j) => j.workflow_id === mask.id && j.status === "done",
);
assert(deleteTarget);
await p.locator(".delete-output").click();
ok(
"删除图标先确认且不发DELETE",
(await api("/api/playground/jobs")).some((j) => j.id === deleteTarget.id),
);
await shot(p, "delete-confirm");
await p.getByRole("button", { name: "取消", exact: true }).click();
ok(
"删除取消保留记录并归还焦点",
(await api("/api/playground/jobs")).some(
(j) => j.id === deleteTarget.id,
) &&
(await p
.locator(".delete-output")
.evaluate((e) => e === document.activeElement)),
);
await p.locator(".delete-output").click();
await p.getByRole("button", { name: "确认移除", exact: true }).click();
await p.getByRole("button", { name: "撤销", exact: true }).click();
ok(
"确认后沿用撤销窗口",
(await api("/api/playground/jobs")).some((j) => j.id === deleteTarget.id),
);
await shot(p, "delete-undone");
await p.locator(".delete-output").click();
await p.getByRole("button", { name: "确认移除", exact: true }).click();
await wait(
async () =>
!(await api("/api/playground/jobs")).some(
(j) => j.id === deleteTarget.id,
),
);
ok(
"隔离数据确认后真实删除",
!(await api("/api/playground/jobs")).some(
(j) => j.id === deleteTarget.id,
),
);
// Video state evidence across the same three viewports.
await p.getByRole("tab", { name: "视频", exact: true }).click();
await p.locator("#desk-prompt").waitFor();