test: harden admin acceptance fixtures
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user