test: harden admin acceptance fixtures

This commit is contained in:
2026-09-24 01:24:22 +08:00
parent ead27a6a11
commit a0cf38f7b8
4 changed files with 39 additions and 10 deletions
@@ -199,9 +199,16 @@ async function prepareInboundStatus(context, target) {
}
}
const response = await originalRequest.call(context, 'GET',
`/api/platform/inbounds/${query(inboundId)}?tenantId=${query(tenantId)}`)
const detail = context.apiSuccess(MODULE, `回读 ${target} 独立入库单`, response, '', OPTIONS)
let response = null
let detail = null
for (let attempt = 1; attempt <= 8; attempt += 1) {
response = await originalRequest.call(context, 'GET',
`/api/platform/inbounds/${query(inboundId)}?tenantId=${query(tenantId)}`)
detail = response?.http === 200 && String(response?.body?.code) === '200' ? response.body.data : null
if (detail?.summary?.processStatus === target || attempt === 8) break
await new Promise((resolve) => setTimeout(resolve, 500 * attempt))
}
detail = context.apiSuccess(MODULE, `回读 ${target} 独立入库单`, response, '', OPTIONS)
context.assert(MODULE, `${target} 入库状态样本可从详情打开`, response,
detail?.summary?.processStatus === target, `inboundId=${inboundId}, actual=${detail?.summary?.processStatus || 'missing'}`, OPTIONS)
return { inboundId, orderId: id(order.orderId), tenantId, status: target,