33const { Command, Option } = require ( 'commander' ) ;
44const program = new Command ( ) ;
55const { storybook } = require ( './commands/storybook' ) ;
6- const { validateProjectToken, validateLatestBuild, validateConfig } = require ( './commands/utils/validate' ) ;
6+ const { validateProjectToken, validateLatestBuild, validateConfig, validateTunnel } = require ( './commands/utils/validate' ) ;
77const { createConfig } = require ( './commands/config' ) ;
88const { version } = require ( './package.json' ) ;
99const { checkUpdate } = require ( './commands/utils/package' ) ;
@@ -12,7 +12,7 @@ program
1212 . name ( 'smartui' )
1313 . description ( 'CLI to help you run your SmartUI tests on LambdaTest platform' )
1414 . version ( 'v' + version )
15- . addOption ( new Option ( '--env <prod|stage>' , 'Runtime environment option' ) . choices ( [ 'prod' , 'stage' ] ) ) ;
15+ . addOption ( new Option ( '--env <prod|stage>' , 'Runtime environment option' ) . choices ( [ 'prod' , 'stage' , 'dev' ] ) ) ;
1616
1717const configCommand = program . command ( 'config' )
1818 . description ( 'Manage LambdaTest SmartUI config' )
@@ -50,10 +50,14 @@ program.command('storybook')
5050 console . log ( JSON . stringify ( error , null , 2 ) ) ;
5151 process . exit ( 1 ) ;
5252 }
53+ if ( options . config ) {
54+ options . tunnel = validateTunnel ( options . config ) ;
55+ console . log ( `[smartui] Tunnel Config : ${ JSON . stringify ( options . tunnel , null , 2 ) } ` ) ;
56+ }
5357 if ( options . config ) {
5458 options . config = validateConfig ( options . config ) ;
5559 }
56-
60+
5761 await validateProjectToken ( options ) ;
5862 if ( ! options . forceRebuild ) await validateLatestBuild ( options ) ;
5963 storybook ( serve , options ) ;
0 commit comments