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

31 lines
1.5 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-CONTRACT-013 · 条件不满足时不能办理合约备案
* REQ-012 [FL-5.2] 反向/等价类 P0
*/
export const meta = { tc: 'TC-CONTRACT-013', req: 'REQ-012', title: '条件不满足时不能办理合约备案', type: '反向/等价类', priority: 'P0', route: '/tds/contracts', needs: ['fe','be'] }
export async function run(t) {
await t.login()
await t.goto('/tds/contracts')
await t.pickSpace()
const list = await t.apiList('/api/ssw/tds/Contract')
// 关键反向条件 1:status 不在 02 不能上链
const nonEffective = list.find((c) => c.status !== '02')
if (nonEffective) {
const hasChain = await t.hasRowAction(nonEffective.contractCode, '上链存证')
t.assert(!hasChain, `非生效合约(status=${nonEffective.status})不应出现「上链存证」按钮`)
}
// 关键反向条件 2:status=02 但已有 chainTxHash 不应再出现
const already = list.find((c) => c.status === '02' && c.chainTxHash)
if (already) {
const hasChain = await t.hasRowAction(already.contractCode, '上链存证')
t.assert(!hasChain, '已上链的合约不应再出现「上链存证」按钮')
}
// prompt 必填校验:故意留空
const target = list.find((c) => c.status === '02' && !c.chainTxHash)
if (target) {
await t.rowAction(target.contractCode, '上链存证')
await t.promptOk('')
const warn = await t.toastText()
t.assert(/不能为空|请输入|内容不能为空/.test(warn), `空哈希被拦截(实际「${warn}」)`)
}
}