@@ -10,12 +10,14 @@ program
1010 . requiredOption ( '-c, --config <config>' , 'Config file in json format' , value => value )
1111 . option ( '-w, --workingDirectory <workingDirectory>' , 'Working directory' )
1212 . option ( '-r, --replace <replace>' , 'Replace tags. Example: tag1:=value,tag2:=value . No space in string' )
13+ . option ( '-e, --execution <execution>' , 'Execution style dry or wet. Default is wet. -e dry|wet' )
1314
1415program . on ( '-h, --help' , ( ) => {
1516 console . log ( '' )
1617 console . log ( 'Example calls:' )
1718 console . log ( ' $ scenario-generate --config config.json' )
1819 console . log ( ' $ scenario-generate -c config.json' )
20+ console . log ( ' $ scenario-generate -c config.json -e dry' )
1921
2022 console . log ( ' $ scenario-generate --config config.json --replace url:=http://localhost:8080/led/api/v1,valuDate:=2022-10-01' )
2123 console . log ( ' $ scenario-generate -c config.json -r url:=http://localhost:8080/led/api/v1,valuDate:=2022-10-01' )
@@ -35,11 +37,16 @@ input.replace = {
3537
3638const scenarioJson = scenarioAlgorithms . createScenarios ( input )
3739
38- sync . executeBlackBox ( scenarioJson , 0 )
39- . then ( data => {
40- console . log ( JSON . stringify ( data , null , 2 ) )
41- } )
42- . catch ( e => {
43- console . log ( e )
44- } )
40+ if ( program . opts ( ) . execution && program . opts ( ) . execution . toLowerCase ( ) . includes ( 'dry' ) ) {
41+ console . log ( JSON . stringify ( scenarioJson , null , 2 ) )
4542
43+ }
44+ else {
45+ sync . executeBlackBox ( scenarioJson , 0 )
46+ . then ( data => {
47+ console . log ( JSON . stringify ( data , null , 2 ) )
48+ } )
49+ . catch ( e => {
50+ console . log ( e )
51+ } )
52+ }
0 commit comments