From 7c0f2fc5f582c40e69fa451b3ee6672c0a026e07 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Sat, 8 Aug 2026 11:50:55 +0800 Subject: [PATCH] test: keep Mojia samples within customer box limits --- scripts/admin-test-env-modules/inbound-measurement.mjs | 5 +++-- scripts/mojia-measurement-scenario.mjs | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/admin-test-env-modules/inbound-measurement.mjs b/scripts/admin-test-env-modules/inbound-measurement.mjs index 4eba29bc9..795daae46 100644 --- a/scripts/admin-test-env-modules/inbound-measurement.mjs +++ b/scripts/admin-test-env-modules/inbound-measurement.mjs @@ -173,7 +173,8 @@ export async function run(context) { } const scanPath = `/api/platform/v1/first-leg/inbounds/${inboundId}/measurement/carton-scans?${query(tenantId)}` - const firstDimensions = { length: 60.1, width: 40.2, height: 30.3, weight: 12.5 } + // Keep the isolated sample inside the customer's largest configured inner box (60x50x50cm). + const firstDimensions = { length: 59.1, width: 40.2, height: 30.3, weight: 12.5 } const firstScanResponse = await multipartRequest(context, scanPath, { boxCode, ...firstDimensions, machineNo: 'MJ-ADMIN-E2E-01', measuredAt: new Date().toISOString().slice(0, 19), }) @@ -214,7 +215,7 @@ export async function run(context) { && Number(countResult?.measurementVersion) === Number(firstScan.measurementVersion) + 1, `version=${countResult?.measurementVersion ?? 'missing'}`, OPTIONS) - const replacement = { length: 61.1, width: 41.2, height: 31.3, weight: 13.6 } + const replacement = { length: 59.5, width: 41.2, height: 31.3, weight: 13.6 } const rescanResponse = await multipartRequest(context, scanPath, { boxCode, ...replacement, machineNo: 'MJ-ADMIN-E2E-02', measuredAt: new Date().toISOString().slice(0, 19), }) diff --git a/scripts/mojia-measurement-scenario.mjs b/scripts/mojia-measurement-scenario.mjs index 65f09b8d9..24170b308 100644 --- a/scripts/mojia-measurement-scenario.mjs +++ b/scripts/mojia-measurement-scenario.mjs @@ -126,7 +126,7 @@ export async function runMojiaMeasurementScenario(run, options = {}) { const boxCode = `${afterPrint.summary.inboundCode}#${printedTotal}-1` const scanPath = `/api/platform/v1/first-leg/inbounds/${inboundId}/measurement/carton-scans?tenantId=${resolvedTenantId}` const firstFields = { - boxCode, length: 60.1, width: 40.2, height: 30.3, weight: 12.5, + boxCode, length: 59.1, width: 40.2, height: 30.3, weight: 12.5, machineNo: 'MJ-ADMIN-E2E-01', measuredAt: '2026-08-08T10:00:00', } const firstResponse = await multipartRequest(run, scanPath, firstFields, imagePath) @@ -149,14 +149,14 @@ export async function runMojiaMeasurementScenario(run, options = {}) { } const rescanResponse = await multipartRequest(run, scanPath, { - boxCode, length: 61.1, width: 41.2, height: 31.3, weight: 13.5, + boxCode, length: 59.5, width: 41.2, height: 31.3, weight: 13.5, machineNo: 'MJ-ADMIN-E2E-02', measuredAt: '2026-08-08T10:01:00', }, imagePath) const rescan = requireData(run, '墨家同箱复测覆盖', rescanResponse) const rescanPassed = rescan.created === false && String(rescan.itemId) === String(first.itemId) && rescan.confirmedPackageCount === printedTotal - && Number(rescan.lengthCm) === 61.1 + && Number(rescan.lengthCm) === 59.5 record(run, '墨家同箱复测保留人工箱数', rescanResponse, rescanPassed, `itemId=${rescan.itemId}, confirmedPackageCount=${rescan.confirmedPackageCount}`) if (!rescanPassed) throw new Error('同箱复测没有覆盖设备值或覆盖人工箱数')