- src/muse 新版全模块(装配/共享/上下文/任务运行/作品规划/故事世界/正文写作/审校修订/知识方法/作者经验/效果评测/交付连载/资料研究/正式变更/元数据/接入/基础设施/编排)+ 测试树(单元/契约/集成/架构/迁移/端到端/夹具) - 129 项功能全部实现与自动验证(功能覆盖.json/矩阵),含 W31 补齐的规则与代价/节奏安排/伏笔与承诺 - 旧实现按处置清单退出(702 条中 324 删,保护合同与未迁移条目留存有据);web/app.py 旧工作台退役,新工作台为唯一写入口 - 数据库/旧库迁移:真实旧库内容批次迁移链(端点守卫/PG作品正文映射/质量资产缺省投影) - 运行手册 docs/运行手册.md;W30 本机服务阶段一已运行(infra PG 为正式内容权威) - R2 执行证据与私有运行材料在 .agents.local/改造/R2-20260909/(不入库)
38 lines
1.9 KiB
TypeScript
38 lines
1.9 KiB
TypeScript
import { readFileSync } from "node:fs";
|
||
import { expect, test } from "@playwright/test";
|
||
|
||
test("NC-browser-rule-activation:凭据只打开审阅,作者启用刷新后可明确停用", async ({
|
||
page,
|
||
}, info) => {
|
||
const password = process.env.MUSE_AUTHOR_PASSWORD_FILE;
|
||
const receipt = process.env.MUSE_RULE_CREDENTIAL;
|
||
if (!password || !receipt) throw new Error("需要隔离作者与真实规则验证凭据");
|
||
await page.goto("/review-rules");
|
||
await page.getByLabel("访问口令").fill(readFileSync(password, "utf8").trim());
|
||
await page.getByRole("button", { name: "进入工作台" }).click();
|
||
await page.goto("/review-rules");
|
||
const area = page.getByRole("region", {
|
||
name: "规则 l002 的启用状态",
|
||
exact: true,
|
||
});
|
||
await area.getByRole("button", { name: "核对规则启用状态" }).click();
|
||
await expect(area.getByText(/当前没有生效规则/)).toBeVisible();
|
||
await area.getByLabel("规则验证凭据编号").fill(receipt);
|
||
await area.getByRole("button", { name: "核对凭据并打开启用审阅" }).click();
|
||
await expect(area.getByText(/将启用第 1 版/)).toBeVisible();
|
||
await expect(area.getByText(/当前没有生效规则/)).toBeVisible();
|
||
await area.getByRole("button", { name: "确认启用此版本" }).click();
|
||
await expect(area.getByText(/已启用第 1 版,可用于只读诊断/)).toBeVisible();
|
||
await page.reload();
|
||
await area.getByRole("button", { name: "核对规则启用状态" }).click();
|
||
await expect(area.getByText(/已启用第 1 版/)).toBeVisible();
|
||
await page.screenshot({
|
||
path: info.outputPath("规则确切版本启用.png"),
|
||
fullPage: true,
|
||
});
|
||
await area.getByRole("button", { name: "核对停用依据" }).click();
|
||
await area.getByRole("button", { name: "确认停用此版本" }).click();
|
||
await expect(area.getByText("作者停用决定已保存。")).toBeVisible();
|
||
await expect(area.getByText(/当前没有生效规则/)).toBeVisible();
|
||
});
|