- 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
70 lines
2.8 KiB
JavaScript
70 lines
2.8 KiB
JavaScript
/**
|
||
* TC-TRADE-011 · 查看交易订单的办理结果
|
||
* REQ-022 [FL-17.2] 正向/边界值 P1
|
||
*
|
||
* 前置:1. 已完成一次交易订单操作
|
||
* 2. 用户有查看记录的权限
|
||
* 步骤:1. 打开服务平台的【数据交易】
|
||
* 2. 查询刚办理的记录
|
||
* 3. 查看详情和相关记录
|
||
* 预期:能查到正确的交易订单结果,列表、详情和相关记录一致。
|
||
*/
|
||
export const meta = {
|
||
tc: 'TC-TRADE-011',
|
||
req: 'REQ-022',
|
||
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/Order', { pageSize: 50 })
|
||
if (!list.length) t.skip('库中没有任何订单记录,先执行 TC-TRADE-009')
|
||
target = list[0]
|
||
t.assert(true, `选定查看对象:${target.orderCode} / status=${target.status}`)
|
||
})
|
||
|
||
await t.step('打开【数据交易】并切到「供需订单」tab 查询', async () => {
|
||
await t.goto('/tds/market')
|
||
await t.page.getByRole('tab', { name: '供需订单' }).click()
|
||
// 关键字搜索的 input 在两个 tab pane 里都有,必须限定到激活 tab
|
||
const input = t.page.locator('.ant-tabs-tabpane-active .ant-input[placeholder="关键字搜索"]')
|
||
await input.fill(target.orderCode)
|
||
await t.page.locator('.ant-tabs-tabpane-active').locator('button').filter({ hasText: /查\s*询/ }).first().click()
|
||
await t.waitIdle()
|
||
await t.expectRow(target.orderCode)
|
||
await t.shot('查询结果')
|
||
})
|
||
|
||
await t.step('核对列表展示与后端记录一致', async () => {
|
||
const table = await t.readTable()
|
||
const row = table.find((cells) => cells.some((c) => c.includes(target.orderCode)))
|
||
t.assert(!!row, '查询结果命中目标记录')
|
||
// 列表展示的产品名与后端一致
|
||
if (target.productName) {
|
||
t.assert(row.some((c) => c.includes(target.productName)), `列表产品名与后端一致(${target.productName})`)
|
||
}
|
||
if (target.totalAmount !== null && target.totalAmount !== undefined) {
|
||
t.assert(row.some((c) => String(c).includes(String(target.totalAmount))), `列表金额与后端一致(${target.totalAmount})`)
|
||
}
|
||
})
|
||
|
||
await t.step('核对详情:编辑抽屉回显数据与列表一致', async () => {
|
||
await t.openEdit(target.orderCode)
|
||
const orderCode = await t
|
||
.drawer()
|
||
.locator('.ant-form-item:has(label:text-is("订单号")) input')
|
||
.inputValue()
|
||
t.assert(orderCode === target.orderCode, `详情订单号一致(${orderCode})`)
|
||
await t.shot('详情回显')
|
||
await t.cancelDrawer()
|
||
})
|
||
|
||
t.expectConsoleClean()
|
||
} |