- 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
77 lines
3.0 KiB
JavaScript
77 lines
3.0 KiB
JavaScript
/**
|
||
* TC-TRADE-003 · 正常办理需求中心
|
||
* REQ-020 [FL-17.2] 正向/场景法 P0
|
||
*
|
||
* 前置:1. 已获数据提供方角色的机构用户
|
||
* 2. 服务平台的【数据交易】可以正常打开
|
||
* 3. 已准备好测试数据
|
||
* 步骤:1. 打开服务平台的【数据交易】
|
||
* 2. 按页面提示填写或选择正确的数据
|
||
* 3. 点击提交,查看办理结果
|
||
* 预期:需求中心办理成功,系统按要求完成处理,状态和记录正确。
|
||
*
|
||
* 注:需求中心即「需求广场」tab 的全生命周期(DRAFT → 发布 PUBLISHED → 关闭 CLOSED),
|
||
* 用例重点覆盖:新建 → 发布 → 关闭 三步状态迁移,与 TRADE-001(仅新建+发布)形成差异化。
|
||
*/
|
||
export const meta = {
|
||
tc: 'TC-TRADE-003',
|
||
req: 'REQ-020',
|
||
title: '正常办理需求中心',
|
||
type: '正向/场景法',
|
||
priority: 'P0',
|
||
route: '/tds/market',
|
||
needs: ['fe', 'be']
|
||
}
|
||
|
||
export async function run(t) {
|
||
const code = `DM-LIFECYCLE-${t.runId}`
|
||
const title = `需求中心闭环-${t.runId}`
|
||
|
||
await t.step('前置:登录并打开【数据交易】-「需求广场」', async () => {
|
||
await t.login()
|
||
await t.goto('/tds/market')
|
||
await t.expectTitle('需求广场')
|
||
})
|
||
|
||
await t.step('新建需求(需求中心首次办理)', async () => {
|
||
await t.openCreate()
|
||
await t.fillForm({
|
||
需求编码: code,
|
||
需求标题: title,
|
||
期望数据类型: '时序数据',
|
||
描述: `需求中心全生命周期闭环 ${t.runId}`
|
||
})
|
||
await t.save()
|
||
await t.expectToast('新增成功')
|
||
await t.waitIdle()
|
||
})
|
||
|
||
await t.step('点「发布」将需求推进到 PUBLISHED', async () => {
|
||
await t.doAction(code, '发布')
|
||
await t.waitIdle()
|
||
const row = (await t.apiList('/api/ssw/tdc/Demand', { keyword: code })).find((r) => r.demandCode === code)
|
||
t.assert(row.status === 'PUBLISHED', `发布后状态变 PUBLISHED(实际 ${row.status})`)
|
||
t.assert(!!row.publishTime, `记录了发布时间(${row.publishTime})`)
|
||
t.assert(!!row.publishUserId, `记录了发布操作人(${row.publishUserId})`)
|
||
})
|
||
|
||
await t.step('点「关闭」将需求推进到 CLOSED,结束生命周期', async () => {
|
||
await t.refresh()
|
||
await t.doAction(code, '关闭')
|
||
await t.waitIdle()
|
||
const row = (await t.apiList('/api/ssw/tdc/Demand', { keyword: code })).find((r) => r.demandCode === code)
|
||
t.assert(row.status === 'CLOSED', `关闭后状态变 CLOSED(实际 ${row.status})`)
|
||
})
|
||
|
||
await t.step('核对:列表中可见关闭后的需求,且无后续可执行动作', async () => {
|
||
await t.search(code)
|
||
await t.expectRow(code)
|
||
// CLOSED 状态下,发布/关闭按钮都不该出现
|
||
const hasPublish = await t.hasRowAction(code, '发布')
|
||
const hasClose = await t.hasRowAction(code, '关闭')
|
||
t.assert(!hasPublish, 'CLOSED 状态下不再展示「发布」动作')
|
||
t.assert(!hasClose, 'CLOSED 状态下不再展示「关闭」动作')
|
||
})
|
||
|
||
t.expectConsoleClean()
|
||
} |