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

17 lines
1.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-COMPLIANCE_API-002 · 条件不满足时不能办理运行日志上报(接口)
* REQ-029 [FL-15.x] 反向/等价类 P0
*/
export const meta = { tc: 'TC-COMPLIANCE_API-002', req: 'REQ-029', title: '条件不满足时不能办理运行日志上报', type: '反向/等价类', priority: 'P0', needs: ['be'] }
export async function run(t) {
await t.login()
// 缺 content
const r1 = await t.api('POST', '/api/ssw/tds/Regulatory/RunSummary', { level: 'INFO' })
t.assert(r1.code !== 200 || /不能为空|必填/.test(r1.msg || ''), `缺 content 被拒:code=${r1.code} msg=${r1.msg || ''}`)
// 非法 level
const r2 = await t.api('POST', '/api/ssw/tds/Regulatory/RunSummary', { content: 'x', level: 'INVALID_LEVEL' })
t.assert(r2.code !== 200 || /级别|level|枚举/.test(r2.msg || ''), `非法 level 被拒:code=${r2.code} msg=${r2.msg || ''}`)
// XSS 注入尝试
const r3 = await t.api('POST', '/api/ssw/tds/Regulatory/RunSummary', { content: '<script>alert(1)</script>', level: 'INFO' })
t.assert(r3.code === 200 || r3.code !== undefined, `XSS payload 未让接口崩溃(code=${r3.code})`)
}