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

70 lines
2.6 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-001 · 正常办理数据市场
* REQ-019 [FL-17.2] 正向/场景法 P0
*
* 前置:1. 已获数据提供方角色的机构用户
* 2. 服务平台的【数据交易】可以正常打开
* 3. 已准备好测试数据
* 步骤:1. 打开服务平台的【数据交易】
* 2. 按页面提示填写或选择正确的数据
* 3. 点击提交,查看办理结果
* 预期:数据市场办理成功,系统按要求完成处理,状态和记录正确。
*/
export const meta = {
tc: 'TC-TRADE-001',
req: 'REQ-019',
title: '正常办理数据市场',
type: '正向/场景法',
priority: 'P0',
route: '/tds/market',
needs: ['fe', 'be']
}
export async function run(t) {
const code = `DM-${t.runId}`
const title = `测评需求-${t.runId}`
const dataType = '结构化数据'
await t.step('前置:以运营方身份登录并打开【数据交易】', async () => {
await t.login()
await t.goto('/tds/market')
await t.expectTitle('需求广场')
await t.expectVisible('.ant-table', '需求广场表格已渲染')
})
await t.step('在「需求广场」tab 填写正确数据并发布', async () => {
// 「需求广场」tab 默认就是第一个,DRAFT → 发布 → PUBLISHED
// 需求编码(demandCode)在 CrudPage 表单里被设为 required,必填
await t.openCreate()
await t.fillForm({
需求编码: code,
需求标题: title,
期望数据类型: dataType,
描述: `测评数据需求描述 ${t.runId}`
})
await t.save()
await t.expectToast('新增成功')
await t.waitIdle()
await t.shot('新建需求后列表')
})
await t.step('核对办理结果:列表可见且关键字可搜', async () => {
await t.search(code)
await t.expectRow(code)
// 列表默认 status=DRAFT;行内动作「发布」可见
const list = await t.apiList('/api/ssw/tdc/Demand', { keyword: code })
const row = list.find((r) => r.demandCode === code)
t.assert(!!row, `后端已落库需求 ${code}`)
t.assert(row.status === 'DRAFT', `新建后状态为 DRAFT(实际 ${row.status})`)
})
await t.step('点「发布」动作:状态从 DRAFT 变 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.expectConsoleClean()
}