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

67 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-CONNECTOR-005 · 条件不满足时不能办理接入连接器审批
* REQ-005 [FL-3.1~3.3] 反向/等价类 P0
*
* 前置:【接入连接器管理】可打开 / 已准备错误数据
* 步骤:使用不存在的 ID / 非 PENDING 状态的记录办理审批 → 查看提示
* 预期:系统不允许办理审批并说明原因,原数据与状态不变
*/
export const meta = {
tc: 'TC-CONNECTOR-005',
req: 'REQ-005',
title: '条件不满足时不能办理接入连接器审批',
type: '反向/等价类',
priority: 'P0',
route: '/tds/connectors',
needs: ['fe', 'be']
}
export async function run(t) {
await t.step('前置:登录并打开页面', async () => {
await t.login()
await t.goto('/tds/connectors')
})
await t.step('不存在的 ID 走「通过」接口被拒', async () => {
const r = await t.api('PUT', '/api/ssw/tds/Connector/not-exist-id-xxxx/Audit', {
auditStatus: 'PASS',
auditOpinion: '自动化测试'
})
t.assert(r.code !== 200, `不存在的 ID 应被拒绝(实际 code=${r.code})`)
t.assert(/不存在|失败|错误/i.test(r.msg || ''), `错误信息说明原因(实际「${r.msg}」)`)
})
await t.step('驳回时审批意见为空应被拒', async () => {
const list = await t.apiList('/api/ssw/tds/Connector', { pageSize: 50 })
const pending = list.find((r) => r.auditStatus === 'PENDING' || r.auditStatus === 'DRAFT')
if (!pending) t.skip('库里没有 PENDING/DRAFT 的连接器,跳过本步')
const r = await t.api('PUT', `/api/ssw/tds/Connector/${pending.id}/Audit`, {
auditStatus: 'REJECT',
auditOpinion: ''
})
t.assert(r.code !== 200, `REJECT 时空意见被拒(实际 code=${r.code})`)
t.assert(/意见|为空|必填/i.test(r.msg || ''), `错误信息包含「意见/为空/必填」(实际「${r.msg}」)`)
})
await t.step('非法 auditStatus 应被拒', async () => {
const list = await t.apiList('/api/ssw/tds/Connector', { pageSize: 50 })
const target = list[0]
if (!target) t.skip('库里无连接器,跳过本步')
const r = await t.api('PUT', `/api/ssw/tds/Connector/${target.id}/Audit`, {
auditStatus: 'NOT_A_VALID_STATUS',
auditOpinion: 'x'
})
t.assert(r.code !== 200, `非法 auditStatus 被拒(实际 code=${r.code})`)
t.assert(/PASS|REJECT|PENDING/.test(r.msg || ''), `错误信息要求 PASS/REJECT(实际「${r.msg}」)`)
})
await t.step('核对原有数据与状态不变', async () => {
const list = await t.apiList('/api/ssw/tds/Connector', { pageSize: 50 })
const target = list[0]
const r = await t.api('GET', `/api/ssw/tds/Connector/${target.id}`)
t.assert(r.code === 200, `GET 仍可读取(实际 code=${r.code})`)
t.assert(!!r.data, '记录未被前面的错误请求改动')
})
t.expectConsoleClean()
}