test: verify complete PDA batch history
This commit is contained in:
@@ -82,7 +82,9 @@ export async function run(context) {
|
||||
const batchOperations = Array.isArray(operations)
|
||||
? operations.filter((item) => item.actionType === 'BATCH'
|
||||
&& Boolean(item.operatorId) && Boolean(item.createdAt)) : []
|
||||
const expectedBatchCount = fixture?.dynamicIncrementVerified === true ? 2 : 1
|
||||
const expectedBatchOperationIds = Array.isArray(fixture?.expectedBatchOperationIds)
|
||||
? fixture.expectedBatchOperationIds.map(id).filter(Boolean) : []
|
||||
const actualBatchOperationIds = batchOperations.map((item) => id(item.operationId)).filter(Boolean)
|
||||
context.assert(MODULE, '最终完成前保留领取操作且不伪造复核或完成历史', operationsResponse,
|
||||
Array.isArray(operations) && operations.some((item) => item.actionType === 'CLAIM'
|
||||
&& Boolean(item.operatorId) && Boolean(item.createdAt))
|
||||
@@ -91,9 +93,13 @@ export async function run(context) {
|
||||
`actions=${Array.isArray(operations) ? operations.map((item) => item.actionType).join(',') : 'missing'}`, OPTIONS)
|
||||
|
||||
context.assert(MODULE, 'PDA 原子批次完成审计包含 BATCH 操作', operationsResponse,
|
||||
batchOperations.length === expectedBatchCount
|
||||
&& new Set(batchOperations.map((item) => item.operationId)).size === expectedBatchCount,
|
||||
`expectedBatchCount=${expectedBatchCount}, actualBatchCount=${batchOperations.length}, operationIds=${batchOperations.map((item) => item.operationId || 'missing').join(',')}`, OPTIONS)
|
||||
expectedBatchOperationIds.length === 4
|
||||
&& new Set(expectedBatchOperationIds).size === 4
|
||||
&& actualBatchOperationIds.length === 4
|
||||
&& new Set(actualBatchOperationIds).size === 4
|
||||
&& expectedBatchOperationIds.every((operationId) => actualBatchOperationIds.includes(operationId))
|
||||
&& actualBatchOperationIds.every((operationId) => expectedBatchOperationIds.includes(operationId)),
|
||||
`expectedBatchCount=${expectedBatchOperationIds.length}, actualBatchCount=${actualBatchOperationIds.length}, expectedIds=${expectedBatchOperationIds.join(',') || 'missing'}, actualIds=${actualBatchOperationIds.join(',') || 'missing'}`, OPTIONS)
|
||||
const forged = await request(context, 'POST',
|
||||
`/api/platform/v1/inbounds/${inboundId}/loading/picking/start?tenantId=${encodeURIComponent(tenantId)}`,
|
||||
{ expectedVersion: Number(projection?.version), expectedCount: 999, pickedCount: 999, remark: 'forged' },
|
||||
@@ -127,6 +133,10 @@ export async function run(context) {
|
||||
context.addStep(MODULE, 'LOADING 增量重开、刷新续拣与已拣不可删减', null, false,
|
||||
'phase3-loading 未发布 dynamicIncrementVerified=true;不能跳过增量重开、旧 token A0409、刷新续拣和已拣项保护', OPTIONS)
|
||||
}
|
||||
if (fixture?.skipBatchVerified !== true || fixture?.partialBatchVerified !== true) {
|
||||
context.addStep(MODULE, 'SKIP 与 PARTIAL 独立原子批次均完成', null, false,
|
||||
`skipBatchVerified=${fixture?.skipBatchVerified === true}, partialBatchVerified=${fixture?.partialBatchVerified === true};不能按普通 PICK 批次代替异常处理审计`, OPTIONS)
|
||||
}
|
||||
context.addCoverageGap(MODULE, OPTIONS.scenario, 'PDA Android/HBuilderX 真机完整闭环',
|
||||
'原子 batch 真实 HTTP 契约已自动化;扫码、弱网恢复、在线草稿和设备交互仍需 Android/HBuilderX 真机验收',
|
||||
'device')
|
||||
|
||||
Reference in New Issue
Block a user