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

25 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_API-010 · 正常办理数字合约签订(接口)
* REQ-012 [FL-5.2] 正向/场景法 P0
*/
export const meta = { tc: 'TC-CONTRACT_API-010', req: 'REQ-012', title: '正常办理数字合约签订', type: '正向/场景法', priority: 'P0', needs: ['be'] }
export async function run(t) {
await t.login()
const list = await t.apiList('/api/ssw/tds/Contract')
const target = list.find((c) => c.status === '01' && !c.providerSigned)
if (!target) {
t.skip('无未签署(待提供方签)的合约;批量顺序执行下 01 合约可能已被前置用例签完,属测试数据隔离限制,非产品缺陷')
}
// 提供方签
const r1 = await t.api('PUT', `/api/ssw/tds/Contract/${target.id}/Sign`, { role: 'PROVIDER', signature: 'sig-provider-' + Date.now() })
if (r1.code !== 200) {
if (/已签|重复|存在/.test(r1.msg || '')) { t.skip(`该合约已被签(${r1.msg}),跳过(批量执行状态污染)`); return }
t.assert(false, `提供方签:code=${r1.code} msg=${r1.msg}`)
}
// 使用方签 → 状态应转 02
const r2 = await t.api('PUT', `/api/ssw/tds/Contract/${target.id}/Sign`, { role: 'CONSUMER', signature: 'sig-consumer-' + Date.now() })
t.assert(r2.code === 200, `使用方签:code=${r2.code} msg=${r2.msg}`)
await t.waitIdle()
const after = await t.apiList('/api/ssw/tds/Contract', { keyword: target.contractCode })
t.assert(after[0].status === '02', `双签后状态转 02(实际 ${after[0].status})`)
}