Files
ssw-mvp/docs/e2e/cases/TC-PROD-004.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

56 lines
2.7 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-004 · 特性陈述可测试
* REQ-Q-PROD 质量特性-产品说明 正向 P1
*
* 前置:1. 系统已部署并正常运行 2. 网络及测试环境可用
* 步骤:1. 检查产品说明中特性陈述
* 预期:1. 产品说明包括的特性陈述是可测试或可验证的
*
* 浏览器自动化对"特性陈述"做"可验证"实测:抽样产品说明中可量化的特性(策略模板数、状态机字段、API 路径),
* 断言必须能在测试中真实构造请求/核对响应。
*/
export const meta = {
tc: 'TC-PROD-004',
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('特性 [FL-5.1] 策略模板种类:Catalog 接口可测', async () => {
const cat = await t.api('GET', '/api/ssw/tds/PolicyTemplate/Catalog')
t.assert(cat.code === 200, `Catalog 接口返回 200(实际 ${cat.code})`)
const total = (cat.data?.constraint?.length ?? 0) + (cat.data?.action?.length ?? 0)
t.assert(total > 0, `Catalog 返回非空策略清单(共 ${total} 条)`)
})
await t.step('特性 [FL-15.1] 审计日志可查可验:列表接口可测', async () => {
const r = await t.api('GET', '/api/ssw/tds/AuditLog?currentPage=1&pageSize=5')
t.assert(r.code === 200, `审计日志列表接口返回 200(实际 ${r.code})`)
t.assert(Array.isArray(r.data?.list ?? r.data), '审计日志返回表结构可解析')
})
await t.step('特性 [FL-4.1] 数据产品登记:列表接口可测', async () => {
const r = await t.api('GET', '/api/ssw/tds/DataProduct?currentPage=1&pageSize=5')
t.assert(r.code === 200, `数据产品列表接口返回 200(实际 ${r.code})`)
})
await t.step('特性 [FL-5.2] 合约创建:新建接口可测(只触发校验,不真正落库)', async () => {
const r = await t.api('POST', '/api/ssw/tds/Contract', { name: '' }, { raw: true })
// 后端必填校验,应返回 200 + code 非 200(业务码)的拒绝,或者 400
t.assert(r.status === 200 || r.status === 400, `新建接口对空 body 给出可观测的拒绝(HTTP ${r.status})`)
})
t.manual(`人工核对产品说明中"特性陈述"是否都可被本仓库中的脚本或测试覆盖:
1. docs/功能清单.md 中 100 个功能点,是否每个都能映射到至少一条 TC-CONTRACT/CONNECTOR/DELIVERY/IDENTITY/ASSET 用例;
2. docs/arch/REQUIREMENT_MATRIX.md 的"状态"列是否被 cases/ 目录下的 mjs 脚本覆盖;
3. 功能清单声明的量化指标(≥10 个空间 / ≥34 种策略 / ≥20 种控制策略)是否在接口返回中得到证实。`)
}