@autifyhq/autify-cli 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -92,11 +92,13 @@ EXAMPLES
92
92
 
93
93
  ```
94
94
  USAGE
95
- $ autify connect client start [--verbose] [--file-logging]
95
+ $ autify connect client start [--verbose] [--file-logging] [--web-workspace-id <value>]
96
96
 
97
97
  FLAGS
98
- --file-logging Logging Autify Connect Client log to a file instead of console.
99
- --verbose Make the operation more talkative.
98
+ --file-logging Logging Autify Connect Client log to a file instead of console.
99
+ --verbose Make the operation more talkative.
100
+ --web-workspace-id=<value> Workspace ID of Autify for Web to create an ephemeral Access Point. If not specified, it
101
+ will use the one configured by `autify connect access-point set`, instead.
100
102
 
101
103
  DESCRIPTION
102
104
  [Experimental] Start Autify Connect Client
@@ -264,16 +266,18 @@ Run a test plan.
264
266
  ```
265
267
  USAGE
266
268
  $ autify mobile test run [TEST-PLAN-URL] [--build-id <value> | --build-path <value>] [-w] [-t <value>] [-v]
269
+ [--max-retry-count <value>]
267
270
 
268
271
  ARGUMENTS
269
272
  TEST-PLAN-URL Test plan URL e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
270
273
 
271
274
  FLAGS
272
- -t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test execution.
273
- -v, --verbose Verbose output
274
- -w, --wait Wait until the test finishes.
275
- --build-id=<value> ID of the already uploaded build.
276
- --build-path=<value> File path to the iOS app (*.app) or Android app (*.apk).
275
+ -t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test execution.
276
+ -v, --verbose Verbose output
277
+ -w, --wait Wait until the test finishes.
278
+ --build-id=<value> ID of the already uploaded build.
279
+ --build-path=<value> File path to the iOS app (*.app) or Android app (*.apk).
280
+ --max-retry-count=<value> Maximum retry count. The command can take up to timeout * (max-retry-count + 1).
277
281
 
278
282
  DESCRIPTION
279
283
  Run a test plan.
