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

68 lines
3.3 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-CONTROL_API-008 · 查看执行过程控制的办理结果
* REQ-067 [FL-6.1] 反向/错误推测 P1
*
* 前置:1. 已完成一次执行过程控制操作
* 2. 用户有查看记录的权限
* 步骤:1. 打开通过已认证的调用方连接器调用「执行过程控制」接口
* 2. 查询刚办理的记录
* 3. 查看详情和相关记录
* 预期:能查到正确的执行过程控制结果,列表、详情和相关记录一致。
*
* 实现说明:
* 执行过程控制的「办理结果」对应 DeliveryTask 实体的状态机终态:
* runStatus=SUCCESS、auditStatus=APPROVED、resultUri/resultFilename 已落库,
* 且 Result/Log 两个下载接口能命中。
*/
export const meta = {
tc: 'TC-CONTROL_API-008',
req: 'REQ-067',
title: '查看执行过程控制的办理结果',
type: '反向/错误推测',
priority: 'P1',
route: '',
needs: ['be']
}
export async function run(t) {
await t.login()
let succeeded = null
await t.step('前置:从 TDC 库中挑选一条已成功交付的 Sandbox 任务', async () => {
const list = await t.apiList('/api/ssw/tdc/DeliveryTask', { deliveryType: 'SANDBOX', pageSize: 50 })
succeeded = list.find((x) => x.runStatus === 'SUCCESS')
if (!succeeded) t.skip('库中没有 SUCCESS 状态的 Sandbox 任务,请先跑 TC-CONTROL_API-006')
t.assert(true, `已选查看对象:id=${succeeded.id} code=${succeeded.taskCode || succeeded.code}`)
})
await t.step('按 deliveryType=SANDBOX 列表过滤能命中该记录', async () => {
const list = await t.apiList('/api/ssw/tdc/DeliveryTask', { deliveryType: 'SANDBOX', pageSize: 200 })
t.assert(list.some((x) => x.id === succeeded.id), `列表能命中该 Sandbox 任务`)
})
await t.step('详情接口核对办理结果的全部字段', async () => {
const r = await t.api('GET', `/api/ssw/tdc/DeliveryTask/${succeeded.id}`)
t.assert(r.code === 200, `详情接口返回 200`)
const d = r.data
t.assert(d.runStatus === 'SUCCESS', `runStatus=SUCCESS(实际 ${d.runStatus})`)
t.assert(d.auditStatus === 'APPROVED', `auditStatus=APPROVED(实际 ${d.auditStatus})`)
t.assert(!!d.resultUri, `resultUri 已落库(${d.resultUri})`)
t.assert(!!d.resultFilename, `resultFilename 已落库(${d.resultFilename})`)
t.assert(!!d.runStartTime && !!d.runEndTime, `runStartTime/runEndTime 都已记录`)
t.assert(typeof d.durationMs === 'number', `durationMs 已记录(${d.durationMs}ms)`)
})
await t.step('相关记录:/Sandbox/{id}/Result 与 /Log 返回的 URI 与详情一致', async () => {
const rr = await t.api('GET', `/api/ssw/tdc/Sandbox/${succeeded.id}/Result`)
t.assert(rr.code === 200, `Result 接口返回成功`)
t.assert(rr.data?.resultUri === succeeded.resultUri, `Result 接口 resultUri 与详情一致`)
const rl = await t.api('GET', `/api/ssw/tdc/Sandbox/${succeeded.id}/Log`)
t.assert(rl.code === 200, `Log 接口返回成功`)
t.assert(rl.data?.durationMs === succeeded.durationMs, `Log 接口 durationMs 与详情一致`)
})
await t.step('列表分页:currentPage / pageSize 参数生效', async () => {
const a = await t.apiList('/api/ssw/tdc/DeliveryTask', { deliveryType: 'SANDBOX', currentPage: 1, pageSize: 5 })
t.assert(a.length <= 5, `第一页 ≤5 条(实际 ${a.length})`)
})
}