test: prepare measurement review fixtures without approval
This commit is contained in:
@@ -432,6 +432,7 @@ export function parseArguments(argv) {
|
||||
if (fixtureIndex >= 0) modules.splice(fixtureIndex, 1)
|
||||
}
|
||||
if (values.has('prepare-domestic-pda-h5') && values.get('prepare-domestic-pda-h5') !== 'true') throw new Error('prepare-domestic-pda-h5 必须明确为 true;完整验收请省略此参数')
|
||||
if (values.has('prepare-measurement-review') && values.get('prepare-measurement-review') !== 'true') throw new Error('prepare-measurement-review 必须明确为 true')
|
||||
return {
|
||||
environment,
|
||||
gateway: (values.get('gateway') || envValue('ADMIN_TEST_GATEWAY', 'ADMIN_GRAY_GATEWAY')).replace(/\/$/, ''),
|
||||
@@ -456,6 +457,7 @@ export function parseArguments(argv) {
|
||||
waitSplitSequence: Number(values.get('wait-split-sequence') || 1),
|
||||
waitSplitRandomValue: Number(values.get('wait-split-random-value') || values.get('wait-split-sequence') || 1),
|
||||
prepareDropshipManualCount: values.get('prepare-dropship-manual-count') === 'true',
|
||||
prepareMeasurementReview: values.get('prepare-measurement-review') === 'true',
|
||||
verifyPalletLocationGuide: values.has('verify-pallet-location-guide'),
|
||||
routeMode: values.get('route-mode') || 'fixed',
|
||||
quiet: values.get('quiet') === 'true',
|
||||
@@ -492,6 +494,11 @@ export function validateExecutionOptions(options) {
|
||||
if (options.environment && !['test', 'gray'].includes(options.environment)) throw new Error('Only test or explicit gray acceptance is supported')
|
||||
if (options.f40TaxMode && !['BUY_DECLARATION', 'TAX_REFUND'].includes(options.f40TaxMode)) throw new Error('f40-tax-mode 必须为 BUY_DECLARATION 或 TAX_REFUND')
|
||||
if (options.prepareDomesticPdaH5 && (options.requestedModules?.length !== 1 || options.requestedModules[0] !== 'phase5-root-fulfillment')) throw new Error('prepare-domestic-pda-h5 仅允许单独指定 phase5-root-fulfillment')
|
||||
if (options.prepareMeasurementReview && (options.environment !== 'test'
|
||||
|| options.requestedModules?.length !== 1 || options.requestedModules[0] !== 'inbound-measurement'
|
||||
|| options.waitSplitCount !== 1 || options.prepareDomesticPdaH5 || options.prepareDropshipManualCount)) {
|
||||
throw new Error('prepare-measurement-review 仅允许 TEST 单票 inbound-measurement 待审准备,不能混用其他准备模式或后续模块')
|
||||
}
|
||||
if ('overseasGateway' in options) throw new Error('Use the single gateway option')
|
||||
if (options.modules.some((module) => ['phase3-loading', 'phase3-container-loading', 'phase5-root-fulfillment'].includes(module))
|
||||
&& (!options.pdaUsername?.trim() || !options.pdaPassword?.trim())) {
|
||||
@@ -1956,6 +1963,7 @@ export class AcceptanceRun {
|
||||
break
|
||||
}
|
||||
if (module === 'inbound-measurement'
|
||||
&& !this.options.prepareMeasurementReview
|
||||
&& this.captureWaitSplitFixture(this.options.waitSplitSequence || 1)) {
|
||||
await this.createAdditionalWaitSplitFixtures()
|
||||
}
|
||||
@@ -2007,7 +2015,7 @@ export class AcceptanceRun {
|
||||
plannedModules: [...this.options.modules],
|
||||
defaultModules: [...DEFAULT_MODULES],
|
||||
defaultPlanSelected: DEFAULT_MODULES.every((name) => this.options.modules.includes(name)),
|
||||
preparationOnly: this.options.prepareDomesticPdaH5 === true || this.options.prepareDropshipManualCount === true,
|
||||
preparationOnly: this.options.prepareDomesticPdaH5 === true || this.options.prepareDropshipManualCount === true || this.options.prepareMeasurementReview === true,
|
||||
returnMainChainOnly: this.options.returnMainChainOnly === true,
|
||||
evidenceType: 'HTTP',
|
||||
pageAcceptance: 'NOT_VERIFIED',
|
||||
@@ -2016,6 +2024,7 @@ export class AcceptanceRun {
|
||||
success: this.fatal === null && summary.failed === 0, fatal: this.fatal,
|
||||
fullCoverage: this.coverageGaps.length === 0 && !this.modules.some(module => module.skipped),
|
||||
...(this.options.prepareDomesticPdaH5 ? { fullAcceptance: false, purpose: 'DOMESTIC_PDA_H5_FIXTURE' } : {}),
|
||||
...(this.options.prepareMeasurementReview ? { fullAcceptance: false, purpose: 'MEASUREMENT_REVIEW_UI_FIXTURE' } : {}),
|
||||
summary,
|
||||
modules: this.modules, scenarios: this.scenarios, deploymentBlockers: this.deploymentBlockers,
|
||||
coverageGaps: this.coverageGaps,
|
||||
|
||||
Reference in New Issue
Block a user