Files
ssw-mvp/docs/e2e/cases/TC-CONTRACT_API-006.mjs
T
admin 4585d15d5f chore: snapshot source work — e2e fixes, backend/web, docs
- e2e: fix 9 failing cases (contract/hosting/delivery/usage/security);
  add dsl.createSandboxTask() self-provision helper; cli/runner now
  default headless, --ob opens visible browser
- backend: tdc/tds controller adjustments (delivery, hosting, contract,
  chain-evidence, catalog, product, policy-conflict, etc.)
- web: ssw views/components adjustments (contract, product, hosting, connector)
- docs: AGENTS.md, e2e README; .gitignore; project memory update

Excludes docs/e2e/results artifacts (screenshots + results.json).
2026-08-06 14:02:07 +08:00

17 lines
952 B
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-006 · 正常办理合约备案(接口)
* REQ-012 [FL-5.2] 正向/场景法 P0
*/
export const meta = { tc: 'TC-CONTRACT_API-006', 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 === '02' && !c.chainTxHash)
if (!target) t.skip('库中无待上链合约')
const before = (await t.apiList('/api/ssw/tds/ChainEvidence/List')).length
const r = await t.api('PUT', `/api/ssw/tds/Contract/${target.id}/Chain`, { chainTxHash: '0x' + 'b'.repeat(64) })
t.assert(r.code === 200, `合约备案调用:code=${r.code} msg=${r.msg || ''}`)
await t.waitIdle()
const after = (await t.apiList('/api/ssw/tds/ChainEvidence/List')).length
t.assert(after === before + 1, `存证记录 +1(${before} → ${after})`)
}