@@ -600,26 +604,32 @@ Run a scenario or test plan.
600
604
  ```
601
605
  USAGE
602
606
  $ autify web test run [SCENARIO-OR-TEST-PLAN-URL] [-n <value>] [-r <value>] [--autify-connect <value> |
603
- --autify-connect-client] [--os <value>] [--os-version <value>] [--browser <value>] [--device <value>] [--device-type
604
- <value>] [-w] [-t <value>] [-v]
607
+ --autify-connect-client] [--autify-connect-client-verbose ] [--autify-connect-client-file-logging ] [--os <value>]
608
+ [--os-version <value>] [--browser <value>] [--device <value>] [--device-type <value>] [-w] [-t <value>] [-v]
609
+ [--max-retry-count <value>]
605
610
 
606
611
  ARGUMENTS
607
612
  SCENARIO-OR-TEST-PLAN-URL Scenario URL or Test plan URL e.g.
608
613
  https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
609
614
 
610
615
  FLAGS
611
- -n, --name=<value> Name of the test execution. (Only for test scenario execution.)
612
- -r, --url-replacements=<value>... URL replacements. Example: http://example.com=http://example.net
613
- -t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test execution.
614
- -v, --verbose Verbose output
615
- -w, --wait Wait until the test finishes.
616
- --autify-connect=<value> Name of the Autify Connect Access Point (Only for test scenario execution.)
617
- --autify-connect-client [Experimental] Start Autify Connect Client (Only for test scenario execution.)
618
- --browser=<value> Browser to run the test
619
- --device=<value> Device to run the test
620
- --device-type=<value> Device type to run the test
621
- --os=<value> OS to run the test
622
- --os-version=<value> OS version to run the test
616
+ -n, --name=<value> Name of the test execution. (Only for test scenario execution.)
617
+ -r, --url-replacements=<value>... URL replacements. Example: http://example.com=http://example.net
618
+ -t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test
619
+ execution.
620
+ -v, --verbose Verbose output
621
+ -w, --wait Wait until the test finishes.
622
+ --autify-connect=<value> Name of the Autify Connect Access Point (Only for test scenario execution.)
623
+ --autify-connect-client [Experimental] Start Autify Connect Client (Only for test scenario execution.)
624
+ --autify-connect-client-file-logging [Experimental] Logging Autify Connect Client log to a file instead of console.
625
+ --autify-connect-client-verbose [Experimental] Verbose output for Autify Connect Client (Only for test scenario
626
+ execution.)
627
+ --browser=<value> Browser to run the test
628
+ --device=<value> Device to run the test
629
+ --device-type=<value> Device type to run the test
630
+ --max-retry-count=<value> Maximum retry count. The command can take up to timeout * (max-retry-count + 1).
631
+ --os=<value> OS to run the test
632
+ --os-version=<value> OS version to run the test
623
633
 
624
634
  DESCRIPTION
625
635
  Run a scenario or test plan.
@@ -1,21 +1,25 @@
1
1
  /// <reference types="node" />
2
- import { CLIError } from "@oclif/errors";
3
- export declare class ClientExitError extends CLIError {
4
- readonly exitCode: number | null;
5
- readonly exitSignal: NodeJS.Signals | null;
6
- constructor(exitCode: number | null, exitSignal: NodeJS.Signals | null, logFile?: string);
7
- }
2
+ import { WebClient } from "@autifyhq/autify-sdk";
3
+ declare type EphemeralAccessPoint = Readonly<{
4
+ webClient: WebClient;
5
+ workspaceId: number;
6
+ }>;
7
+ declare type ProcessExit = [code: number | null, signal: NodeJS.Signals | null];
8
8
  export declare type AutifyConnectClient = Readonly<{
9
9
  version: string;
10
10
  logFile?: string;
11
- accessPoint: string;
11
+ accessPointName: string;
12
12
  kill: () => void;
13
13
  waitReady: () => Promise<any[]>;
14
- waitExit: () => Promise<any[]>;
14
+ waitExit: () => Promise<[
15
+ ...ProcessExit,
16
+ ...[deletedAccessPointName?: string]
17
+ ]>;
15
18
  }>;
16
19
  declare type SpawnClientOptions = Readonly<{
17
20
  verbose?: boolean;
18
21
  fileLogging?: boolean;
22
+ ephemeralAccessPoint?: EphemeralAccessPoint;
19
23
  }>;
20
- export declare const spawnClient: (configDir: string, cacheDir: string, { verbose, fileLogging }: SpawnClientOptions) => Promise<AutifyConnectClient>;
24
+ export declare const spawnClient: (configDir: string, cacheDir: string, { verbose, fileLogging, ephemeralAccessPoint }: SpawnClientOptions) => Promise<AutifyConnectClient>;
21
25
  export {};
@@ -1,40 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spawnClient = exports.ClientExitError = void 0;
3
+ exports.spawnClient = void 0;
4
4
  /* eslint-disable unicorn/filename-case */
5
5
  const errors_1 = require("@oclif/errors");
6
6
  const node_child_process_1 = require("node:child_process");
7
- const config_1 = require("../../config");
8
7
  const installClient_1 = require("./installClient");
9
8
  const node_readline_1 = require("node:readline");
10
9
  const node_events_1 = require("node:events");
11
10
  const winston_1 = require("winston");
12
11
  const node_path_1 = require("node:path");
13
- const getOrCreateAccessPoint = (configDir) => {
14
- const accessPoint = (0, config_1.get)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_NAME");
15
- const key = (0, config_1.get)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_KEY");
16
- const isEphemeral = false;
17
- if (!accessPoint || !key)
18
- throw new errors_1.CLIError("Autify Connect Access Point must be set. Use `autify connect access-point set` first.");
19
- return {
20
- accessPoint,
21
- key,
22
- isEphemeral,
23
- };
24
- };
12
+ const config_1 = require("../../config");
13
+ const uuid_1 = require("uuid");
14
+ const EPHEMERAL_ACCESS_POINT_NAME_PREFIX = "autify-cli-";
25
15
  const logger = (0, winston_1.createLogger)({
26
16
  level: "debug",
27
17
  });
18
+ const getOrCreateAccessPoint = async (configDir, ephemeralAccessPoint) => {
19
+ if (!ephemeralAccessPoint) {
20
+ const accessPointName = (0, config_1.get)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_NAME");
21
+ const accessPointKey = (0, config_1.get)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_KEY");
22
+ if (!accessPointName || !accessPointKey)
23
+ throw new errors_1.CLIError("Access Point is not set. Run `autify connect access-point set` first.");
24
+ return { accessPointName, accessPointKey };
25
+ }
26
+ const { webClient, workspaceId } = ephemeralAccessPoint;
27
+ const accessPointName = `${EPHEMERAL_ACCESS_POINT_NAME_PREFIX}${(0, uuid_1.v4)()}`;
28
+ const accessPointKey = (await webClient.createAccessPoint(workspaceId, { name: accessPointName })).data.key;
29
+ return { accessPointName, accessPointKey };
30
+ };
31
+ const deleteAccessPointIfPossible = async (accessPointName, ephemeralAccessPoint) => {
32
+ if (!ephemeralAccessPoint)
33
+ return;
34
+ if (!accessPointName.startsWith(EPHEMERAL_ACCESS_POINT_NAME_PREFIX))
35
+ return;
36
+ const { webClient, workspaceId } = ephemeralAccessPoint;
37
+ try {
38
+ await webClient.deleteAccessPoint(workspaceId, { name: accessPointName });
39
+ return accessPointName;
40
+ }
41
+ catch {
42
+ // Ignore errors since this is best effort.
43
+ }
44
+ };
45
+ const logFormat = (prefix) => winston_1.format.combine(winston_1.format.colorize(), winston_1.format.timestamp(), winston_1.format.align(), winston_1.format.printf(({ timestamp, level, message }) => `${prefix !== null && prefix !== void 0 ? prefix : ""}${timestamp} ${level} ${message}`));
28
46
  const setupLogger = (logFile) => {
29
47
  if (logFile) {
30
48
  logger.add(new winston_1.transports.File({
31
49
  filename: logFile,
32
- format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.timestamp(), winston_1.format.align(), winston_1.format.printf(({ timestamp, level, message }) => `${timestamp} ${level} ${message}`)),
50
+ format: logFormat(),
33
51
  }));
34
52
  }
35
53
  else {
36
54
  logger.add(new winston_1.transports.Console({
37
- format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.timestamp(), winston_1.format.align(), winston_1.format.printf(({ timestamp, level, message }) => `[Autify Connect Client] ${timestamp} ${level} ${message}`)),
55
+ format: logFormat("[Autify Connect Client] "),
38
56
  }));
39
57
  }
40
58
  };
@@ -54,28 +72,17 @@ const onLogMsg = (input, handler) => {
54
72
  }
55
73
  });
56
74
  };
57
- class ClientExitError extends errors_1.CLIError {
58
- constructor(exitCode, exitSignal, logFile) {
59
- let message = `Autify Connect Client exited (code: ${exitCode}, signal: ${exitSignal}).`;
60
- if (logFile)
61
- message += ` See logs at ${logFile}`;
62
- super(message);
63
- this.exitCode = exitCode;
64
- this.exitSignal = exitSignal;
65
- }
66
- }
67
- exports.ClientExitError = ClientExitError;
68
- const spawnClient = async (configDir, cacheDir, { verbose = false, fileLogging = true }) => {
75
+ const spawnClient = async (configDir, cacheDir, { verbose, fileLogging, ephemeralAccessPoint }) => {
69
76
  const state = new node_events_1.EventEmitter();
70
77
  const clientPath = (0, installClient_1.getInstallPath)(cacheDir);
71
78
  const args = ["--log-format", "json"];
72
79
  if (verbose)
73
80
  args.push("--verbose");
74
81
  const version = await (0, installClient_1.getInstallVersion)(clientPath);
75
- const { accessPoint, key } = getOrCreateAccessPoint(configDir);
82
+ const { accessPointName, accessPointKey } = await getOrCreateAccessPoint(configDir, ephemeralAccessPoint);
76
83
  const childProcess = (0, node_child_process_1.spawn)(clientPath, args, {
77
84
  env: {
78
- AUTIFY_CONNECT_KEY: key,
85
+ AUTIFY_CONNECT_KEY: accessPointKey,
79
86
  },
80
87
  });
81
88
  const logFile = fileLogging
@@ -84,9 +91,8 @@ const spawnClient = async (configDir, cacheDir, { verbose = false, fileLogging =
84
91
  setupLogger(logFile);
85
92
  process.on("SIGINT", childProcess.kill);
86
93
  process.on("SIGTERM", childProcess.kill);
87
- childProcess.on("exit", (code, signal) => {
88
- state.emit("error", new ClientExitError(code, signal, logFile));
89
- });
94
+ const clientReady = (0, node_events_1.once)(state, "ready");
95
+ const childProcessExit = (0, node_events_1.once)(childProcess, "exit");
90
96
  childProcess.stderr.pipe(process.stderr);
91
97
  onLogMsg(childProcess.stdout, (msg) => {
92
98
  if (msg.includes("Successfully connected")) {
@@ -96,11 +102,14 @@ const spawnClient = async (configDir, cacheDir, { verbose = false, fileLogging =
96
102
  return {
97
103
  version,
98
104
  logFile,
99
- accessPoint,
105
+ accessPointName,
100
106
  kill: () => childProcess.kill(),
101
- waitReady: async () => (0, node_events_1.once)(state, "ready"),
102
- // Wait a fake event to catch ClientExitError.
103
- waitExit: async () => (0, node_events_1.once)(state, "_"),
107
+ waitReady: async () => clientReady,
108
+ waitExit: async () => {
109
+ const [code, signal] = await childProcessExit;
110
+ const deletedAccessPointName = await deleteAccessPointIfPossible(accessPointName, ephemeralAccessPoint);
111
+ return [code, signal, deletedAccessPointName];
112
+ },
104
113
  };
105
114
  };
106
115
  exports.spawnClient = spawnClient;
@@ -0,0 +1,11 @@
1
+ export declare type TestScenario = Readonly<{
2
+ workspaceId: number;
3
+ testScenarioId: number;
4
+ testPlanId?: never;
5
+ }>;
6
+ export declare type TestPlan = Readonly<{
7
+ workspaceId: number;
8
+ testScenarioId?: never;
9
+ testPlanId: number;
10
+ }>;
11
+ export declare const parseAutifyTestUrl: (url: string) => TestScenario | TestPlan;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseAutifyTestUrl = void 0;
4
+ /* eslint-disable unicorn/filename-case */
5
+ const errors_1 = require("@oclif/errors");
6
+ const parseTestScenarioUrl = (url) => {
7
+ var _a, _b, _c, _d;
8
+ const { pathname } = new URL(url);
9
+ const scenarioUrlPathRegExp = /\/projects\/(?<workspaceId>\d+)\/scenarios\/(?<scenarioId>\d+)/;
10
+ const match = scenarioUrlPathRegExp.exec(pathname);
11
+ const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
12
+ const testScenarioId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.scenarioId) !== null && _d !== void 0 ? _d : "", 10);
13
+ if (!workspaceId || !testScenarioId)
14
+ return;
15
+ return { workspaceId, testScenarioId };
16
+ };
17
+ const parseTestPlanUrl = (url) => {
18
+ var _a, _b, _c, _d;
19
+ const { pathname } = new URL(url);
20
+ const testPlanUrlPathRegExp = /\/projects\/(?<workspaceId>\d+)\/test_plans\/(?<testPlanId>\d+)/;
21
+ const match = testPlanUrlPathRegExp.exec(pathname);
22
+ const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
23
+ const testPlanId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.testPlanId) !== null && _d !== void 0 ? _d : "", 10);
24
+ if (!workspaceId || !testPlanId)
25
+ return;
26
+ return { workspaceId, testPlanId };
27
+ };
28
+ const parseAutifyTestUrl = (url) => {
29
+ const testScenario = parseTestScenarioUrl(url);
30
+ const testPlan = parseTestPlanUrl(url);
31
+ if (testScenario)
32
+ return testScenario;
33
+ if (testPlan)
34
+ return testPlan;
35
+ throw new errors_1.CLIError(`Invalid URL: ${url}`);
36
+ };
37
+ exports.parseAutifyTestUrl = parseAutifyTestUrl;
@@ -1,4 +1,5 @@
1
1
  import { WebClient } from "@autifyhq/autify-sdk";
2
+ import { TestPlan, TestScenario } from "./parseAutifyTestUrl";
2
3
  declare type CapabilityOption = Parameters<WebClient["executeScenarios"]>[1]["capabilities"][number];
3
4
  declare type CreateUrlReplacementRequest = Parameters<WebClient["createUrlReplacement"]>[1];
4
5
  declare type RunTestProps = Readonly<{
@@ -7,8 +8,7 @@ declare type RunTestProps = Readonly<{
7
8
  urlReplacements: CreateUrlReplacementRequest[];
8
9
  autifyConnectAccessPoint?: string;
9
10
  }>;
10
- export declare const runTest: (client: WebClient, url: string, { option, name, urlReplacements, autifyConnectAccessPoint }: RunTestProps) => Promise<{
11
- workspaceId: number;
11
+ export declare const runTest: (client: WebClient, parsedTest: TestScenario | TestPlan, { option, name, urlReplacements, autifyConnectAccessPoint }: RunTestProps) => Promise<{
12
12
  resultId: number;
13
13
  capability: string;
14
14
  }>;
@@ -3,28 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runTest = void 0;
4
4
  /* eslint-disable unicorn/filename-case */
5
5
  const errors_1 = require("@oclif/errors");
6
- const parseScenarioUrl = (url) => {
7
- var _a, _b, _c, _d;
8
- const { pathname } = new URL(url);
9
- const scenarioUrlPathRegExp = /\/projects\/(?<workspaceId>\d+)\/scenarios\/(?<scenarioId>\d+)/;
10
- const match = scenarioUrlPathRegExp.exec(pathname);
11
- const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
12
- const scenarioId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.scenarioId) !== null && _d !== void 0 ? _d : "", 10);
13
- if (!workspaceId || !scenarioId)
14
- return;
15
- return { workspaceId, scenarioId };
16
- };
17
- const parseTestPlanUrl = (url) => {
18
- var _a, _b, _c, _d;
19
- const { pathname } = new URL(url);
20
- const testPlanUrlPathRegExp = /\/projects\/(?<workspaceId>\d+)\/test_plans\/(?<testPlanId>\d+)/;
21
- const match = testPlanUrlPathRegExp.exec(pathname);
22
- const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
23
- const testPlanId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.testPlanId) !== null && _d !== void 0 ? _d : "", 10);
24
- if (!workspaceId || !testPlanId)
25
- return;
26
- return { workspaceId, testPlanId };
27
- };
28
6
  const isCapabilitySpecified = (option) => {
29
7
  return Object.values(option).some(Boolean);
30
8
  };
@@ -52,16 +30,14 @@ const capabilityToString = ({ os, os_version, browser, browser_version, device,
52
30
  .filter((s) => Boolean(s))
53
31
  .join(" ");
54
32
  };
55
- const runTest = async (client, url, { option, name, urlReplacements, autifyConnectAccessPoint }) => {
56
- const scenario = parseScenarioUrl(url);
57
- const testPlan = parseTestPlanUrl(url);
58
- if (scenario) {
59
- const { workspaceId, scenarioId } = scenario;
33
+ const runTest = async (client, parsedTest, { option, name, urlReplacements, autifyConnectAccessPoint }) => {
34
+ const { workspaceId, testScenarioId, testPlanId } = parsedTest;
35
+ if (testScenarioId) {
60
36
  const capability = await getCapability(client, workspaceId, option);
61
37
  const res = await client.executeScenarios(workspaceId, {
62
38
  name,
63
39
  capabilities: [capability],
64
- scenarios: [{ id: scenarioId }],
40
+ scenarios: [{ id: testScenarioId }],
65
41
  // eslint-disable-next-line camelcase
66
42
  url_replacements: urlReplacements,
67
43
  ...(autifyConnectAccessPoint && {
@@ -72,19 +48,17 @@ const runTest = async (client, url, { option, name, urlReplacements, autifyConne
72
48
  }),
73
49
  });
74
50
  return {
75
- workspaceId,
76
51
  resultId: res.data.result_id,
77
52
  capability: capabilityToString(capability),
78
53
  };
79
54
  }
80
- if (testPlan) {
55
+ if (testPlanId) {
81
56
  if (isCapabilitySpecified(option))
82
57
  throw new errors_1.CLIError(`Running TestPlan doesn't support capability override: ${JSON.stringify(option)}`);
