feat: 统一研究模块表格布局与详情交互

This commit is contained in:
yuxuanhui
2026-09-09 09:29:30 +08:00
parent f6c2dcead8
commit 20645d6d17
19 changed files with 1693 additions and 1243 deletions
+3 -3
View File
@@ -89,7 +89,7 @@ test("目录筛选、双层详情、完整输入、排除、备注与刷新", as
const fields = page.getByRole("dialog", { name: "数据字段", exact: true });
await expect(fields).toBeVisible();
await expect(fields).toContainText("全部 123 个字段");
expect((await fields.boundingBox())!.width).toBeCloseTo(1080, 0);
expect((await fields.boundingBox())!.width).toBeCloseTo(864, 0);
await page.getByLabel("搜索字段").fill("字段 12");
await expect(fields.getByRole("button", { name: /TEST 字段/ })).toHaveCount(
3,
@@ -99,7 +99,7 @@ test("目录筛选、双层详情、完整输入、排除、备注与刷新", as
.click();
const detail = page.getByRole("dialog", { name: "字段详情", exact: true });
await expect(detail).toContainText("FUTURE_TYPE");
expect((await detail.boundingBox())!.width).toBeCloseTo(432, 0);
expect((await detail.boundingBox())!.width).toBeCloseTo(864, 0);
await page.getByLabel("研究备注", { exact: true }).fill("保留字段研究假设");
await page.getByRole("button", { name: "保存备注", exact: true }).click();
await expect(page.getByText("研究备注已保存")).toBeVisible();
@@ -173,7 +173,7 @@ test("窄屏抽屉、键盘隔离和研究范围切换", async ({ page }) => {
await openFields(page);
const fields = page.getByRole("dialog", { name: "数据字段", exact: true });
await expect(fields).toBeVisible();
expect((await fields.boundingBox())!.width).toBeCloseTo(390, 0);
expect((await fields.boundingBox())!.width).toBeCloseTo(234, 0);
await page
.getByRole("button", { name: "TEST 字段 000", exact: true })
.click();
+3 -2
View File
@@ -19,7 +19,7 @@ test("native QuantFlow canvas saves versions, branches and restores artifacts",
.getByRole("button", { name: "QuantFlow", exact: true })
.click();
await expect(
page.getByRole("heading", { name: "QuantFlow", exact: true }),
page.getByRole("region", { name: "QuantFlow", exact: true }),
).toBeVisible();
await page.request.put("/api/v1/account/credentials", {
headers,
@@ -114,6 +114,7 @@ test("native QuantFlow canvas saves versions, branches and restores artifacts",
})
).json();
await page.reload();
await page.getByRole("button", { name: "新建流程", exact: true }).click();
await page.getByLabel("流程名称", { exact: true }).fill("画布原生研究");
async function add(kind: string, label: string) {
await page.getByLabel("新增节点类型").selectOption(kind);
@@ -179,7 +180,7 @@ test("native QuantFlow canvas saves versions, branches and restores artifacts",
.getByRole("option")
.filter({ hasText: fixed.id.slice(0, 8) })
.click();
await page.getByRole("heading", { name: "QuantFlow", exact: true }).click();
await page.getByLabel("自动研究假设").click();
for (const [label, value] of [
["最大轮数", "1"],
["最大模拟条目数", "2"],
+10 -6
View File
@@ -19,7 +19,7 @@ test("finite pipeline confirms scope and budget, executes native steps and resto
.getByRole("button", { name: "研究流水线", exact: true })
.click();
await expect(
page.getByRole("heading", { name: "研究流水线", exact: true }),
page.getByRole("region", { name: "研究流水线", exact: true }),
).toBeVisible();
await page.request.put("/api/v1/account/credentials", {
headers,
@@ -94,6 +94,7 @@ test("finite pipeline confirms scope and budget, executes native steps and resto
).ok(),
).toBe(true);
await page.reload();
await page.getByRole("button", { name: "新建自动研究", exact: true }).click();
await page.getByLabel("自动研究名称").fill("浏览器有限研究");
await page.getByLabel("自动研究假设").fill("研究排名稳定性");
await page.getByRole("combobox", { name: "自动研究固定输入" }).click();
@@ -101,7 +102,7 @@ test("finite pipeline confirms scope and budget, executes native steps and resto
.getByRole("option")
.filter({ hasText: fixed.id.slice(0, 8) })
.click();
await page.getByRole("heading", { name: "研究流水线", exact: true }).click();
await page.getByLabel("自动研究名称").click();
for (const [label, value] of [
["最大轮数", "1"],
["最大模拟条目数", "2"],
@@ -110,16 +111,16 @@ test("finite pipeline confirms scope and budget, executes native steps and resto
])
await page.getByLabel(label, { exact: true }).fill(value);
await page.getByRole("button", { name: "核对并启动研究" }).click();
await expect(page.getByRole("dialog", {name: "确认自动研究授权"})).toContainText(
"最多 1 轮、2 条模拟、2 次模型调用",
);
await expect(
page.getByRole("dialog", { name: "确认自动研究授权" }),
).toContainText("最多 1 轮、2 条模拟、2 次模型调用");
const started = page.waitForResponse(
(r) =>
r.url().endsWith("/research/flows/runs") &&
r.request().method() === "POST",
);
await page
.getByRole("dialog", {name: "确认自动研究授权"})
.getByRole("dialog", { name: "确认自动研究授权" })
.getByRole("button", { name: "confirm", exact: true })
.click();
const response = await started;
@@ -143,6 +144,9 @@ test("finite pipeline confirms scope and budget, executes native steps and resto
expect(completed.model_calls_used).toBe(2);
expect(completed.steps).toHaveLength(8);
await page.reload();
await page
.getByRole("button", { name: "浏览器有限研究", exact: true })
.click();
await expect(
page.getByRole("region", { name: "研究运行详情" }),
).toContainText("浏览器有限研究");
+4 -2
View File
@@ -15,7 +15,7 @@ test("feature conversion, saved views and immutable evaluations", async ({
await page.getByLabel("密码", { exact: true }).fill("browser-test-password");
await page.getByRole("button", { name: "进入工作空间" }).click();
await expect(
page.getByRole("heading", { name: "特征工程", exact: true }),
page.getByRole("button", { name: "新建特征方案", exact: true }),
).toBeVisible();
await page.request.put("/api/v1/account/credentials", {
headers,
@@ -62,6 +62,7 @@ test("feature conversion, saved views and immutable evaluations", async ({
).json();
expect(fixed.id).toBeTruthy();
await page.reload();
await page.getByRole("button", { name: "新建特征方案", exact: true }).click();
await page.getByLabel("特征方案名称", { exact: true }).fill("浏览器特征验收");
await page
.getByLabel("特征经济假设", { exact: true })
@@ -71,7 +72,7 @@ test("feature conversion, saved views and immutable evaluations", async ({
.getByRole("option")
.filter({ hasText: fixed.id.slice(0, 8) })
.click();
await page.getByRole("heading", { name: "特征工程", exact: true }).click();
await page.getByLabel("特征方案名称", { exact: true }).click();
await page.getByRole("button", { name: "添加处理步骤" }).click();
await page.getByLabel("步骤 1 名称").fill("横截面排名");
await page.getByLabel("步骤 1 理由").fill("减少尺度影响");
@@ -97,6 +98,7 @@ test("feature conversion, saved views and immutable evaluations", async ({
expect(templates.items[0].provenance.feature.content.input_ids).toEqual([
fixed.id,
]);
await page.keyboard.press("Escape");
await page.getByRole("button", { name: "Alpha 管理", exact: true }).click();
await page.getByLabel("视图名称", { exact: true }).fill("浏览器常用队列");
await page.getByRole("button", { name: "保存为新视图" }).click();