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

68 lines
2.8 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-PLATFORM-008 · 查看数据产品上架的办理结果
* REQ-037 [FL-10.2] 反向/错误推测 P1
*
* 前置:1. 已完成一次数据产品上架操作
* 2. 用户有查看记录的权限
* 步骤:1. 打开【数据提供】或【数据使用】
* 2. 查询刚办理的记录
* 3. 查看详情和相关记录
* 预期:能查到正确的数据产品上架结果,列表、详情和相关记录一致。
*/
export const meta = {
tc: 'TC-PLATFORM-008',
req: 'REQ-037',
title: '查看数据产品上架的办理结果',
type: '反向/错误推测',
priority: 'P1',
route: '/tdc/products',
needs: ['fe', 'be']
}
export async function run(t) {
let target = null
await t.step('前置:取一条非 DRAFT 的产品(即有上架动作痕迹)', async () => {
await t.login()
const list = await t.apiList('/api/ssw/tdc/Product', { pageSize: 50 })
target = list.find((r) => r.publishStatus && r.publishStatus !== 'DRAFT') || list[0]
if (!target) t.skip('库中没有任何产品,先执行 TC-PLATFORM-006')
t.assert(true, `选定查看对象:${target.productCode} / publishStatus=${target.publishStatus}`)
})
await t.step('打开【产品发布】并按发布状态筛选定位该记录', async () => {
await t.goto('/tdc/products')
// 用状态筛选
const labelMap = { PUBLISHING: '上架中', PUBLISHED: '已发布', REJECTED: '已驳回', OFFLINE: '已下架' }
const label = labelMap[target.publishStatus] || '已发布'
await t.selectFilter('发布状态', label)
await t.waitIdle()
await t.search(target.productCode)
await t.expectRow(target.productCode)
await t.shot('查询结果')
})
await t.step('核对列表展示与后端记录一致', async () => {
const table = await t.readTable()
const row = table.find((cells) => cells.some((c) => c.includes(target.productCode)))
t.assert(!!row, '查询结果命中目标记录')
t.assert(row.some((c) => c.includes(target.name)), `列表产品名称与后端一致(${target.name})`)
// 状态标签:列表应展示 publishStatus 对应的中文
const labelMap = { PUBLISHING: '上架中', PUBLISHED: '已发布', REJECTED: '已驳回', OFFLINE: '已下架', DRAFT: '草稿' }
const label = labelMap[target.publishStatus] || target.publishStatus
t.assert(row.some((c) => c.includes(label)), `列表发布状态标签与后端一致(${label})`)
})
await t.step('核对详情:编辑抽屉回显与列表一致', async () => {
await t.openEdit(target.productCode)
const code = await t
.drawer()
.locator('.ant-form-item:has(label:text-is("产品标识")) input')
.inputValue()
t.assert(code === target.productCode, `详情产品标识一致(${code})`)
await t.shot('详情回显')
await t.cancelDrawer()
})
t.expectConsoleClean()
}