83
58
  if (name)
84
59
  throw new errors_1.CLIError(`Running TestPlan doesn't support --name: ${name}`);
85
60
  if (autifyConnectAccessPoint)
86
61
  throw new errors_1.CLIError("Running TestPlan doesn't support Autify Connect Access Point");
87
- const { workspaceId, testPlanId } = testPlan;
88
62
  const urlReplacementIds = [];
89
63
  for await (const urlReplacement of urlReplacements !== null && urlReplacements !== void 0 ? urlReplacements : []) {
90
64
  const res = await client.createUrlReplacement(testPlanId, urlReplacement);
@@ -95,11 +69,10 @@ const runTest = async (client, url, { option, name, urlReplacements, autifyConne
95
69
  await client.deleteUrlReplacement(testPlanId, urlReplacementId);
96
70
  }
97
71
  return {
98
- workspaceId,
99
72
  resultId: res.data.data.id,
100
73
  capability: "configured by test plan",
101
74
  };
102
75
  }
103
- throw new errors_1.CLIError(`Invalid URL: ${url}`);
76
+ throw new errors_1.CLIError("testScenarioId or testPlanId is required.");
104
77
  };
105
78
  exports.runTest = runTest;
@@ -12,7 +12,16 @@ const waitUntil = async (callback, timeoutSecond, intervalSecond, verbose) => {
12
12
  {
13
13
  title: `Waiting... (timeout: ${timeoutSecond} s)`,
14
14
  task: async (ctx, task) => {
15
+ let killed;
16
+ process.on("SIGINT", (signal) => {
17
+ killed = signal;
18
+ });
19
+ process.on("SIGTERM", (signal) => {
20
+ killed = signal;
21
+ });
15
22
  for await (const startTime of (0, promises_1.setInterval)(intervalSecond * 1000, Date.now())) {
23
+ if (killed)
24
+ throw new errors_1.CLIError(`Process was killed by ${killed}.`);
16
25
  const now = Date.now();
17
26
  if (now - startTime > timeoutSecond * 1000) {
18
27
  throw new errors_1.CLIError(`Timeout after ${timeoutSecond} seconds.`);
@@ -5,6 +5,7 @@ export default class ConnectClientStart extends Command {
5
5
  static flags: {
6
6
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  "file-logging": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ "web-workspace-id": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
8
9
  };
9
10
  run(): Promise<void>;
10
11
  }
@@ -1,34 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const autify_sdk_1 = require("@autifyhq/autify-sdk");
3
4
  const core_1 = require("@oclif/core");
4
5
  const spawnClient_1 = require("../../../autify/connect/spawnClient");
6
+ const config_1 = require("../../../config");
7
+ const createEphemeralAccessPointIfNeeded = (configDir, userAgent, workspaceId) => {
8
+ if (!workspaceId)
9
+ return;
10
+ const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
11
+ const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
12
+ const webClient = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
13
+ return {
14
+ webClient,
15
+ workspaceId,
16
+ };
17
+ };
5
18
  class ConnectClientStart extends core_1.Command {
6
19
  async run() {
7
- var _a;
8
20
  const { flags } = await this.parse(ConnectClientStart);
9
- const { configDir, cacheDir } = this.config;
10
- const verbose = flags.verbose;
11
- const fileLogging = flags["file-logging"];
12
- const { version, logFile, accessPoint, waitReady, waitExit } = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
21
+ const { configDir, cacheDir, userAgent } = this.config;
22
+ const { verbose, "file-logging": fileLogging, "web-workspace-id": webWorkspaceId, } = flags;
23
+ const ephemeralAccessPoint = createEphemeralAccessPointIfNeeded(configDir, userAgent, webWorkspaceId);
24
+ const { version, logFile, accessPointName, waitReady, waitExit } = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
13
25
  verbose,
14
26
  fileLogging,
27
+ ephemeralAccessPoint,
15
28
  });
16
- this.log(`Starting Autify Connect Client for Access Point "${accessPoint}" (${version})...`);
29
+ this.log(`Starting Autify Connect Client for Access Point "${accessPointName}" (${version})...`);
17
30
  if (logFile)
18
31
  this.log(`Log file is located at ${logFile}`);
19
- try {
20
- this.log("Waiting until Autify Connect Client is ready...");
21
- await waitReady();
22
- this.log("Autify Connect Client is ready!");
23
- await waitExit();
24
- }
25
- catch (error) {
26
- if (error instanceof spawnClient_1.ClientExitError) {
27
- this.log(error.message);
28
- this.exit((_a = error.exitCode) !== null && _a !== void 0 ? _a : 1);
29
- }
30
- throw error;
31
- }
32
+ this.log("Waiting until Autify Connect Client is ready...");
33
+ await waitReady();
34
+ this.log("Autify Connect Client is ready!");
35
+ const [code, signal, deletedAccessPointName] = await waitExit();
36
+ if (deletedAccessPointName)
37
+ this.log(`Autify Connect Access Point was deleted: "${deletedAccessPointName}"`);
38
+ this.log(`Autify Connect Client exited (code: ${code}, signal: ${signal}).`);
39
+ this.exit(code !== null && code !== void 0 ? code : 1);
32
40
  }
33
41
  }
34
42
  exports.default = ConnectClientStart;
@@ -43,4 +51,7 @@ ConnectClientStart.flags = {
43
51
  description: "Logging Autify Connect Client log to a file instead of console.",
44
52
  default: false,
45
53
  }),
54
+ "web-workspace-id": core_1.Flags.integer({
55
+ description: "Workspace ID of Autify for Web to create an ephemeral Access Point. If not specified, it will use the one configured by `autify connect access-point set`, instead.",
56
+ }),
46
57
  };
@@ -8,6 +8,7 @@ export default class MobileTestRun extends Command {
8
8
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
9
  timeout: import("@oclif/core/lib/interfaces").OptionFlag<number>;
10
10
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ "max-retry-count": import("@oclif/core/lib/interfaces").OptionFlag<number>;
11
12
  };
12
13
  static args: {
13
14
  name: string;
@@ -25,19 +25,48 @@ class MobileTestRun extends core_1.Command {
25
25
  const uploadCommand = new upload_1.default(uploadArgs, this.config);
26
26
  buildId = (await uploadCommand.run()).buildId;
27
27
  }
28
- const res = await client.runTestPlan(testPlanId, {
29
- // eslint-disable-next-line camelcase
30
- build_id: buildId,
31
- });
32
- if (!res.data.id)
33
- throw new errors_1.CLIError(`Failed to run a test plan.`);
34
- const testResultUrl = (0, getTestResultUrl_1.getMobileTestResultUrl)(configDir, workspaceId, res.data.id);
35
- this.log(`${node_emoji_1.default.get("white_check_mark")} Successfully started: ${testResultUrl}`);
28
+ const runTestPlanOnce = async () => {
29
+ const res = await client.runTestPlan(testPlanId, {
30
+ // eslint-disable-next-line camelcase
31
+ build_id: buildId,
32
+ });
33
+ if (!res.data.id)
34
+ throw new errors_1.CLIError(`Failed to run a test plan.`);
35
+ const testResultUrl = (0, getTestResultUrl_1.getMobileTestResultUrl)(configDir, workspaceId, res.data.id);
36
+ this.log(`${node_emoji_1.default.get("white_check_mark")} Successfully started: ${testResultUrl}`);
37
+ return testResultUrl;
38
+ };
39
+ let testResultUrl = await runTestPlanOnce();
36
40
  if (flags.wait) {
37
- const waitArgs = ["--timeout", flags.timeout.toString(), testResultUrl];
38
- if (flags.verbose)
39
- waitArgs.push("--verbose");
40
- await wait_1.default.run(waitArgs);
41
+ const mobileTestWait = async (url) => {
42
+ const waitArgs = ["--timeout", flags.timeout.toString(), url];
43
+ if (flags.verbose)
44
+ waitArgs.push("--verbose");
45
+ try {
46
+ await wait_1.default.run(waitArgs);
47
+ }
48
+ catch (error) {
49
+ if (error.oclif.exit === 0)
50
+ return null;
51
+ return error;
52
+ }
53
+ throw new errors_1.CLIError(`Unexpected behavior.`);
54
+ };
55
+ const maxRetryCount = flags["max-retry-count"];
56
+ let error;
57
+ for await (const [i] of Array.from({
58
+ length: maxRetryCount + 1,
59
+ }).entries()) {
60
+ error = await mobileTestWait(testResultUrl);
61
+ if (error === null)
62
+ this.exit();
63
+ else if (i === maxRetryCount)
64
+ throw error;
65
+ else {
66
+ this.log(`${node_emoji_1.default.get("repeat")} Retrying... (attempt: ${i + 1}/${maxRetryCount})`);
67
+ testResultUrl = await runTestPlanOnce();
68
+ }
69
+ }
41
70
  }
42
71
  else {
43
72
  this.log("To wait for the test result, run the command below:");
@@ -76,6 +105,10 @@ MobileTestRun.flags = {
76
105
  description: "Verbose output",
77
106
  default: false,
78
107
  }),
108
+ "max-retry-count": core_1.Flags.integer({
109
+ description: "Maximum retry count. The command can take up to timeout * (max-retry-count + 1).",
110
+ default: 0,
111
+ }),
79
112
  };
80
113
  MobileTestRun.args = [
81
114
  {
@@ -30,7 +30,8 @@ class MobileTestWait extends core_1.Command {
30
30
  this.exit();
31
31
  }
32
32
  else {
33
- this.error(`${node_emoji_1.default.get("x")} Test didn't pass. See ${testResultUrl}: ${JSON.stringify(data)}`);
33
+ this.log(`${node_emoji_1.default.get("x")} Test didn't pass. See ${testResultUrl}: ${JSON.stringify(data)}`);
34
+ this.exit(1);
34
35
  }
35
36
  }
36
37
  }
@@ -7,6 +7,8 @@ export default class WebTestRun extends Command {
7
7
  "url-replacements": import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
8
8
  "autify-connect": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
9
  "autify-connect-client": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ "autify-connect-client-verbose": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ "autify-connect-client-file-logging": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
12
  os: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
13
  "os-version": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
14
  browser: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -15,6 +17,7 @@ export default class WebTestRun extends Command {
15
17
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
18
  timeout: import("@oclif/core/lib/interfaces").OptionFlag<number>;
17
19
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ "max-retry-count": import("@oclif/core/lib/interfaces").OptionFlag<number>;
18
21
  };
19
22
  static args: {
20
23
  name: string;
@@ -9,6 +9,8 @@ const runTest_1 = require("../../../autify/web/runTest");
9
9
  const getTestResultUrl_1 = require("../../../autify/web/getTestResultUrl");
10
10
  const wait_1 = tslib_1.__importDefault(require("./wait"));
11
11
  const spawnClient_1 = require("../../../autify/connect/spawnClient");
12
+ const errors_1 = require("@oclif/errors");
13
+ const parseAutifyTestUrl_1 = require("../../../autify/web/parseAutifyTestUrl");
12
14
  const parseUrlReplacements = (urlReplacements) => {
13
15
  return urlReplacements.map((s) => {
14
16
  // eslint-disable-next-line camelcase
@@ -46,26 +48,30 @@ class WebTestRun extends core_1.Command {
46
48
  const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
47
49
  const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
48
50
  const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
49
- const verbose = flags.verbose;
51
+ const parsedTest = (0, parseAutifyTestUrl_1.parseAutifyTestUrl)(args["scenario-or-test-plan-url"]);
52
+ const { workspaceId } = parsedTest;
50
53
  let autifyConnectAccessPoint = flags["autify-connect"];
51
54
  let autifyConnectClient;
52
55
  if (flags["autify-connect-client"]) {
53
- const fileLogging = !verbose;
54
56
  autifyConnectClient = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
55
- verbose,
56
- fileLogging,
57
+ verbose: flags["autify-connect-client-verbose"],
58
+ fileLogging: flags["autify-connect-client-file-logging"],
59
+ ephemeralAccessPoint: {
60
+ webClient: client,
61
+ workspaceId,
62
+ },
57
63
  });
58
- const { version, logFile, accessPoint, waitReady } = autifyConnectClient;
59
- autifyConnectAccessPoint = accessPoint;
60
- this.log(`Starting Autify Connect Client for Access Point "${accessPoint}" (${version})...`);
64
+ const { version, logFile, accessPointName, waitReady } = autifyConnectClient;
65
+ autifyConnectAccessPoint = accessPointName;
66
+ this.log(`Starting Autify Connect Client for Access Point "${accessPointName}" (${version})...`);
61
67
  if (logFile)
62
- this.log(`Log file is located at ${logFile}`);
68
+ this.log(`Autify Connect Client log file is located at ${logFile}`);
63
69
  this.log("Waiting until Autify Connect Client is ready...");
64
70
  await waitReady();
65
71
  this.log("Autify Connect Client is ready!");
66
72
  }
67
- try {
68
- const { workspaceId, resultId, capability } = await (0, runTest_1.runTest)(client, args["scenario-or-test-plan-url"], {
73
+ const runTestOnce = async () => {
74
+ const { resultId, capability } = await (0, runTest_1.runTest)(client, parsedTest, {
69
75
  option: capabilityOption,
70
76
  name: flags.name,
71
77
  urlReplacements,
@@ -73,11 +79,40 @@ class WebTestRun extends core_1.Command {
73
79
  });
74
80
  const testResultUrl = (0, getTestResultUrl_1.getWebTestResultUrl)(configDir, workspaceId, resultId);
75
81
  this.log(`${node_emoji_1.default.get("white_check_mark")} Successfully started: ${testResultUrl} (Capability is ${capability})`);
82
+ return testResultUrl;
83
+ };
84
+ try {
85
+ let testResultUrl = await runTestOnce();
76
86
  if (flags.wait) {
77
- const waitArgs = ["--timeout", flags.timeout.toString(), testResultUrl];
78
- if (verbose)
79
- waitArgs.push("--verbose");
80
- await wait_1.default.run(waitArgs);
87
+ const webTestWait = async (url) => {
88
+ const waitArgs = ["--timeout", flags.timeout.toString(), url];
89
+ if (flags.verbose)
90
+ waitArgs.push("--verbose");
91
+ try {
92
+ await wait_1.default.run(waitArgs);
93
+ }
94
+ catch (error) {
95
+ if (error.oclif.exit === 0)
96
+ return null;
97
+ return error;
98
+ }
99
+ throw new errors_1.CLIError(`Unexpected behavior.`);
100
+ };
101
+ const maxRetryCount = flags["max-retry-count"];
102
+ let error;
103
+ for await (const [i] of Array.from({
104
+ length: maxRetryCount + 1,
105
+ }).entries()) {
106
+ error = await webTestWait(testResultUrl);
107
+ if (error === null)
108
+ this.exit();
109
+ else if (i === maxRetryCount)
110
+ throw error;
111
+ else {
112
+ this.log(`${node_emoji_1.default.get("repeat")} Retrying... (attempt: ${i + 1}/${maxRetryCount})`);
113
+ testResultUrl = await runTestOnce();
114
+ }
115
+ }
81
116
  }
82
117
  else {
83
118
  this.log("To wait for the test result, run the command below:");
@@ -86,22 +121,14 @@ class WebTestRun extends core_1.Command {
86
121
  }
87
122
  catch (error) {
88
123
  if (autifyConnectClient) {
89
- try {
90
- this.log("Waiting until Autify Connect Client exits...");
91
- autifyConnectClient.kill();
92
- await autifyConnectClient.waitExit();
93
- }
94
- catch (clientError) {
95
- if (clientError instanceof spawnClient_1.ClientExitError) {
96
- this.log(clientError.message);
97
- throw error;
98
- }
99
- throw clientError;
100
- }
101
- }
102
- else {
103
- throw error;
124
+ this.log("Waiting until Autify Connect Client exits...");
125
+ autifyConnectClient.kill();
126
+ const [code, signal, deletedAccessPointName] = await autifyConnectClient.waitExit();
127
+ if (deletedAccessPointName)
128
+ this.log(`Autify Connect Access Point was deleted: "${deletedAccessPointName}"`);
129
+ this.log(`Autify Connect Client exited (code: ${code}, signal: ${signal}).`);
104
130
  }
131
+ throw error;
105
132
  }
106
133
  }
107
134
  }
@@ -135,6 +162,14 @@ WebTestRun.flags = {
135
162
  exclusive: ["autify-connect"],
136
163
  dependsOn: ["wait"],
137
164
  }),
165
+ "autify-connect-client-verbose": core_1.Flags.boolean({
166
+ description: "[Experimental] Verbose output for Autify Connect Client (Only for test scenario execution.)",
167
+ dependsOn: ["autify-connect-client"],
168
+ }),
169
+ "autify-connect-client-file-logging": core_1.Flags.boolean({
170
+ description: "[Experimental] Logging Autify Connect Client log to a file instead of console.",
171
+ dependsOn: ["autify-connect-client"],
172
+ }),
138
173
  os: core_1.Flags.string({ description: "OS to run the test" }),
139
174
  "os-version": core_1.Flags.string({ description: "OS version to run the test" }),
140
175
  browser: core_1.Flags.string({ description: "Browser to run the test" }),
@@ -155,6 +190,10 @@ WebTestRun.flags = {
155
190
  description: "Verbose output",
156
191
  default: false,
157
192
  }),
193
+ "max-retry-count": core_1.Flags.integer({
194
+ description: "Maximum retry count. The command can take up to timeout * (max-retry-count + 1).",
195
+ default: 0,
196
+ }),
158
197
  };
159
198
  WebTestRun.args = [
160
199
  {
@@ -30,7 +30,8 @@ class WebTestWait extends core_1.Command {
30
30
  this.exit();
31
31
  }
32
32
  else {
33
- this.error(`${node_emoji_1.default.get("x")} Test didn't pass. See ${testResultUrl}: ${JSON.stringify(data)}`);
33
+ this.log(`${node_emoji_1.default.get("x")} Test didn't pass. See ${testResultUrl}: ${JSON.stringify(data)}`);
34
+ this.exit(1);
34
35
  }
35
36
  }
36
37
  }
@@ -1 +1 @@
1
- {"version":"0.8.0","commands":{"connect:access-point:set":{"id":"connect:access-point:set","description":"[Experimental] Set Autify Connect Access Point","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %> --name=NAME","Reading the key from file:\n<%= config.bin %> <%= command.id %> --name=NAME < key.txt"],"flags":{"name":{"name":"name","type":"option","description":"Name of the Autify Connect Access Point already created","required":true,"multiple":false}},"args":[]},"connect:client:install":{"id":"connect:client:install","description":"[Experimental] Install the latest stable version of Autify Connect Client","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{},"args":[]},"connect:client:start":{"id":"connect:client:start","description":"[Experimental] Start Autify Connect Client","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"verbose":{"name":"verbose","type":"boolean","description":"Make the operation more talkative.","allowNo":false},"file-logging":{"name":"file-logging","type":"boolean","description":"Logging Autify Connect Client log to a file instead of console.","allowNo":false}},"args":[]},"mobile:api:describe-test-result":{"id":"mobile:api:describe-test-result","description":"Get a test result.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"ID of the project from which the test results will be obtained.","required":true,"multiple":false},"id":{"name":"id","type":"option","description":"Test Result ID.","required":true,"multiple":false}},"args":[]},"mobile:api:list-test-results":{"id":"mobile:api:list-test-results","description":"List test results.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"ID of the project from which the list of test results will be retrieved.","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"Page number to be retrieved.","required":false,"multiple":false},"per-page":{"name":"per-page","type":"option","description":"Number of test results per page.","required":false,"multiple":false},"test-plan-id":{"name":"test-plan-id","type":"option","description":"ID of the test plan.","required":false,"multiple":false}},"args":[]},"mobile:api:run-test-plan":{"id":"mobile:api:run-test-plan","description":"Run a test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"The ID of the test plan to run.","required":true,"multiple":false},"run-test-plan-request":{"name":"run-test-plan-request","type":"option","description":"The build_id to execute the test plan.","required":true,"multiple":false}},"args":[]},"mobile:api:upload-build":{"id":"mobile:api:upload-build","description":"Upload the build file.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"The ID of the project to upload the build file to.","required":true,"multiple":false},"file":{"name":"file","type":"option","description":"Build file.","required":true,"multiple":false}},"args":[]},"mobile:auth:login":{"id":"mobile:auth:login","description":"Login to Autify for Mobile","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %>","Reading the token from file:\n<%= config.bin %> <%= command.id %> < token.txt"],"flags":{},"args":[]},"mobile:build:upload":{"id":"mobile:build:upload","description":"Upload a build file","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>","Upload build file\n<%= config.bin %> <%= command.id %> --workspace-id AAA ./my.app","Upload build file (JSON output)\n<%= config.bin %> <%= command.id %> --workspace-id AAA ./my.app --json"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"workspace-id":{"name":"workspace-id","type":"option","char":"w","description":"Workspace ID to upload the build file","required":true,"multiple":false}},"args":[{"name":"build-path","description":"File path to the iOS app (*.app) or Android app (*.apk).","required":true}],"_enableJsonFlag":true,"_globalFlags":{"json":{"description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false,"type":"boolean"}}},"mobile:test:run":{"id":"mobile:test:run","description":"Run a test plan.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Run a test plan with a build ID:\n<%= config.bin %> <%= command.id %> --build-id CCC https://mobile-app.autify.com/projects/AAA/test_plans/BBB","Run a test plan with a new build file:\n<%= config.bin %> <%= command.id %> --build-path ./my.[app|apk] https://mobile-app.autify.com/projects/AAA/test_plans/BBB","Run and wait a test plan:\n<%= config.bin %> <%= command.id %> --build-id CCC https://mobile-app.autify.com/projects/AAA/test_plans/BBB --wait --timeout 600"],"flags":{"build-id":{"name":"build-id","type":"option","description":"ID of the already uploaded build.","multiple":false,"exclusive":["build-path"]},"build-path":{"name":"build-path","type":"option","description":"File path to the iOS app (*.app) or Android app (*.apk).","multiple":false,"exclusive":["build-id"]},"wait":{"name":"wait","type":"boolean","char":"w","description":"Wait until the test finishes.","allowNo":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"test-plan-url","description":"Test plan URL e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>","required":true}]},"mobile:test:wait":{"id":"mobile:test:wait","description":"Wait a test result until it finishes.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> https://mobile-app.autify.com/projects/AAA/results/BBB"],"flags":{"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"test-result-url","description":"Test result URL e.g. https://mobile-app.autify.com/projects/<ID>/results/<ID>","required":true}]},"web:api:create-url-replacement":{"id":"web:api:create-url-replacement","description":"Create a new url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"create-url-replacement-request":{"name":"create-url-replacement-request","type":"option","description":"The url to replace","required":true,"multiple":false}},"args":[]},"web:api:delete-url-replacement":{"id":"web:api:delete-url-replacement","description":"Delete a url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"url-replacement-id":{"name":"url-replacement-id","type":"option","description":"url_replacement id","required":true,"multiple":false}},"args":[]},"web:api:describe-result":{"id":"web:api:describe-result","description":"Get a result.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/results/4","required":true,"multiple":false},"result-id":{"name":"result-id","type":"option","description":"For example, 4 for the following URL: https://app.autify.com/projects/1/results/4","required":true,"multiple":false}},"args":[]},"web:api:describe-scenario":{"id":"web:api:describe-scenario","description":"Get a scenario.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios/2","required":true,"multiple":false},"scenario-id":{"name":"scenario-id","type":"option","description":"For example, 2 for the following URL: https://app.autify.com/projects/1/scenarios/2","required":true,"multiple":false}},"args":[]},"web:api:execute-scenarios":{"id":"web:api:execute-scenarios","description":"You can execute any scenarios in your workspace using any execution environments (which is called \"capabilities\" here).","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios","required":true,"multiple":false},"execute-scenarios-request":{"name":"execute-scenarios-request","type":"option","description":"The scenarios and settings to execute","required":true,"multiple":false}},"args":[]},"web:api:execute-schedule":{"id":"web:api:execute-schedule","description":"Run a test plan. (Note: \"Schedule\" is called as \"TestPlan\" now.)","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"schedule-id":{"name":"schedule-id","type":"option","description":"For example, 3 for the following URL: https://app.autify.com/projects/1/test_plans/3","required":true,"multiple":false}},"args":[]},"web:api:list-capabilities":{"id":"web:api:list-capabilities","description":"List available Capabilities.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/capabilities","required":true,"multiple":false},"os":{"name":"os","type":"option","description":"os name to filter","required":false,"multiple":false},"browser":{"name":"browser","type":"option","description":"browser name to filter","required":false,"multiple":false},"device-type":{"name":"device-type","type":"option","description":"device_type name to filter","required":false,"multiple":false}},"args":[]},"web:api:list-results":{"id":"web:api:list-results","description":"List results.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/results","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"The number of page returns.","required":false,"multiple":false},"per-page":{"name":"per-page","type":"option","description":"The number of items returns. Default number is 30 and up to a maximum of 100","required":false,"multiple":false},"test-plan-id":{"name":"test-plan-id","type":"option","description":"Test plan ID used to filter results.","required":false,"multiple":false}},"args":[]},"web:api:list-scenarios":{"id":"web:api:list-scenarios","description":"List scenarios.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"The number of page returns.","required":false,"multiple":false}},"args":[]},"web:api:list-url-replacements":{"id":"web:api:list-url-replacements","description":"List url replacements for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false}},"args":[]},"web:api:update-url-replacement":{"id":"web:api:update-url-replacement","description":"Update a url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"url-replacement-id":{"name":"url-replacement-id","type":"option","description":"url_replacement id","required":true,"multiple":false},"update-url-replacement-request":{"name":"update-url-replacement-request","type":"option","description":"The url to replace. Either pattern_url or replacement_url is required.","required":true,"multiple":false}},"args":[]},"web:auth:login":{"id":"web:auth:login","description":"Login to Autify for Web","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %>","Reading the token from file:\n<%= config.bin %> <%= command.id %> < token.txt"],"flags":{},"args":[]},"web:test:run":{"id":"web:test:run","description":"Run a scenario or test plan.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Run a test scenario (Default capability):\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000","Run a test plan:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/test_plans/0000","Run and wait a test scenario:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --wait --timeout 600","Run a test scenario with a specific capability:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --os \"Windows Server\" --browser Edge","With URL replacements:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 -r http://example.com=http://example.net -r http://example.org=http://example.net","Run a test with specifying the execution name:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --name \"Sample execution\"","Run a test scenario with Autify Connect:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --autify-connect NAME"],"flags":{"name":{"name":"name","type":"option","char":"n","description":"Name of the test execution. (Only for test scenario execution.)","multiple":false},"url-replacements":{"name":"url-replacements","type":"option","char":"r","description":"URL replacements. Example: http://example.com=http://example.net","multiple":true},"autify-connect":{"name":"autify-connect","type":"option","description":"Name of the Autify Connect Access Point (Only for test scenario execution.)","multiple":false,"exclusive":["autify-connect-client"]},"autify-connect-client":{"name":"autify-connect-client","type":"boolean","description":"[Experimental] Start Autify Connect Client (Only for test scenario execution.)","allowNo":false,"dependsOn":["wait"],"exclusive":["autify-connect"]},"os":{"name":"os","type":"option","description":"OS to run the test","multiple":false},"os-version":{"name":"os-version","type":"option","description":"OS version to run the test","multiple":false},"browser":{"name":"browser","type":"option","description":"Browser to run the test","multiple":false},"device":{"name":"device","type":"option","description":"Device to run the test","multiple":false},"device-type":{"name":"device-type","type":"option","description":"Device type to run the test","multiple":false},"wait":{"name":"wait","type":"boolean","char":"w","description":"Wait until the test finishes.","allowNo":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"scenario-or-test-plan-url","description":"Scenario URL or Test plan URL e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>","required":true}]},"web:test:wait":{"id":"web:test:wait","description":"Wait a test result until it finishes.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/results/0000"],"flags":{"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"test-result-url","description":"Test result URL e.g. https://app.autify.com/projects/<ID>/results/<ID>","required":true}]}}}
1
+ {"version":"0.9.0","commands":{"connect:access-point:set":{"id":"connect:access-point:set","description":"[Experimental] Set Autify Connect Access Point","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %> --name=NAME","Reading the key from file:\n<%= config.bin %> <%= command.id %> --name=NAME < key.txt"],"flags":{"name":{"name":"name","type":"option","description":"Name of the Autify Connect Access Point already created","required":true,"multiple":false}},"args":[]},"connect:client:install":{"id":"connect:client:install","description":"[Experimental] Install the latest stable version of Autify Connect Client","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{},"args":[]},"connect:client:start":{"id":"connect:client:start","description":"[Experimental] Start Autify Connect Client","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"verbose":{"name":"verbose","type":"boolean","description":"Make the operation more talkative.","allowNo":false},"file-logging":{"name":"file-logging","type":"boolean","description":"Logging Autify Connect Client log to a file instead of console.","allowNo":false},"web-workspace-id":{"name":"web-workspace-id","type":"option","description":"Workspace ID of Autify for Web to create an ephemeral Access Point. If not specified, it will use the one configured by `autify connect access-point set`, instead.","multiple":false}},"args":[]},"mobile:api:describe-test-result":{"id":"mobile:api:describe-test-result","description":"Get a test result.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"ID of the project from which the test results will be obtained.","required":true,"multiple":false},"id":{"name":"id","type":"option","description":"Test Result ID.","required":true,"multiple":false}},"args":[]},"mobile:api:list-test-results":{"id":"mobile:api:list-test-results","description":"List test results.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"ID of the project from which the list of test results will be retrieved.","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"Page number to be retrieved.","required":false,"multiple":false},"per-page":{"name":"per-page","type":"option","description":"Number of test results per page.","required":false,"multiple":false},"test-plan-id":{"name":"test-plan-id","type":"option","description":"ID of the test plan.","required":false,"multiple":false}},"args":[]},"mobile:api:run-test-plan":{"id":"mobile:api:run-test-plan","description":"Run a test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"The ID of the test plan to run.","required":true,"multiple":false},"run-test-plan-request":{"name":"run-test-plan-request","type":"option","description":"The build_id to execute the test plan.","required":true,"multiple":false}},"args":[]},"mobile:api:upload-build":{"id":"mobile:api:upload-build","description":"Upload the build file.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"The ID of the project to upload the build file to.","required":true,"multiple":false},"file":{"name":"file","type":"option","description":"Build file.","required":true,"multiple":false}},"args":[]},"mobile:auth:login":{"id":"mobile:auth:login","description":"Login to Autify for Mobile","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %>","Reading the token from file:\n<%= config.bin %> <%= command.id %> < token.txt"],"flags":{},"args":[]},"mobile:build:upload":{"id":"mobile:build:upload","description":"Upload a build file","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>","Upload build file\n<%= config.bin %> <%= command.id %> --workspace-id AAA ./my.app","Upload build file (JSON output)\n<%= config.bin %> <%= command.id %> --workspace-id AAA ./my.app --json"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"workspace-id":{"name":"workspace-id","type":"option","char":"w","description":"Workspace ID to upload the build file","required":true,"multiple":false}},"args":[{"name":"build-path","description":"File path to the iOS app (*.app) or Android app (*.apk).","required":true}],"_enableJsonFlag":true,"_globalFlags":{"json":{"description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false,"type":"boolean"}}},"mobile:test:run":{"id":"mobile:test:run","description":"Run a test plan.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Run a test plan with a build ID:\n<%= config.bin %> <%= command.id %> --build-id CCC https://mobile-app.autify.com/projects/AAA/test_plans/BBB","Run a test plan with a new build file:\n<%= config.bin %> <%= command.id %> --build-path ./my.[app|apk] https://mobile-app.autify.com/projects/AAA/test_plans/BBB","Run and wait a test plan:\n<%= config.bin %> <%= command.id %> --build-id CCC https://mobile-app.autify.com/projects/AAA/test_plans/BBB --wait --timeout 600"],"flags":{"build-id":{"name":"build-id","type":"option","description":"ID of the already uploaded build.","multiple":false,"exclusive":["build-path"]},"build-path":{"name":"build-path","type":"option","description":"File path to the iOS app (*.app) or Android app (*.apk).","multiple":false,"exclusive":["build-id"]},"wait":{"name":"wait","type":"boolean","char":"w","description":"Wait until the test finishes.","allowNo":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"max-retry-count":{"name":"max-retry-count","type":"option","description":"Maximum retry count. The command can take up to timeout * (max-retry-count + 1).","multiple":false,"default":0}},"args":[{"name":"test-plan-url","description":"Test plan URL e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>","required":true}]},"mobile:test:wait":{"id":"mobile:test:wait","description":"Wait a test result until it finishes.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> https://mobile-app.autify.com/projects/AAA/results/BBB"],"flags":{"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"test-result-url","description":"Test result URL e.g. https://mobile-app.autify.com/projects/<ID>/results/<ID>","required":true}]},"web:api:create-url-replacement":{"id":"web:api:create-url-replacement","description":"Create a new url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"create-url-replacement-request":{"name":"create-url-replacement-request","type":"option","description":"The url to replace","required":true,"multiple":false}},"args":[]},"web:api:delete-url-replacement":{"id":"web:api:delete-url-replacement","description":"Delete a url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"url-replacement-id":{"name":"url-replacement-id","type":"option","description":"url_replacement id","required":true,"multiple":false}},"args":[]},"web:api:describe-result":{"id":"web:api:describe-result","description":"Get a result.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/results/4","required":true,"multiple":false},"result-id":{"name":"result-id","type":"option","description":"For example, 4 for the following URL: https://app.autify.com/projects/1/results/4","required":true,"multiple":false}},"args":[]},"web:api:describe-scenario":{"id":"web:api:describe-scenario","description":"Get a scenario.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios/2","required":true,"multiple":false},"scenario-id":{"name":"scenario-id","type":"option","description":"For example, 2 for the following URL: https://app.autify.com/projects/1/scenarios/2","required":true,"multiple":false}},"args":[]},"web:api:execute-scenarios":{"id":"web:api:execute-scenarios","description":"You can execute any scenarios in your workspace using any execution environments (which is called \"capabilities\" here).","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios","required":true,"multiple":false},"execute-scenarios-request":{"name":"execute-scenarios-request","type":"option","description":"The scenarios and settings to execute","required":true,"multiple":false}},"args":[]},"web:api:execute-schedule":{"id":"web:api:execute-schedule","description":"Run a test plan. (Note: \"Schedule\" is called as \"TestPlan\" now.)","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"schedule-id":{"name":"schedule-id","type":"option","description":"For example, 3 for the following URL: https://app.autify.com/projects/1/test_plans/3","required":true,"multiple":false}},"args":[]},"web:api:list-capabilities":{"id":"web:api:list-capabilities","description":"List available Capabilities.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/capabilities","required":true,"multiple":false},"os":{"name":"os","type":"option","description":"os name to filter","required":false,"multiple":false},"browser":{"name":"browser","type":"option","description":"browser name to filter","required":false,"multiple":false},"device-type":{"name":"device-type","type":"option","description":"device_type name to filter","required":false,"multiple":false}},"args":[]},"web:api:list-results":{"id":"web:api:list-results","description":"List results.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/results","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"The number of page returns.","required":false,"multiple":false},"per-page":{"name":"per-page","type":"option","description":"The number of items returns. Default number is 30 and up to a maximum of 100","required":false,"multiple":false},"test-plan-id":{"name":"test-plan-id","type":"option","description":"Test plan ID used to filter results.","required":false,"multiple":false}},"args":[]},"web:api:list-scenarios":{"id":"web:api:list-scenarios","description":"List scenarios.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"project-id":{"name":"project-id","type":"option","description":"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios","required":true,"multiple":false},"page":{"name":"page","type":"option","description":"The number of page returns.","required":false,"multiple":false}},"args":[]},"web:api:list-url-replacements":{"id":"web:api:list-url-replacements","description":"List url replacements for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false}},"args":[]},"web:api:update-url-replacement":{"id":"web:api:update-url-replacement","description":"Update a url replacement for the test plan","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %>"],"flags":{"test-plan-id":{"name":"test-plan-id","type":"option","description":"For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15","required":true,"multiple":false},"url-replacement-id":{"name":"url-replacement-id","type":"option","description":"url_replacement id","required":true,"multiple":false},"update-url-replacement-request":{"name":"update-url-replacement-request","type":"option","description":"The url to replace. Either pattern_url or replacement_url is required.","required":true,"multiple":false}},"args":[]},"web:auth:login":{"id":"web:auth:login","description":"Login to Autify for Web","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Start interactive setup:\n<%= config.bin %> <%= command.id %>","Reading the token from file:\n<%= config.bin %> <%= command.id %> < token.txt"],"flags":{},"args":[]},"web:test:run":{"id":"web:test:run","description":"Run a scenario or test plan.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["Run a test scenario (Default capability):\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000","Run a test plan:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/test_plans/0000","Run and wait a test scenario:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --wait --timeout 600","Run a test scenario with a specific capability:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --os \"Windows Server\" --browser Edge","With URL replacements:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 -r http://example.com=http://example.net -r http://example.org=http://example.net","Run a test with specifying the execution name:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --name \"Sample execution\"","Run a test scenario with Autify Connect:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --autify-connect NAME"],"flags":{"name":{"name":"name","type":"option","char":"n","description":"Name of the test execution. (Only for test scenario execution.)","multiple":false},"url-replacements":{"name":"url-replacements","type":"option","char":"r","description":"URL replacements. Example: http://example.com=http://example.net","multiple":true},"autify-connect":{"name":"autify-connect","type":"option","description":"Name of the Autify Connect Access Point (Only for test scenario execution.)","multiple":false,"exclusive":["autify-connect-client"]},"autify-connect-client":{"name":"autify-connect-client","type":"boolean","description":"[Experimental] Start Autify Connect Client (Only for test scenario execution.)","allowNo":false,"dependsOn":["wait"],"exclusive":["autify-connect"]},"autify-connect-client-verbose":{"name":"autify-connect-client-verbose","type":"boolean","description":"[Experimental] Verbose output for Autify Connect Client (Only for test scenario execution.)","allowNo":false,"dependsOn":["autify-connect-client"]},"autify-connect-client-file-logging":{"name":"autify-connect-client-file-logging","type":"boolean","description":"[Experimental] Logging Autify Connect Client log to a file instead of console.","allowNo":false,"dependsOn":["autify-connect-client"]},"os":{"name":"os","type":"option","description":"OS to run the test","multiple":false},"os-version":{"name":"os-version","type":"option","description":"OS version to run the test","multiple":false},"browser":{"name":"browser","type":"option","description":"Browser to run the test","multiple":false},"device":{"name":"device","type":"option","description":"Device to run the test","multiple":false},"device-type":{"name":"device-type","type":"option","description":"Device type to run the test","multiple":false},"wait":{"name":"wait","type":"boolean","char":"w","description":"Wait until the test finishes.","allowNo":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"max-retry-count":{"name":"max-retry-count","type":"option","description":"Maximum retry count. The command can take up to timeout * (max-retry-count + 1).","multiple":false,"default":0}},"args":[{"name":"scenario-or-test-plan-url","description":"Scenario URL or Test plan URL e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>","required":true}]},"web:test:wait":{"id":"web:test:wait","description":"Wait a test result until it finishes.","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/results/0000"],"flags":{"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout seconds when waiting for the finish of the test execution.","multiple":false,"default":300},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false}},"args":[{"name":"test-result-url","description":"Test result URL e.g. https://app.autify.com/projects/<ID>/results/<ID>","required":true}]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autifyhq/autify-cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Autify Command Line Interface (CLI)",
5
5
  "author": "Autify",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "/oclif.manifest.json"
18
18
  ],
