muse-agent-example/web/tests/旅程/具体改进.spec.ts
zizi 9e6f1c4481 R2 改造交付:新版模块化单体全量成果
- src/muse 新版全模块(装配/共享/上下文/任务运行/作品规划/故事世界/正文写作/审校修订/知识方法/作者经验/效果评测/交付连载/资料研究/正式变更/元数据/接入/基础设施/编排)+ 测试树(单元/契约/集成/架构/迁移/端到端/夹具)
- 129 项功能全部实现与自动验证(功能覆盖.json/矩阵),含 W31 补齐的规则与代价/节奏安排/伏笔与承诺
- 旧实现按处置清单退出(702 条中 324 删,保护合同与未迁移条目留存有据);web/app.py 旧工作台退役,新工作台为唯一写入口
- 数据库/旧库迁移:真实旧库内容批次迁移链(端点守卫/PG作品正文映射/质量资产缺省投影)
- 运行手册 docs/运行手册.md;W30 本机服务阶段一已运行(infra PG 为正式内容权威)
- R2 执行证据与私有运行材料在 .agents.local/改造/R2-20260909/(不入库)
2026-09-15 12:47:42 +08:00

71 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { readFileSync, writeFileSync } from "node:fs";
import { expect, test } from "@playwright/test";
test("NC-browser-concrete-improvement:真实反馈到具体方法提案且无凭据不启用", async ({
page,
}, info) => {
const password = process.env.MUSE_AUTHOR_PASSWORD_FILE;
const fid = process.env.MUSE_FEEDBACK_ID;
if (!password || !fid) throw new Error("需要隔离反馈和作者口令");
const errors: string[] = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.goto("/");
await page.getByLabel("访问口令").fill(readFileSync(password, "utf8").trim());
await page.getByRole("button", { name: "进入工作台" }).click();
await page.goto(`/feedback/${fid}`);
await page.getByRole("link", { name: "用这条反馈提出具体改进 →" }).click();
await page.getByLabel("改进标题").fill("浏览器具体改进");
await page
.getByLabel("需要验证的改变")
.fill("检验物件回收方法是否改善承接。");
await page
.getByLabel("具体方法版本")
.selectOption({ label: "启用桥接方法 · 第1版" });
const response = page.waitForResponse(
(r) =>
r.url().endsWith("/api/v1/improvements") &&
r.request().method() === "POST",
);
await page.getByRole("button", { name: "保存具体提案" }).click();
const res = await response;
expect(res.status()).toBe(200);
writeFileSync(
info.outputPath("实际改进.json"),
JSON.stringify(await res.json()),
);
await expect(
page.getByRole("heading", { name: "浏览器具体改进", exact: true }),
).toBeVisible();
const activate = page.getByRole("button", { name: "确认启用已测版本" });
await expect(activate).toBeDisabled();
await page.getByLabel("已测版本凭据").fill("not-qualified");
await page.getByRole("button", { name: "核对启用依据" }).click();
await expect(
page.getByRole("region", { name: "目标操作" }).getByRole("status"),
).toContainText("不合法");
await expect(activate).toBeDisabled();
await expect(page.getByText("当前目标状态:已确认,尚未启用")).toBeVisible();
const observations = page.getByRole("region", { name: "长期观察" });
await observations
.getByLabel("观察原话")
.fill("本次费用尚未记录,人审耗时明确为零。");
await observations.getByLabel("人审耗时(秒)").fill("0");
await observations.getByRole("button", { name: "保存观察" }).click();
await expect(observations.getByRole("status")).toContainText("观察已保存");
await expect(
observations
.getByRole("row")
.filter({ hasText: "费用(美元)" })
.getByRole("cell"),
).toHaveText(["未记录", "0", "1"]);
await page.screenshot({
path: info.outputPath("具体改进.png"),
fullPage: true,
});
await page.reload();
await expect(
page.getByRole("heading", { name: "浏览器具体改进", exact: true }),
).toBeVisible();
expect(errors).toEqual([]);
});