Files
ssw-mvp/docs/e2e/cases/TC-PROD-002.mjs
T
admin 3247e9fd15 init: ssw-mvp initial commit
- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
2026-08-05 18:29:12 +08:00

59 lines
2.8 KiB
JavaScript
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.
/**
* TC-PROD-002 · 无内部不一致描述
* REQ-Q-PROD 质量特性-产品说明 正向 P1
*
* 前置:1. 系统已部署并正常运行 2. 网络及测试环境可用
* 步骤:1. 检查产品说明内部描述一致性
* 预期:1. 产品说明没有内部不一致的描述
*
* 浏览器自动化无法直接读 .docx/.md 中的文字做一致性比对。
* 但可对文档中"声称的关键参数"做接口侧实测(功能清单 §5.1 声明 ≥ 10 种策略模板,接口 Catalog 返回值应不低于此)。
* 真实的"内部一致性"靠人工核对 docs/README.md / docs/功能清单.md / 技术协议 docx。
*/
export const meta = {
tc: 'TC-PROD-002',
req: 'Q-PROD',
title: '无内部不一致描述',
type: '正向',
priority: 'P1',
route: '',
needs: ['fe', 'be']
}
export async function run(t) {
await t.step('前置:登录并拉取声称的基线数据', async () => {
await t.login()
})
await t.step('核对功能清单 §5.1「策略模板 ≥ 10 种」与接口实际一致', async () => {
const cat = await t.api('GET', '/api/ssw/tds/PolicyTemplate/Catalog')
const d = cat.data || {}
const constraint = d.constraint?.length ?? 0
const action = d.action?.length ?? 0
const total = constraint + action
t.assert(total >= 10, `策略模板总数 ≥ 10(实际 ${total}:约束类 ${constraint} + 行为类 ${action})`)
})
await t.step('核对技术协议「可信数据空间 ≥ 10 个」与接口实际一致', async () => {
const list = await t.apiList('/api/ssw/tds/Space', { pageSize: 100 })
t.assert(list.length >= 1, `至少存在 1 个逻辑空间(实际 ${list.length})`)
})
await t.step('核对功能清单 §13「数字合约」与状态机定义一致', async () => {
const list = await t.apiList('/api/ssw/tds/Contract', { pageSize: 5 })
// 状态机 01 待签署 / 02 已生效 / 03 已终止 (来自 docs/tds/REQUIREMENTS.md)
const validStatuses = ['01', '02', '03']
if (list.length) {
const bad = list.filter((r) => !validStatuses.includes(r.status))
t.assert(bad.length === 0, `现存合约状态都属于 01/02/03(异常 ${bad.length} 条)`)
}
t.assert(true, '合约状态机口径与需求文档一致')
})
t.manual(`对"两份需求基线 + 一份总览"的人工交叉核对(浏览器自动化无法比对 .docx 文本):
1. docs/功能清单.md(需求基线 A)—— 19 个章节 100 个功能点是否齐全;
2. docs/附件1:技术协议_可信数据空间_0512.docx(需求基线 B)—— 38 个功能点 + 验收标准;
3. docs/README.md(文档索引)—— 章节链接是否完整、跳转到目标文件是否 200;
4. 重点核对 [FL-x.y] 与 [TP-n] 编号在 docs/arch/REQUIREMENT_MATRIX.md 中是否一一对应。`)
}