19
19
  "dependencies": {
20
- "@autifyhq/autify-sdk": "^0.3.0",
20
+ "@autifyhq/autify-sdk": "^0.4.0",
21
21
  "@oclif/core": "^1",
22
22
  "@oclif/errors": "^1.3.5",
23
23
  "@oclif/plugin-help": "^5",
@@ -35,6 +35,7 @@
35
35
  "tempy": "^3.0.0",
36
36
  "tsimportlib": "^0.0.3",
37
37
  "unzip-stream": "^0.3.1",
38
+ "uuid": "^8.3.2",
38
39
  "which": "^2.0.2",
39
40
  "winston": "^3.8.1"
40
41
  },
@@ -46,10 +47,11 @@
46
47
  "@types/inquirer": "^8.2.1",
47
48
  "@types/listr": "^0.14.4",
48
49
  "@types/mocha": "^9.1.1",
49
- "@types/node": "^16.11.52",
50
+ "@types/node": "^16.11.58",
50
51
  "@types/node-emoji": "^1.8.1",
51
52
  "@types/node-fetch": "^2.6.2",
52
53
  "@types/unzip-stream": "^0.3.1",
54
+ "@types/uuid": "^8.3.4",
53
55
  "chai": "^4",
54
56
  "eslint": "^7.32.0",
55
57
  "eslint-config-oclif": "^4",