test: stabilize full dev acceptance orchestration

This commit is contained in:
2026-09-09 20:36:53 +08:00
parent 71604c9c39
commit eac6875877
16 changed files with 104 additions and 85 deletions
@@ -94,14 +94,17 @@ export async function run(context) {
for (const documentType of ['DELIVERY_ORDER']) {
const response = await context.request('GET', `${CONTAINERS}/${encodeURIComponent(containerId)}/documents/${documentType}`)
const data = context.apiSuccess(MODULE, `查询 ${documentType} 单证`, response, `documentType=${documentType}`, OPTIONS)
context.assert(MODULE, `${documentType} 单证归属货柜`, response,
data == null || id(data.containerId || containerId) === containerId,
`containerBookingId=${containerId}`, OPTIONS)
context.assert(MODULE, `国内未出仓时 ${documentType} 不生成国外工作台数据`, response,
response.http === 200 && String(response?.body?.code) === 'A0404'
&& String(response?.body?.message || '').includes('国外工作台货柜不存在'),
`HTTP=${response.http}, code=${response?.body?.code ?? 'missing'}, documentType=${documentType}`, OPTIONS)
}
const clearance = await context.request('GET', `${CONTAINERS}/${encodeURIComponent(containerId)}/clearance`)
context.apiSuccess(MODULE, '查询目的港清关资料', clearance, `containerBookingId=${containerId}`, OPTIONS)
context.assert(MODULE, '国内未出仓时目的港清关不生成国外工作台数据', clearance,
clearance.http === 200 && String(clearance?.body?.code) === 'A0404'
&& String(clearance?.body?.message || '').includes('国外工作台货柜不存在'),
`HTTP=${clearance.http}, code=${clearance?.body?.code ?? 'missing'}, containerBookingId=${containerId}`, OPTIONS)
const customs = await context.request('GET', `/api/platform/v1/first-leg/loading-lists/${encodeURIComponent(planId)}/customs?warehouseId=${encodeURIComponent(warehouseId)}`)
if (fixture?.finalStatus === 'LOADED') {
context.apiSuccess(MODULE, '查询出口报关资料', customs, `loadingPlanId=${planId}, warehouseId=${warehouseId}`, OPTIONS)