@@ -23,6 +23,10 @@ export default class MobileTestRun extends Command {
23
23
"File path to the iOS app (*.app, *.ipa) or Android app (*.apk)." ,
24
24
exclusive : [ "build-id" ] ,
25
25
} ) ,
26
+ "device-ids" : Flags . string ( {
27
+ description : "Comma-separated device IDs to run the test plan." ,
28
+ exclusive : [ "device-ids" ] ,
29
+ } ) ,
26
30
wait : Flags . boolean ( {
27
31
char : "w" ,
28
32
description : "Wait until the test finishes." ,
@@ -57,6 +61,9 @@ export default class MobileTestRun extends Command {
57
61
const { args, flags } = await this . parse ( MobileTestRun ) ;
58
62
let buildId = flags [ "build-id" ] ;
59
63
const buildPath = flags [ "build-path" ] ;
64
+ const deviceIds = flags [ "device-ids" ]
65
+ ? flags [ "device-ids" ] . split ( "," ) . map ( ( s ) => s . trim ( ) )
66
+ : undefined ;
60
67
const { configDir, userAgent } = this . config ;
61
68
const client = getMobileClient ( configDir , userAgent ) ;
62
69
const { workspaceId, testPlanId } = parseTestPlanUrl ( args [ "test-plan-url" ] ) ;
@@ -71,6 +78,8 @@ export default class MobileTestRun extends Command {
71
78
const res = await client . runTestPlan ( testPlanId , {
72
79
// eslint-disable-next-line camelcase
73
80
build_id : buildId ,
81
+ // eslint-disable-next-line camelcase
82
+ device_ids : deviceIds ,
74
83
} ) ;
75
84
if ( ! res . data . id ) throw new Errors . CLIError ( `Failed to run a test plan.` ) ;
76
85
const testResultUrl = getMobileTestResultUrl (
0 commit comments