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

76 lines
2.9 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-USAGE-013 · 查看使用存证的办理结果
* REQ-018 [FL-6.3] 正向/边界值 P1
*
* 前置:1. 已完成一次使用存证操作
* 2. 用户有查看记录的权限
* 步骤:1. 打开服务平台的【数据使用控制】
* 2. 查询刚办理的记录
* 3. 查看详情和相关记录
* 预期:能查到正确的使用存证结果,列表、详情和相关记录一致。
*
* 注:核对销毁日志列表的查询能力(按 method / taskId / operator 过滤)。
*/
export const meta = {
tc: 'TC-USAGE-013',
req: 'REQ-018',
title: '查看使用存证的办理结果',
type: '正向/边界值',
priority: 'P1',
route: '/tdc/destroy-log',
needs: ['fe', 'be']
}
export async function run(t) {
let target = null
await t.step('前置:登录、打开【数据销毁日志】并取一条销毁记录', async () => {
await t.login()
await t.goto('/tdc/destroy-log')
await t.expectTitle('数据销毁日志')
const list = await t.apiList('/api/ssw/tdc/DestroyLog', { pageSize: 100 })
if (!list.length) t.skip('库中无销毁日志记录,先执行 TC-USAGE-011 触发一次销毁')
target = list[0]
t.assert(true, `选定查看对象:${target.taskNo || target.id}(${target.taskId})`)
})
await t.step('正向:销毁日志列表包含核心字段', async () => {
await t.page.waitForTimeout(400)
const headers = await t.page.$$eval('.ant-table-thead th', (ths) =>
ths.map((th) => th.innerText.trim())
)
t.assert(
headers.some((h) => h.includes('任务编号')),
`列表表头包含「任务编号」(表头=${headers.join('|')})`
)
t.assert(
headers.some((h) => h.includes('销毁方式')),
`列表表头包含「销毁方式」(表头=${headers.join('|')})`
)
})
await t.step('核对列表展示与后端记录一致', async () => {
const table = await t.readTable()
t.assert(table.length > 0, `列表能读出数据(${table.length} 行)`)
const row = table.find((cells) => cells.some((c) => (target.taskNo && c.includes(target.taskNo)) || c.includes(target.taskId)))
t.assert(!!row, '查询结果命中目标销毁日志行')
})
await t.step('用销毁方式过滤查询', async () => {
const r = await t.apiList('/api/ssw/tdc/DestroyLog', { method: target.method })
t.assert(Array.isArray(r), `按销毁方式过滤返回数组(${r.length} 条)`)
t.assert(
r.every((x) => x.method === target.method),
`过滤结果全部为目标销毁方式(${target.method})`
)
})
await t.step('核对后端 info 接口回显', async () => {
const info = await t.api('GET', `/api/ssw/tdc/DestroyLog/${target.id}`)
t.assert(info.code === 200 && info.data, `info 接口可查(code=${info.code})`)
t.assert(info.data.taskId === target.taskId, `taskId 回显一致(${info.data.taskId})`)
})
t.expectConsoleClean()
}