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

63 lines
3.1 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-006 · 接口与版权说明齐全
* REQ-Q-PROD 质量特性-产品说明 正向 P1
*
* 前置:1. 系统已部署并正常运行 2. 网络及测试环境可用
* 步骤:1. 查看用户接口类型、防止误操作功能及版权侵权技术保护陈述
* 预期:1. 产品说明指明用户接口类型、防误操作功能及版权保护陈述
*
* 浏览器自动化可核对"用户接口类型"(HTTP/JSON vs gRPC)与"防误操作"(删除 Popconfirm 二次确认)。
* 版权陈述靠人工核对 docs/。
*/
export const meta = {
tc: 'TC-PROD-006',
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('核对"用户接口类型":默认 HTTP/JSON 接口', async () => {
const r = await t.api('GET', '/api/ssw/tds/Space?currentPage=1&pageSize=1', undefined, { raw: true })
t.assert(r.status === 200, `TDS 主接口 HTTP 200(实际 ${r.status})`)
const ct = r.json && typeof r.json === 'object' ? 'JSON' : 'unknown'
t.assert(ct === 'JSON', `响应体可被解析为 JSON(接口类型 = HTTP/JSON)`)
})
await t.step('核对"防误操作功能":契约删除二次确认', async () => {
await t.goto('/tds/contracts')
const row = t.page.locator('.ant-table-tbody tr.ant-table-row').first()
if (!(await row.count())) t.skip('库中无合约可演示 Popconfirm')
await row.getByRole('button', { name: /删除/ }).click()
const pop = t.page.locator('.ant-popconfirm:visible')
await pop.waitFor({ state: 'visible', timeout: 5000 }).catch(() => {})
t.assert(await pop.count() > 0, '删除契约触发 Popconfirm 二次确认(防误操作)')
await t.page.keyboard.press('Escape')
})
await t.step('核对"防误操作功能":连接器删除二次确认', async () => {
await t.goto('/tds/connectors')
const row = t.page.locator('.ant-table-tbody tr.ant-table-row').first()
if (!(await row.count())) t.skip('库中无连接器可演示 Popconfirm')
await row.getByRole('button', { name: /删除/ }).click()
const pop = t.page.locator('.ant-popconfirm:visible')
await pop.waitFor({ state: 'visible', timeout: 5000 }).catch(() => {})
t.assert(await pop.count() > 0, '删除连接器触发 Popconfirm 二次确认(防误操作)')
await t.page.keyboard.press('Escape')
})
t.manual(`人工核对产品说明中"接口类型 / 防误操作 / 版权保护陈述":
1. docs/功能清单.md 是否在每章开篇说明对应的接口类型(HTTP/JSON / gRPC / HTTPS);
2. docs/README.md 顶部「鉴权」一节是否给出 Sa-Token bearer 鉴权与 token 前缀约定;
3. docs/security/SECURITY_PLANE.md 是否说明软 PKI 根证书 + 安全启动 PCR + 远程证明(防止伪造/破解);
4. docs/PROJECT.md 顶部是否声明供方版权声明与许可证(Apache 2.0 / MIT / 商业授权);
5. 验证页脚(页面底部是否显示版本号 + 版权年份)。`)
}