@@ -188,6 +188,20 @@ async function run() {
188188 }
189189 console . log ( '##[section]instrumentationArgs: %s' , JSON . stringify ( instrumentationArgs ) ) ;
190190
191+ const neededPermissionsInput : string | undefined = tl . getInput ( 'neededPermissions' ) ;
192+ let neededPermissions : object = [ ] ;
193+ if ( neededPermissionsInput && neededPermissionsInput . length > 0 ) {
194+ neededPermissions = JSON . parse ( neededPermissionsInput )
195+ }
196+ console . log ( '##[section]neededPermissions: %s' , JSON . stringify ( neededPermissions ) ) ;
197+
198+ const deviceActionsInput : string | undefined = tl . getInput ( 'deviceActions' ) ;
199+ let deviceActions : object = { } ;
200+ if ( deviceActionsInput && deviceActionsInput . length > 0 ) {
201+ deviceActions = JSON . parse ( deviceActionsInput )
202+ }
203+ console . log ( '##[section]deviceActions: %s' , JSON . stringify ( deviceActions ) ) ;
204+
191205 let runningInfo : string = getRequiredInput ( 'runningInfo' ) ;
192206
193207 let pipelineLink : string | undefined = undefined ;
@@ -261,7 +275,7 @@ async function run() {
261275 console . log ( '##[section]Generate Group AccessKey Failed!' )
262276 }
263277
264- let testTaskId : any = await triggerTestRun ( HydraLabAPIConfig , runningType , deviceIdentifier , fileSetId , testSuiteClass , timeoutSec , maxStepCount , deviceTestCount , pipelineLink , accessKey , frameworkType , reportAudience , instrumentationArgs , needUninstall , needClearData )
278+ let testTaskId : any = await triggerTestRun ( HydraLabAPIConfig , runningType , deviceIdentifier , fileSetId , testSuiteClass , timeoutSec , maxStepCount , deviceTestCount , pipelineLink , accessKey , frameworkType , reportAudience , instrumentationArgs , needUninstall , needClearData , neededPermissions , deviceActions )
265279 console . log ( `##[section]Triggered test task id: ${ testTaskId } successful!` ) ;
266280
267281 let sleepSecond : number = Math . round ( timeoutSec / 3 ) ;
@@ -475,7 +489,7 @@ async function generateDeviceGroupAccessKey(HydraLabAPIConfig: any, deviceIdenti
475489 return responseContent . key
476490}
477491
478- async function triggerTestRun ( HydraLabAPIConfig : any , runningType : string , deviceIdentifier : string , fileSetId : string , testSuiteClass : string | undefined , timeoutSec : number , maxStepCount : number | undefined , deviceTestCount : number | undefined , pipelineLink : string | undefined , accessKey : any | undefined , frameworkType : string | undefined , reportAudience ?: string , instrumentationArgs ?: object , needUninstall ?: boolean , needClearData ?: boolean ) : Promise < object > {
492+ async function triggerTestRun ( HydraLabAPIConfig : any , runningType : string , deviceIdentifier : string , fileSetId : string , testSuiteClass : string | undefined , timeoutSec : number , maxStepCount : number | undefined , deviceTestCount : number | undefined , pipelineLink : string | undefined , accessKey : any | undefined , frameworkType : string | undefined , reportAudience ?: string , instrumentationArgs ?: object , needUninstall ?: boolean , needClearData ?: boolean , neededPermissions ?: object , deviceActions ?: object ) : Promise < object > {
479493 let json : object = { } ;
480494
481495 Object . assign ( json , { 'runningType' : runningType } ) ;
@@ -520,6 +534,14 @@ async function triggerTestRun(HydraLabAPIConfig: any, runningType: string, devic
520534 }
521535 Object . assign ( json , { "needUninstall" : needUninstall } ) ;
522536 Object . assign ( json , { "needClearData" : needClearData } ) ;
537+
538+ if ( neededPermissions ) {
539+ Object . assign ( json , { "neededPermissions" : neededPermissions } ) ;
540+ }
541+
542+ if ( deviceActions ) {
543+ Object . assign ( json , { "deviceActions" : deviceActions } ) ;
544+ }
523545
524546 let requestParameters = {
525547 method : "post" ,
0 commit comments