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

64 lines
2.4 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-TRADE-005 · 查看需求中心的办理结果
* REQ-020 [FL-17.2] 反向/错误推测 P1
*
* 前置:1. 已完成一次需求中心操作
* 2. 用户有查看记录的权限
* 步骤:1. 打开服务平台的【数据交易】
* 2. 查询刚办理的记录
* 3. 查看详情和相关记录
* 预期:能查到正确的需求中心结果,列表、详情和相关记录一致。
*/
export const meta = {
tc: 'TC-TRADE-005',
req: 'REQ-020',
title: '查看需求中心的办理结果',
type: '反向/错误推测',
priority: 'P1',
route: '/tds/market',
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/Demand', { pageSize: 50 })
if (!list.length) t.skip('库中没有任何需求记录,先执行 TC-TRADE-001/-003 创建需求')
target = list.find((r) => r.status === 'PUBLISHED') || list[0]
t.assert(true, `选定查看对象:${target.demandCode} / ${target.title} / status=${target.status}`)
})
await t.step('打开【数据交易】并按需求标题查询', async () => {
await t.goto('/tds/market')
await t.search(target.title)
await t.expectRow(target.title)
await t.shot('查询结果')
})
await t.step('核对列表展示与后端记录一致', async () => {
const table = await t.readTable()
const row = table.find((cells) => cells.some((c) => c.includes(target.title)))
t.assert(!!row, '查询结果命中目标记录')
t.assert(row.some((c) => c.includes(target.demandCode)), `列表中的需求编码与后端一致(${target.demandCode})`)
})
await t.step('核对详情:编辑抽屉回显的数据与列表一致', async () => {
await t.openEdit(target.title)
const title = await t
.drawer()
.locator('.ant-form-item:has(label:text-is("需求标题")) input')
.inputValue()
const dataType = await t
.drawer()
.locator('.ant-form-item:has(label:text-is("期望数据类型")) input')
.inputValue()
t.assert(title === target.title, `详情需求标题一致(${title})`)
t.assert(dataType === (target.expectedDataType ?? ''), `详情期望数据类型一致(${dataType})`)
await t.shot('详情回显')
await t.cancelDrawer()
})
t.expectConsoleClean()
}