|
@@ -28,16 +28,25 @@ test("independent workbench connects, uploads, confirms and saves without a deve
|
|
|
await expect(page.getByRole("button", { name: "停止任务", exact: true })).toBeVisible()
|
|
await expect(page.getByRole("button", { name: "停止任务", exact: true })).toBeVisible()
|
|
|
await page.getByRole("button", { name: "同意并继续", exact: true }).click()
|
|
await page.getByRole("button", { name: "同意并继续", exact: true }).click()
|
|
|
await expect(page.getByRole("button", { name: "同意并继续", exact: true })).toHaveCount(0)
|
|
await expect(page.getByRole("button", { name: "同意并继续", exact: true })).toHaveCount(0)
|
|
|
|
|
+ await expect(page.getByRole("heading", { name: "成果 · 1", exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("研究计划成果.pdf", { exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("没有可保存的工作文件。", { exact: true })).toHaveCount(0)
|
|
|
|
|
+ await page.getByRole("button", { name: "保存成果", exact: true }).click()
|
|
|
|
|
+ await expect(page.getByText("文件已保存。", { exact: true })).toBeVisible()
|
|
|
await page.getByRole("button", { name: "查看工作文件", exact: true }).click()
|
|
await page.getByRole("button", { name: "查看工作文件", exact: true }).click()
|
|
|
await page.getByRole("button", { name: "保存文件", exact: true }).click()
|
|
await page.getByRole("button", { name: "保存文件", exact: true }).click()
|
|
|
await expect(page.getByText("文件已保存。", { exact: true })).toBeVisible()
|
|
await expect(page.getByText("文件已保存。", { exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("没有可保存的工作文件。", { exact: true })).toHaveCount(0)
|
|
|
const calls = await page.evaluate(
|
|
const calls = await page.evaluate(
|
|
|
() => (window as unknown as { paasTestCalls: Record<string, unknown>[] }).paasTestCalls,
|
|
() => (window as unknown as { paasTestCalls: Record<string, unknown>[] }).paasTestCalls,
|
|
|
)
|
|
)
|
|
|
expect(calls.find((value) => value.action === "execute")?.files).toEqual([{ file_id: "file_1", name: "材料.pdf" }])
|
|
expect(calls.find((value) => value.action === "execute")?.files).toEqual([{ file_id: "file_1", name: "材料.pdf" }])
|
|
|
expect(calls.filter((value) => value.action === "execute")).toHaveLength(1)
|
|
expect(calls.filter((value) => value.action === "execute")).toHaveLength(1)
|
|
|
expect(calls.find((value) => value.action === "confirm")).toMatchObject({ approvalID: "approval_1", approved: true })
|
|
expect(calls.find((value) => value.action === "confirm")).toMatchObject({ approvalID: "approval_1", approved: true })
|
|
|
- expect(calls.find((value) => value.action === "download")).toMatchObject({ path: "final/研究计划.pdf" })
|
|
|
|
|
|
|
+ const downloads = calls.filter((value) => value.action === "download")
|
|
|
|
|
+ expect(downloads).toHaveLength(2)
|
|
|
|
|
+ expect(downloads[0]).toMatchObject({ artifactID: "artifact_1", name: "研究计划成果.pdf" })
|
|
|
|
|
+ expect(downloads[1]).toMatchObject({ path: "final/研究计划.pdf" })
|
|
|
await expect(page.getByText("等待人工确认 · run_1", { exact: true })).toHaveCount(0)
|
|
await expect(page.getByText("等待人工确认 · run_1", { exact: true })).toHaveCount(0)
|
|
|
expect(errors).toEqual([])
|
|
expect(errors).toEqual([])
|
|
|
await page.screenshot({ path: "/tmp/lambda-desktop-workbench.png", fullPage: true })
|
|
await page.screenshot({ path: "/tmp/lambda-desktop-workbench.png", fullPage: true })
|
|
@@ -83,6 +92,12 @@ test("task detail keeps one snapshot with overview, activity and technical info"
|
|
|
await expect(page.getByRole("heading", { name: "活动", exact: true })).toBeVisible()
|
|
await expect(page.getByRole("heading", { name: "活动", exact: true })).toBeVisible()
|
|
|
await expect(page.getByRole("heading", { name: "研究计划", exact: true })).toBeVisible()
|
|
await expect(page.getByRole("heading", { name: "研究计划", exact: true })).toBeVisible()
|
|
|
await expect(page.getByText("工具活动 · 2 条", { exact: true })).toBeVisible()
|
|
await expect(page.getByText("工具活动 · 2 条", { exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByRole("heading", { name: "成果 · 1", exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("研究计划成果.pdf", { exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("没有可保存的工作文件。", { exact: true })).toHaveCount(0)
|
|
|
|
|
+ await page.getByRole("button", { name: "查看工作文件", exact: true }).click()
|
|
|
|
|
+ await expect(page.getByRole("button", { name: "保存文件", exact: true })).toBeVisible()
|
|
|
|
|
+ await expect(page.getByText("没有可保存的工作文件。", { exact: true })).toHaveCount(0)
|
|
|
await expect(page.getByRole("group", { name: "待确认事项" })).toBeVisible()
|
|
await expect(page.getByRole("group", { name: "待确认事项" })).toBeVisible()
|
|
|
await expect(page.getByText("是否执行验证?", { exact: true })).toHaveCount(1)
|
|
await expect(page.getByText("是否执行验证?", { exact: true })).toHaveCount(1)
|
|
|
await expect(page.getByText("运行快照", { exact: true })).toHaveCount(0)
|
|
await expect(page.getByText("运行快照", { exact: true })).toHaveCount(0)
|