Skip to content

Commit 2d6bdd5

Browse files
committed
Add deivce-ids to mobile test run command
1 parent b770fb5 commit 2d6bdd5

File tree

1 file changed

+9
-0
lines changed
  • src/commands/mobile/test

1 file changed

+9
-0
lines changed

src/commands/mobile/test/run.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default class MobileTestRun extends Command {
2323
"File path to the iOS app (*.app, *.ipa) or Android app (*.apk).",
2424
exclusive: ["build-id"],
2525
}),
26+
"device-ids": Flags.string({
27+
description: "Comma-separated device IDs to run the test plan.",
28+
exclusive: ["device-ids"],
29+
}),
2630
wait: Flags.boolean({
2731
char: "w",
2832
description: "Wait until the test finishes.",
@@ -57,6 +61,9 @@ export default class MobileTestRun extends Command {
5761
const { args, flags } = await this.parse(MobileTestRun);
5862
let buildId = flags["build-id"];
5963
const buildPath = flags["build-path"];
64+
const deviceIds = flags["device-ids"]
65+
? flags["device-ids"].split(",").map((s) => s.trim())
66+
: undefined;
6067
const { configDir, userAgent } = this.config;
6168
const client = getMobileClient(configDir, userAgent);
6269
const { workspaceId, testPlanId } = parseTestPlanUrl(args["test-plan-url"]);
@@ -71,6 +78,8 @@ export default class MobileTestRun extends Command {
7178
const res = await client.runTestPlan(testPlanId, {
7279
// eslint-disable-next-line camelcase
7380
build_id: buildId,
81+
// eslint-disable-next-line camelcase
82+
device_ids: deviceIds,
7483
});
7584
if (!res.data.id) throw new Errors.CLIError(`Failed to run a test plan.`);
7685
const testResultUrl = getMobileTestResultUrl(

0 commit comments

Comments
 (0)