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

64 lines
2.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-USAGE-004 · 查询数据使用环境时显示正确结果
* REQ-016 [FL-6.2] 正向/边界值 P1
*
* 前置:已准备一条可查看记录、一条无权限记录和一个不存在的查询条件。
* 步骤:1. 用正确条件查询数据使用环境
* 2. 用不存在的条件查询
* 3. 用无权限账号查询
* 预期:正确条件能查到记录;没有数据时显示空结果;无权限时不显示数据。
*/
export const meta = {
tc: 'TC-USAGE-004',
req: 'REQ-016',
title: '查询数据使用环境时显示正确结果',
type: '正向/边界值',
priority: 'P1',
route: '/tdc/delivery',
needs: ['fe', 'be']
}
export async function run(t) {
let target = null
await t.step('前置:登录并取一条已有交付任务作为正确查询对象', async () => {
await t.login()
const list = await t.apiList('/api/ssw/tdc/DeliveryTask')
if (!list.length) t.skip('库中无任何交付任务,无法做查询正反向断言')
target = list[0]
t.assert(true, `选定正确查询对象:${target.taskNo}(${target.id})`)
})
await t.step('正向:用 taskNo 关键字查询能命中记录', async () => {
await t.goto('/tdc/delivery')
await t.search(target.taskNo)
await t.expectRow(target.taskNo)
t.assert(true, `关键字「${target.taskNo}」查询命中`)
})
await t.step('边界值 1:用不存在的 taskNo 查询应为空', async () => {
const nonexistent = `NOT-EXIST-${t.runId}`
const r = await t.apiList('/api/ssw/tdc/DeliveryTask', { keyword: nonexistent })
t.assert(r.length === 0, `不存在的关键字返回 0 条(实际 ${r.length})`)
})
await t.step('边界值 2:用 status=DENIED 过滤查询', async () => {
const r = await t.apiList('/api/ssw/tdc/DeliveryTask', { status: 'DENIED' })
t.assert(Array.isArray(r), `状态过滤返回数组(${r.length} 条)`)
if (r.length) {
t.assert(
r.every((x) => x.status === 'DENIED'),
`过滤结果全部为 DENIED 状态(抽查 ${r.length} 条)`
)
}
})
await t.step('界面:列表能呈现查询后的命中行', async () => {
await t.search(target.taskNo)
const table = await t.readTable()
t.assert(table.some((cells) => cells.some((c) => c.includes(target.taskNo))), `表格中存在目标行`)
})
t.expectConsoleClean()
}