@autifyhq/autify-cli 0.9.0 → 0.10.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
@@ -19,8 +19,9 @@ See our official document: https://help.autify.com/docs/autify-command-line-inte
19
19
  # Commands
20
20
 
21
21
  <!-- commands -->
22
+ * [`autify connect access-point create`](#autify-connect-access-point-create)
22
23
  * [`autify connect access-point set`](#autify-connect-access-point-set)
23
- * [`autify connect client install`](#autify-connect-client-install)
24
+ * [`autify connect client install [VERSION]`](#autify-connect-client-install-version)
24
25
  * [`autify connect client start`](#autify-connect-client-start)
25
26
  * [`autify help [COMMAND]`](#autify-help-command)
26
27
  * [`autify mobile api describe-test-result`](#autify-mobile-api-describe-test-result)
@@ -47,6 +48,25 @@ See our official document: https://help.autify.com/docs/autify-command-line-inte
47
48
  * [`autify web test run SCENARIO-OR-TEST-PLAN-URL`](#autify-web-test-run-scenario-or-test-plan-url)
48
49
  * [`autify web test wait TEST-RESULT-URL`](#autify-web-test-wait-test-result-url)
49
50
 
51
+ ## `autify connect access-point create`
52
+
53
+ [Experimental] Create an Autify Connect Access Point
54
+
55
+ ```
56
+ USAGE
57
+ $ autify connect access-point create --name <value> [--web-workspace-id <value>]
58
+
59
+ FLAGS
60
+ --name=<value> (required) Name of Autify Connect Access Point to be created
61
+ --web-workspace-id=<value> Workspace ID of Autify for Web to which the Access Point belong
62
+
63
+ DESCRIPTION
64
+ [Experimental] Create an Autify Connect Access Point
65
+
66
+ EXAMPLES
67
+ $ autify connect access-point create --name NAME --web-workspace-id ID
68
+ ```
69
+
50
70
  ## `autify connect access-point set`
51
71
 
52
72
  [Experimental] Set Autify Connect Access Point
@@ -71,19 +91,32 @@ EXAMPLES
71
91
  $ autify connect access-point set --name=NAME < key.txt
72
92
  ```
73
93
 
74
- ## `autify connect client install`
94
+ ## `autify connect client install [VERSION]`
75
95
 
76
- [Experimental] Install the latest stable version of Autify Connect Client
96
+ [Experimental] Install Autify Connect Client
77
97
 
78
98
  ```
79
99
  USAGE
80
- $ autify connect client install
100
+ $ autify connect client install [VERSION]
101
+
102
+ ARGUMENTS
103
+ VERSION [default: v0.6.2] Specify the target version of Autify Connect Client.
81
104
 
82
105
  DESCRIPTION
83
- [Experimental] Install the latest stable version of Autify Connect Client
106
+ [Experimental] Install Autify Connect Client
84
107
 
85
108
  EXAMPLES
86
- $ autify connect client install
109
+ (Recommended) Install the supported version:
110
+
111
+ $ autify connect client install
112
+
113
+ Install a specific version:
114
+
115
+ $ autify connect client install v0.6.1
116
+
117
+ Install a stable version:
118
+
119
+ $ autify connect client install stable
87
120
  ```
88
121
 
89
122
  ## `autify connect client start`
@@ -92,13 +125,15 @@ EXAMPLES
92
125
 
93
126
  ```
94
127
  USAGE
95
- $ autify connect client start [--verbose] [--file-logging] [--web-workspace-id <value>]
128
+ $ autify connect client start [--verbose] [--file-logging] [--debug-server-port <value>] [--web-workspace-id <value>]
96
129
 
97
130
  FLAGS
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.
131
+ --debug-server-port=<value> [default: 3000] The server for debugging and monitoring launches on your local machine on
132
+ the given port.
133
+ --file-logging Logging Autify Connect Client log to a file instead of console.
134
+ --verbose Make the operation more talkative.
135
+ --web-workspace-id=<value> Workspace ID of Autify for Web to create an ephemeral Access Point. If not specified, it
136
+ will use the one configured by `autify connect access-point set`, instead.
102
137
 
103
138
  DESCRIPTION
104
139
  [Experimental] Start Autify Connect Client
@@ -604,32 +639,38 @@ Run a scenario or test plan.
604
639
  ```
605
640
  USAGE
606
641
  $ autify web test run [SCENARIO-OR-TEST-PLAN-URL] [-n <value>] [-r <value>] [--autify-connect <value> |
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>]
642
+ --autify-connect-client] [--autify-connect-client-verbose ] [--autify-connect-client-file-logging ]
643
+ [--autify-connect-client-debug-server-port <value> ] [--os <value>] [--os-version <value>] [--browser <value>]
644
+ [--device <value>] [--device-type <value>] [-w] [-t <value>] [-v] [--max-retry-count <value>]
610
645
 
611
646
  ARGUMENTS
612
647
  SCENARIO-OR-TEST-PLAN-URL Scenario URL or Test plan URL e.g.
613
648
  https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
614
649
 
615
650
  FLAGS
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
651
+ -n, --name=<value> Name of the test execution. (Only for test scenario execution.)
652
+ -r, --url-replacements=<value>... URL replacements. Example: http://example.com=http://example.net
653
+ -t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the
654
+ test execution.
655
+ -v, --verbose Verbose output
656
+ -w, --wait Wait until the test finishes.
657
+ --autify-connect=<value> Name of the Autify Connect Access Point (Only for test scenario
658
+ execution.)
659
+ --autify-connect-client [Experimental] Start Autify Connect Client (Only for test scenario
660
+ execution.)
661
+ --autify-connect-client-debug-server-port=<value> [Experimental] [default: 3000] Port for Autify Connect Client debug
662
+ server.
663
+ --autify-connect-client-file-logging [Experimental] Logging Autify Connect Client log to a file instead
664
+ of console.
665
+ --autify-connect-client-verbose [Experimental] Verbose output for Autify Connect Client (Only for
666
+ test scenario execution.)
667
+ --browser=<value> Browser to run the test
668
+ --device=<value> Device to run the test
669
+ --device-type=<value> Device type to run the test
670
+ --max-retry-count=<value> Maximum retry count. The command can take up to timeout *
671
+ (max-retry-count + 1).
672
+ --os=<value> OS to run the test
673
+ --os-version=<value> OS version to run the test
633
674
 
634
675
  DESCRIPTION
635
676
  Run a scenario or test plan.
package/bin/dev.cmd CHANGED
@@ -1,3 +1,17 @@
1
- @echo off
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
2
9
 
3
- node "%~dp0\dev" %*
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\dev" %*
package/bin/run.cmd CHANGED
@@ -1,3 +1,17 @@
1
- @echo off
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
2
9
 
3
- node "%~dp0\run" %*
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\run" %*
@@ -0,0 +1,2 @@
1
+ export declare const confirmOverwriteAccessPoint: (configDir: string) => Promise<void>;
2
+ export declare const saveAccessPoint: (configDir: string, name: string, key: string) => string;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveAccessPoint = exports.confirmOverwriteAccessPoint = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable unicorn/filename-case */
6
+ const errors_1 = require("@oclif/errors");
7
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
+ const config_1 = require("../../config");
9
+ const confirmOverwriteAccessPoint = async (configDir) => {
10
+ const existingName = (0, config_1.get)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_NAME");
11
+ if (existingName) {
12
+ const message = `You've already set an Access Point at ${configDir} (name: ${existingName}). Are you ok to clear its configuration from this machine?`;
13
+ const res = await inquirer_1.default.prompt([
14
+ {
15
+ name: "confirmed",
16
+ message,
17
+ type: "confirm",
18
+ default: false,
19
+ },
20
+ ]);
21
+ if (!res.confirmed) {
22
+ throw new errors_1.CLIError(`Cancelled to overwrite the existing Access Point. It stays as is (name: ${existingName})`);
23
+ }
24
+ }
25
+ };
26
+ exports.confirmOverwriteAccessPoint = confirmOverwriteAccessPoint;
27
+ const saveAccessPoint = (configDir, name, key) => {
28
+ (0, config_1.set)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_NAME", name);
29
+ (0, config_1.set)(configDir, "AUTIFY_CONNECT_ACCESS_POINT_KEY", key);
30
+ return (`Access Point name (${name}) and key (****) are stored in ${configDir}. ` +
31
+ "Execute `autify connect client start` to start a client with this Access Point.");
32
+ };
33
+ exports.saveAccessPoint = saveAccessPoint;
@@ -1,6 +1,15 @@
1
- export declare const getInstallPath: (cacheDir: string) => string;
1
+ import { CLIError } from "@oclif/errors";
2
+ export declare const AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION = "v0.6.2";
3
+ export declare type ClientMode = "fake" | "real";
4
+ export declare class ConnectClientVersionMismatchError extends CLIError {
5
+ readonly expected: string;
6
+ readonly reality: string;
7
+ constructor(expected: string, reality: string);
8
+ }
9
+ export declare const validateVersion: (versionString: string, version: string) => Promise<void>;
10
+ export declare const getInstallPath: (configDir: string, cacheDir: string) => string;
2
11
  export declare const getInstallVersion: (path: string) => Promise<string>;
3
- export declare const installClient: (cacheDir: string) => Promise<{
12
+ export declare const installClient: (configDir: string, cacheDir: string, version: string) => Promise<{
4
13
  version: string;
5
14
  path: string;
6
15
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installClient = exports.getInstallVersion = exports.getInstallPath = void 0;
3
+ exports.installClient = exports.getInstallVersion = exports.getInstallPath = exports.validateVersion = exports.ConnectClientVersionMismatchError = exports.AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /* eslint-disable unicorn/filename-case */
6
6
  const errors_1 = require("@oclif/errors");
@@ -10,8 +10,19 @@ const node_fs_1 = require("node:fs");
10
10
  const node_stream_1 = require("node:stream");
11
11
  const node_util_1 = require("node:util");
12
12
  const node_path_1 = require("node:path");
13
- const node_child_process_1 = require("node:child_process");
14
13
  const unzip_stream_1 = require("unzip-stream");
14
+ const node_child_process_1 = require("node:child_process");
15
+ const config_1 = require("../../config");
16
+ // Update whenever to bump supported version.
17
+ exports.AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION = "v0.6.2";
18
+ const getMode = (configDir) => {
19
+ const mode = (0, config_1.get)(configDir, "AUTIFY_CONNECT_CLIENT_MODE");
20
+ if (!mode)
21
+ return "real";
22
+ if (!["fake", "real"].includes(mode))
23
+ throw new errors_1.CLIError(`Unknown value is specified by AUTIFY_CONNECT_CLIENT_MODE: ${mode}`);
24
+ return mode;
25
+ };
15
26
  const getOs = () => {
16
27
  const os = node_process_1.platform;
17
28
  if (os === "linux")
@@ -32,15 +43,18 @@ const getArch = () => {
32
43
  throw new errors_1.CLIError(`Unsupported Architecture: ${node_process_1.arch}`);
33
44
  };
34
45
  const getExt = () => (getOs() === "windows" ? "zip" : "tar.gz");
35
- const baseUrl = "https://autifyconnect.s3.ap-northeast-1.amazonaws.com/autifyconnect/versions/stable";
36
- const getUrl = () => {
46
+ const realBaseUrl = "https://autifyconnect.s3.ap-northeast-1.amazonaws.com/autifyconnect/versions";
47
+ const fakeBaseUrl = "https://autifyconnect.s3.ap-northeast-1.amazonaws.com/fake/versions";
48
+ const getUrl = (mode, version) => {
49
+ const baseUrl = mode === "fake" ? fakeBaseUrl : realBaseUrl;
50
+ const prefix = mode === "fake" ? "autifyconnect-fake" : "autifyconnect";
37
51
  const os = getOs();
38
52
  const arch = getArch();
39
53
  const ext = getExt();
40
- return new URL(`${baseUrl}/autifyconnect_${os}_${arch}.${ext}`);
54
+ return new URL(`${baseUrl}/${version}/${prefix}_${os}_${arch}.${ext}`);
41
55
  };
42
- const download = async (workspaceDir) => {
43
- const url = getUrl();
56
+ const download = async (workspaceDir, mode, version) => {
57
+ const url = getUrl(mode, version);
44
58
  const downloadPath = (0, node_path_1.join)(workspaceDir, (0, node_path_1.basename)(url.pathname));
45
59
  const response = await (0, node_fetch_1.default)(url);
46
60
  if (!response.ok)
@@ -52,56 +66,79 @@ const download = async (workspaceDir) => {
52
66
  const extract = async (downloadPath) => {
53
67
  const file = (0, node_path_1.basename)(downloadPath);
54
68
  const dir = (0, node_path_1.dirname)(downloadPath);
69
+ const binaryName = file.startsWith("autifyconnect-fake")
70
+ ? "autifyconnect-fake"
71
+ : "autifyconnect";
55
72
  if (file.endsWith(".tar.gz")) {
56
- const command = `tar xvzf ${file}`;
57
- (0, node_child_process_1.execSync)(command, { cwd: dir });
58
- return (0, node_path_1.join)(dir, "autifyconnect");
73
+ // TODO: Pure JS
74
+ await (0, node_util_1.promisify)(node_child_process_1.execFile)("tar", ["xvzf", file], { cwd: dir });
75
+ return (0, node_path_1.join)(dir, binaryName);
59
76
  }
60
77
  if (file.endsWith(".zip")) {
61
78
  const streamPipeline = (0, node_util_1.promisify)(node_stream_1.pipeline);
62
79
  await streamPipeline((0, node_fs_1.createReadStream)(downloadPath),
63
80
  // eslint-disable-next-line new-cap
64
81
  (0, unzip_stream_1.Extract)({ path: dir }));
65
- return (0, node_path_1.join)(dir, "autifyconnect.exe");
82
+ return (0, node_path_1.join)(dir, `${binaryName}.exe`);
66
83
  }
67
84
  throw new errors_1.CLIError(`Unsupported file format: ${downloadPath}`);
68
85
  };
69
- const validateVersion = async (path) => {
70
- try {
71
- return await (0, exports.getInstallVersion)(path);
72
- }
73
- catch (error) {
74
- throw new errors_1.CLIError(`Autify Connect Client binary doesn't work properly (path: ${path}, error: ${error})`);
86
+ class ConnectClientVersionMismatchError extends errors_1.CLIError {
87
+ constructor(expected, reality) {
88
+ super(`Autify Connect Client version mismatch: ${reality} !== ${expected} (expected)`);
89
+ this.expected = expected;
90
+ this.reality = reality;
75
91
  }
92
+ }
93
+ exports.ConnectClientVersionMismatchError = ConnectClientVersionMismatchError;
94
+ const validateVersion = async (versionString, version) => {
95
+ // No need to validate version if it's installed as "stable".
96
+ if (version === "stable")
97
+ return;
98
+ // Format example: Autify Connect version v0.6.1, build ca0972e
99
+ if (!versionString.includes(version + ","))
100
+ throw new ConnectClientVersionMismatchError(version, versionString);
76
101
  };
102
+ exports.validateVersion = validateVersion;
77
103
  const getWorkspaceDir = (cacheDir) => (0, node_path_1.join)(cacheDir, "autifyconnect-install-workspace");
78
- const getInstallPath = (cacheDir) => getOs() === "windows"
79
- ? (0, node_path_1.join)(cacheDir, "autifyconnect.exe")
80
- : (0, node_path_1.join)(cacheDir, "autifyconnect");
104
+ const getInstallPath = (configDir, cacheDir) => {
105
+ const mode = getMode(configDir);
106
+ const binaryName = mode === "fake" ? "autifyconnect-fake" : "autifyconnect";
107
+ return getOs() === "windows"
108
+ ? (0, node_path_1.join)(cacheDir, `${binaryName}.exe`)
109
+ : (0, node_path_1.join)(cacheDir, binaryName);
110
+ };
81
111
  exports.getInstallPath = getInstallPath;
82
112
  const getInstallVersion = async (path) => {
83
- if (!(0, node_fs_1.existsSync)(path))
113
+ if (!(0, node_fs_1.existsSync)(path)) {
84
114
  throw new errors_1.CLIError(`Autify Connect Client isn't installed yet at ${path}. Run \`autify connect client install\` first.`);
85
- const { stderr } = await (0, node_util_1.promisify)(node_child_process_1.exec)(`${path} --version`);
115
+ }
116
+ const { stderr } = await (0, node_util_1.promisify)(node_child_process_1.execFile)(path, ["--version"], {
117
+ env: node_process_1.env,
118
+ });
86
119
  const version = stderr.trim();
87
120
  if (version === "")
88
121
  throw new errors_1.CLIError("Version is empty");
89
122
  return version;
90
123
  };
91
124
  exports.getInstallVersion = getInstallVersion;
92
- const installClient = async (cacheDir) => {
125
+ const installClient = async (configDir, cacheDir, version) => {
126
+ const mode = getMode(configDir);
93
127
  const workspaceDir = getWorkspaceDir(cacheDir);
94
128
  // Clean up workspace in case something is left by previous command.
95
129
  if ((0, node_fs_1.existsSync)(workspaceDir))
96
130
  (0, node_fs_1.rmSync)(workspaceDir, { recursive: true, force: true });
97
131
  (0, node_fs_1.mkdirSync)(workspaceDir);
98
- const downloadPath = await download(workspaceDir);
132
+ const downloadPath = await download(workspaceDir, mode, version);
99
133
  const extractPath = await extract(downloadPath);
100
134
  // Pre-install validation
101
- await validateVersion(extractPath);
102
- const installPath = (0, exports.getInstallPath)(cacheDir);
135
+ const preInstalledVersionString = await (0, exports.getInstallVersion)(extractPath);
136
+ await (0, exports.validateVersion)(preInstalledVersionString, version);
137
+ const installPath = (0, exports.getInstallPath)(configDir, cacheDir);
103
138
  (0, node_fs_1.renameSync)(extractPath, installPath);
104
- const version = await validateVersion(installPath);
139
+ // Re-validate against the final path
140
+ const versionString = await (0, exports.getInstallVersion)(installPath);
141
+ await (0, exports.validateVersion)(versionString, version);
105
142
  // Clean up workspace. Ignore any exception as install is already done.
106
143
  try {
107
144
  (0, node_fs_1.rmSync)(workspaceDir, { recursive: true, force: true });
@@ -110,7 +147,7 @@ const installClient = async (cacheDir) => {
110
147
  console.error(`Workspace clean up failed. Ignoring because already installed. (error: ${error})`);
111
148
  }
112
149
  return {
113
- version,
150
+ version: versionString,
114
151
  path: installPath,
115
152
  };
116
153
  };
@@ -4,13 +4,15 @@ declare type EphemeralAccessPoint = Readonly<{
4
4
  webClient: WebClient;
5
5
  workspaceId: number;
6
6
  }>;
7
+ export declare const DEFAULT_CLIENT_DEBUG_SERVER_PORT = 3000;
7
8
  declare type ProcessExit = [code: number | null, signal: NodeJS.Signals | null];
8
9
  export declare type AutifyConnectClient = Readonly<{
9
10
  version: string;
11
+ versionMismatchWarning?: string;
10
12
  logFile?: string;
11
13
  accessPointName: string;
12
- kill: () => void;
13
- waitReady: () => Promise<any[]>;
14
+ kill: () => Promise<void>;
15
+ waitReady: () => Promise<void>;
14
16
  waitExit: () => Promise<[
15
17
  ...ProcessExit,
16
18
  ...[deletedAccessPointName?: string]
@@ -19,7 +21,8 @@ export declare type AutifyConnectClient = Readonly<{
19
21
  declare type SpawnClientOptions = Readonly<{
20
22
  verbose?: boolean;
21
23
  fileLogging?: boolean;
24
+ debugServerPort?: number;
22
25
  ephemeralAccessPoint?: EphemeralAccessPoint;
23
26
  }>;
24
- export declare const spawnClient: (configDir: string, cacheDir: string, { verbose, fileLogging, ephemeralAccessPoint }: SpawnClientOptions) => Promise<AutifyConnectClient>;
27
+ export declare const spawnClient: (configDir: string, cacheDir: string, errorHandler: (error: Error) => void, { verbose, fileLogging, debugServerPort, ephemeralAccessPoint, }: SpawnClientOptions) => Promise<AutifyConnectClient>;
25
28
  export {};
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spawnClient = void 0;
3
+ exports.spawnClient = exports.DEFAULT_CLIENT_DEBUG_SERVER_PORT = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  /* eslint-disable unicorn/filename-case */
5
6
  const errors_1 = require("@oclif/errors");
6
- const node_child_process_1 = require("node:child_process");
7
7
  const installClient_1 = require("./installClient");
8
8
  const node_readline_1 = require("node:readline");
9
9
  const node_events_1 = require("node:events");
@@ -11,6 +11,11 @@ const winston_1 = require("winston");
11
11
  const node_path_1 = require("node:path");
12
12
  const config_1 = require("../../config");
13
13
  const uuid_1 = require("uuid");
14
+ const node_process_1 = require("node:process");
15
+ const node_child_process_1 = require("node:child_process");
16
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
17
+ const promises_1 = require("node:timers/promises");
18
+ const is_running_1 = tslib_1.__importDefault(require("is-running"));
14
19
  const EPHEMERAL_ACCESS_POINT_NAME_PREFIX = "autify-cli-";
15
20
  const logger = (0, winston_1.createLogger)({
16
21
  level: "debug",
@@ -24,8 +29,8 @@ const getOrCreateAccessPoint = async (configDir, ephemeralAccessPoint) => {
24
29
  return { accessPointName, accessPointKey };
25
30
  }
26
31
  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;
32
+ const name = `${EPHEMERAL_ACCESS_POINT_NAME_PREFIX}${(0, uuid_1.v4)()}`;
33
+ const { name: accessPointName, key: accessPointKey } = (await webClient.createAccessPoint(workspaceId, { name })).data;
29
34
  return { accessPointName, accessPointKey };
30
35
  };
31
36
  const deleteAccessPointIfPossible = async (accessPointName, ephemeralAccessPoint) => {
@@ -72,16 +77,48 @@ const onLogMsg = (input, handler) => {
72
77
  }
73
78
  });
74
79
  };
75
- const spawnClient = async (configDir, cacheDir, { verbose, fileLogging, ephemeralAccessPoint }) => {
80
+ exports.DEFAULT_CLIENT_DEBUG_SERVER_PORT = 3000;
81
+ const requestDebugServer = async (port, path, method = "GET") => {
82
+ const response = await (0, node_fetch_1.default)(`http://localhost:${port}${path}`, { method });
83
+ if (response.ok)
84
+ return response.json();
85
+ throw new errors_1.CLIError(`Request to debug server failed: ${method} ${path} => ${response.status} ${response.statusText}`);
86
+ };
87
+ const requestDebugServerStatus = async (port) => {
88
+ const response = (await requestDebugServer(port, "/status"));
89
+ if (!response.status || !response.message)
90
+ return new errors_1.CLIError(`Invalid response from GET /status: ${JSON.stringify(response)}`);
91
+ return response;
92
+ };
93
+ const spawnClient = async (configDir, cacheDir, errorHandler, { verbose, fileLogging, debugServerPort = exports.DEFAULT_CLIENT_DEBUG_SERVER_PORT, ephemeralAccessPoint, }) => {
76
94
  const state = new node_events_1.EventEmitter();
77
- const clientPath = (0, installClient_1.getInstallPath)(cacheDir);
78
- const args = ["--log-format", "json"];
79
- if (verbose)
80
- args.push("--verbose");
95
+ state.on("error", errorHandler);
96
+ const clientPath = (0, installClient_1.getInstallPath)(configDir, cacheDir);
81
97
  const version = await (0, installClient_1.getInstallVersion)(clientPath);
98
+ let versionMismatchWarning;
99
+ try {
100
+ await (0, installClient_1.validateVersion)(version, installClient_1.AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION);
101
+ }
102
+ catch (error) {
103
+ if (error instanceof installClient_1.ConnectClientVersionMismatchError) {
104
+ versionMismatchWarning =
105
+ "Installed Autify Connect Client version doesn't match our supported version. " +
106
+ "Consider to run `autify connect client install` to install the supported version. " +
107
+ `(version: ${version}, supported: ${installClient_1.AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION})`;
108
+ }
109
+ }
82
110
  const { accessPointName, accessPointKey } = await getOrCreateAccessPoint(configDir, ephemeralAccessPoint);
111
+ const args = [
112
+ "--log-format",
113
+ "json",
114
+ "--experimental-debug-server-port",
115
+ debugServerPort.toString(),
116
+ ];
117
+ if (verbose)
118
+ args.push("--verbose");
83
119
  const childProcess = (0, node_child_process_1.spawn)(clientPath, args, {
84
120
  env: {
121
+ ...node_process_1.env,
85
122
  AUTIFY_CONNECT_KEY: accessPointKey,
86
123
  },
87
124
  });
@@ -99,14 +136,54 @@ const spawnClient = async (configDir, cacheDir, { verbose, fileLogging, ephemera
99
136
  state.emit("ready");
100
137
  }
101
138
  });
139
+ const statusTimer = setInterval(async () => {
140
+ try {
141
+ const response = await requestDebugServerStatus(debugServerPort);
142
+ if (response instanceof errors_1.CLIError)
143
+ state.emit("error", response);
144
+ else
145
+ state.emit(response.status, response.message);
146
+ }
147
+ catch (error) {
148
+ state.emit("error", error);
149
+ }
150
+ }, 1000);
151
+ const kill = async () => {
152
+ try {
153
+ await requestDebugServer(debugServerPort, "/terminate", "POST");
154
+ for await (const start of (0, promises_1.setInterval)(1000, Date.now())) {
155
+ if (childProcess.pid && !(0, is_running_1.default)(childProcess.pid))
156
+ break;
157
+ if (Date.now() - start > 5000)
158
+ break;
159
+ }
160
+ }
161
+ catch {
162
+ // Ignore any exceptions to fallback to signal.
163
+ }
164
+ finally {
165
+ // Guardrail.
166
+ childProcess.kill("SIGINT");
167
+ }
168
+ };
102
169
  return {
103
170
  version,
171
+ versionMismatchWarning,
104
172
  logFile,
105
173
  accessPointName,
106
- kill: () => childProcess.kill(),
107
- waitReady: async () => clientReady,
174
+ kill,
175
+ waitReady: async () => {
176
+ try {
177
+ await clientReady;
178
+ }
179
+ catch (error) {
180
+ await kill();
181
+ throw error;
182
+ }
183
+ },
108
184
  waitExit: async () => {
109
185
  const [code, signal] = await childProcessExit;
186
+ clearInterval(statusTimer);
110
187
  const deletedAccessPointName = await deleteAccessPointIfPossible(accessPointName, ephemeralAccessPoint);
111
188
  return [code, signal, deletedAccessPointName];
112
189
  },
@@ -0,0 +1,11 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class ConnectAccessPointCreate extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
+ "web-workspace-id": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
8
+ };
9
+ static args: never[];
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const autify_sdk_1 = require("@autifyhq/autify-sdk");
4
+ const core_1 = require("@oclif/core");
5
+ const accessPointConfig_1 = require("../../../autify/connect/accessPointConfig");
6
+ const config_1 = require("../../../config");
7
+ class ConnectAccessPointCreate extends core_1.Command {
8
+ async run() {
9
+ const { flags } = await this.parse(ConnectAccessPointCreate);
10
+ const { configDir, userAgent } = this.config;
11
+ await (0, accessPointConfig_1.confirmOverwriteAccessPoint)(configDir);
12
+ const { name, "web-workspace-id": webWorkspaceId } = flags;
13
+ if (webWorkspaceId) {
14
+ const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
15
+ const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
16
+ const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
17
+ const response = await client.createAccessPoint(webWorkspaceId, {
18
+ name,
19
+ });
20
+ const key = response.data.key;
21
+ this.log(`Successfully created Access Point: (name: ${name}, web-workspace-id: ${webWorkspaceId})`);
22
+ this.log((0, accessPointConfig_1.saveAccessPoint)(configDir, name, key));
23
+ }
24
+ }
25
+ }
26
+ exports.default = ConnectAccessPointCreate;
27
+ ConnectAccessPointCreate.description = "[Experimental] Create an Autify Connect Access Point";
28
+ ConnectAccessPointCreate.examples = [
29
+ "<%= config.bin %> <%= command.id %> --name NAME --web-workspace-id ID",
30
+ ];
31
+ ConnectAccessPointCreate.flags = {
32
+ name: core_1.Flags.string({
33
+ description: "Name of Autify Connect Access Point to be created",
34
+ required: true,
35
+ }),
36
+ "web-workspace-id": core_1.Flags.integer({
37
+ description: "Workspace ID of Autify for Web to which the Access Point belong",
38
+ exactlyOne: ["web-workspace-id"],
39
+ }),
40
+ };
41
+ ConnectAccessPointCreate.args = [];
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@oclif/core");
5
5
  const inquirer = tslib_1.__importStar(require("inquirer"));
6
- const config_1 = require("../../../config");
6
+ const accessPointConfig_1 = require("../../../autify/connect/accessPointConfig");
7
7
  class ConnectAccessPointSet extends core_1.Command {
8
8
  async run() {
9
9
  const { flags } = await this.parse(ConnectAccessPointSet);
10
+ const { name } = flags;
11
+ const { configDir } = this.config;
12
+ await (0, accessPointConfig_1.confirmOverwriteAccessPoint)(configDir);
10
13
  const key = await this.readKeyFromStdin();
11
- (0, config_1.set)(this.config.configDir, "AUTIFY_CONNECT_ACCESS_POINT_NAME", flags.name);
12
- (0, config_1.set)(this.config.configDir, "AUTIFY_CONNECT_ACCESS_POINT_KEY", key);
14
+ this.log((0, accessPointConfig_1.saveAccessPoint)(configDir, name, key));
13
15
  }
14
16
  async readKeyFromStdin() {
15
17
  const res = await inquirer.prompt([
@@ -3,6 +3,10 @@ export default class ConnectClientInstall extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {};
6
- static args: never[];
6
+ static args: {
7
+ name: string;
8
+ description: string;
9
+ default: string;
10
+ }[];
7
11
  run(): Promise<void>;
8
12
  }
@@ -4,14 +4,26 @@ const core_1 = require("@oclif/core");
4
4
  const installClient_1 = require("../../../autify/connect/installClient");
5
5
  class ConnectClientInstall extends core_1.Command {
6
6
  async run() {
7
- await this.parse(ConnectClientInstall);
8
- const { cacheDir } = this.config;
9
- const { version, path } = await (0, installClient_1.installClient)(cacheDir);
7
+ const { args } = await this.parse(ConnectClientInstall);
8
+ const { configDir, cacheDir } = this.config;
9
+ core_1.CliUx.ux.action.start(`Installing Autify Connect Client (version: ${args.version})`, "installing", { stdout: true });
10
+ const { version, path } = await (0, installClient_1.installClient)(configDir, cacheDir, args.version);
11
+ core_1.CliUx.ux.action.stop();
10
12
  this.log(`Successfully installed Autify Connect Client (path: ${path}, version: ${version})`);
11
13
  }
12
14
  }
13
15
  exports.default = ConnectClientInstall;
14
- ConnectClientInstall.description = "[Experimental] Install the latest stable version of Autify Connect Client";
15
- ConnectClientInstall.examples = ["<%= config.bin %> <%= command.id %>"];
16
+ ConnectClientInstall.description = "[Experimental] Install Autify Connect Client";
17
+ ConnectClientInstall.examples = [
18
+ "(Recommended) Install the supported version:\n<%= config.bin %> <%= command.id %>",
19
+ "Install a specific version:\n<%= config.bin %> <%= command.id %> v0.6.1",
20
+ "Install a stable version:\n<%= config.bin %> <%= command.id %> stable",
21
+ ];
16
22
  ConnectClientInstall.flags = {};
17
- ConnectClientInstall.args = [];
23
+ ConnectClientInstall.args = [
24
+ {
25
+ name: "version",
26
+ description: "Specify the target version of Autify Connect Client.",
27
+ default: installClient_1.AUTIFY_CONNECT_CLIENT_SUPPORTED_VERSION,
28
+ },
29
+ ];
@@ -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
+ "debug-server-port": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
8
9
  "web-workspace-id": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
9
10
  };
10
11
  run(): Promise<void>;
@@ -19,24 +19,38 @@ class ConnectClientStart extends core_1.Command {
19
19
  async run() {
20
20
  const { flags } = await this.parse(ConnectClientStart);
21
21
  const { configDir, cacheDir, userAgent } = this.config;
22
- const { verbose, "file-logging": fileLogging, "web-workspace-id": webWorkspaceId, } = flags;
22
+ const { verbose, "file-logging": fileLogging, "web-workspace-id": webWorkspaceId, "debug-server-port": debugServerPort, } = flags;
23
+ const errorHandler = (error) => {
24
+ if (verbose)
25
+ this.warn(error);
26
+ };
23
27
  const ephemeralAccessPoint = createEphemeralAccessPointIfNeeded(configDir, userAgent, webWorkspaceId);
24
- const { version, logFile, accessPointName, waitReady, waitExit } = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
28
+ const { version, versionMismatchWarning, logFile, accessPointName, waitReady, waitExit, } = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, errorHandler, {
25
29
  verbose,
26
30
  fileLogging,
31
+ debugServerPort,
27
32
  ephemeralAccessPoint,
28
33
  });
29
34
  this.log(`Starting Autify Connect Client for Access Point "${accessPointName}" (${version})...`);
35
+ if (versionMismatchWarning)
36
+ this.warn(versionMismatchWarning);
30
37
  if (logFile)
31
38
  this.log(`Log file is located at ${logFile}`);
32
39
  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);
40
+ try {
41
+ await waitReady();
42
+ this.log("Autify Connect Client is ready!");
43
+ }
44
+ catch (error) {
45
+ this.warn(error);
46
+ }
47
+ finally {
48
+ const [code, signal, deletedAccessPointName] = await waitExit();
49
+ if (deletedAccessPointName)
50
+ this.log(`Autify Connect Access Point was deleted: "${deletedAccessPointName}"`);
51
+ this.log(`Autify Connect Client exited (code: ${code}, signal: ${signal})`);
52
+ this.exit(code !== null && code !== void 0 ? code : 1);
53
+ }
40
54
  }
41
55
  }
42
56
  exports.default = ConnectClientStart;
@@ -51,6 +65,9 @@ ConnectClientStart.flags = {
51
65
  description: "Logging Autify Connect Client log to a file instead of console.",
52
66
  default: false,
53
67
  }),
68
+ "debug-server-port": core_1.Flags.integer({
69
+ description: `[default: ${spawnClient_1.DEFAULT_CLIENT_DEBUG_SERVER_PORT}] The server for debugging and monitoring launches on your local machine on the given port.`,
70
+ }),
54
71
  "web-workspace-id": core_1.Flags.integer({
55
72
  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
73
  }),
@@ -9,6 +9,7 @@ export default class WebTestRun extends Command {
9
9
  "autify-connect-client": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  "autify-connect-client-verbose": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  "autify-connect-client-file-logging": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ "autify-connect-client-debug-server-port": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
12
13
  os: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
14
  "os-version": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
15
  browser: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -52,24 +52,6 @@ class WebTestRun extends core_1.Command {
52
52
  const { workspaceId } = parsedTest;
53
53
  let autifyConnectAccessPoint = flags["autify-connect"];
54
54
  let autifyConnectClient;
55
- if (flags["autify-connect-client"]) {
56
- autifyConnectClient = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
57
- verbose: flags["autify-connect-client-verbose"],
58
- fileLogging: flags["autify-connect-client-file-logging"],
59
- ephemeralAccessPoint: {
60
- webClient: client,
61
- workspaceId,
62
- },
63
- });
64
- const { version, logFile, accessPointName, waitReady } = autifyConnectClient;
65
- autifyConnectAccessPoint = accessPointName;
66
- this.log(`Starting Autify Connect Client for Access Point "${accessPointName}" (${version})...`);
67
- if (logFile)
68
- this.log(`Autify Connect Client log file is located at ${logFile}`);
69
- this.log("Waiting until Autify Connect Client is ready...");
70
- await waitReady();
71
- this.log("Autify Connect Client is ready!");
72
- }
73
55
  const runTestOnce = async () => {
74
56
  const { resultId, capability } = await (0, runTest_1.runTest)(client, parsedTest, {
75
57
  option: capabilityOption,
@@ -82,6 +64,31 @@ class WebTestRun extends core_1.Command {
82
64
  return testResultUrl;
83
65
  };
84
66
  try {
67
+ if (flags["autify-connect-client"]) {
68
+ const errorHandler = (error) => {
69
+ if (flags.verbose)
70
+ this.warn(error);
71
+ };
72
+ autifyConnectClient = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, errorHandler, {
73
+ verbose: flags["autify-connect-client-verbose"],
74
+ fileLogging: flags["autify-connect-client-file-logging"],
75
+ debugServerPort: flags["autify-connect-client-debug-server-port"],
76
+ ephemeralAccessPoint: {
77
+ webClient: client,
78
+ workspaceId,
79
+ },
80
+ });
81
+ const { version, versionMismatchWarning, logFile, accessPointName, waitReady, } = autifyConnectClient;
82
+ autifyConnectAccessPoint = accessPointName;
83
+ this.log(`Starting Autify Connect Client for Access Point "${accessPointName}" (${version})...`);
84
+ if (versionMismatchWarning)
85
+ this.warn(versionMismatchWarning);
86
+ if (logFile)
87
+ this.log(`Autify Connect Client log file is located at ${logFile}`);
88
+ this.log("Waiting until Autify Connect Client is ready...");
89
+ await waitReady();
90
+ this.log("Autify Connect Client is ready!");
91
+ }
85
92
  let testResultUrl = await runTestOnce();
86
93
  if (flags.wait) {
87
94
  const webTestWait = async (url) => {
@@ -122,11 +129,11 @@ class WebTestRun extends core_1.Command {
122
129
  catch (error) {
123
130
  if (autifyConnectClient) {
124
131
  this.log("Waiting until Autify Connect Client exits...");
125
- autifyConnectClient.kill();
132
+ await autifyConnectClient.kill();
126
133
  const [code, signal, deletedAccessPointName] = await autifyConnectClient.waitExit();
127
134
  if (deletedAccessPointName)
128
135
  this.log(`Autify Connect Access Point was deleted: "${deletedAccessPointName}"`);
129
- this.log(`Autify Connect Client exited (code: ${code}, signal: ${signal}).`);
136
+ this.log(`Autify Connect Client exited (code: ${code}, signal: ${signal})`);
130
137
  }
131
138
  throw error;
132
139
  }
@@ -170,6 +177,10 @@ WebTestRun.flags = {
170
177
  description: "[Experimental] Logging Autify Connect Client log to a file instead of console.",
171
178
  dependsOn: ["autify-connect-client"],
172
179
  }),
180
+ "autify-connect-client-debug-server-port": core_1.Flags.integer({
181
+ description: `[Experimental] [default: ${spawnClient_1.DEFAULT_CLIENT_DEBUG_SERVER_PORT}] Port for Autify Connect Client debug server.`,
182
+ dependsOn: ["autify-connect-client"],
183
+ }),
173
184
  os: core_1.Flags.string({ description: "OS to run the test" }),
174
185
  "os-version": core_1.Flags.string({ description: "OS version to run the test" }),
175
186
  browser: core_1.Flags.string({ description: "Browser to run the test" }),
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare type Variable = "AUTIFY_WEB_ACCESS_TOKEN" | "AUTIFY_WEB_BASE_PATH" | "AUTIFY_MOBILE_ACCESS_TOKEN" | "AUTIFY_MOBILE_BASE_PATH" | "AUTIFY_CONNECT_ACCESS_POINT_NAME" | "AUTIFY_CONNECT_ACCESS_POINT_KEY" | "AUTIFY_TEST_WAIT_INTERVAL_SECOND";
1
+ declare type Variable = "AUTIFY_WEB_ACCESS_TOKEN" | "AUTIFY_WEB_BASE_PATH" | "AUTIFY_MOBILE_ACCESS_TOKEN" | "AUTIFY_MOBILE_BASE_PATH" | "AUTIFY_CONNECT_ACCESS_POINT_NAME" | "AUTIFY_CONNECT_ACCESS_POINT_KEY" | "AUTIFY_CONNECT_CLIENT_MODE" | "AUTIFY_TEST_WAIT_INTERVAL_SECOND";
2
2
  export declare const set: (configDir: string, key: Variable, value: string | undefined) => void;
3
3
  export declare const get: (configDir: string, key: Variable) => string | undefined;
4
4
  export declare const getOrThrow: (configDir: string, key: Variable) => string;
@@ -1 +1 @@
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}]}}}
1
+ {"version":"0.10.0","commands":{"connect:access-point:create":{"id":"connect:access-point:create","description":"[Experimental] Create an Autify Connect Access Point","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> --name NAME --web-workspace-id ID"],"flags":{"name":{"name":"name","type":"option","description":"Name of Autify Connect Access Point to be created","required":true,"multiple":false},"web-workspace-id":{"name":"web-workspace-id","type":"option","description":"Workspace ID of Autify for Web to which the Access Point belong","multiple":false}},"args":[]},"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 Autify Connect Client","strict":true,"pluginName":"@autifyhq/autify-cli","pluginAlias":"@autifyhq/autify-cli","pluginType":"core","aliases":[],"examples":["(Recommended) Install the supported version:\n<%= config.bin %> <%= command.id %>","Install a specific version:\n<%= config.bin %> <%= command.id %> v0.6.1","Install a stable version:\n<%= config.bin %> <%= command.id %> stable"],"flags":{},"args":[{"name":"version","description":"Specify the target version of Autify Connect Client.","default":"v0.6.2"}]},"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},"debug-server-port":{"name":"debug-server-port","type":"option","description":"[default: 3000] The server for debugging and monitoring launches on your local machine on the given port.","multiple":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"]},"autify-connect-client-debug-server-port":{"name":"autify-connect-client-debug-server-port","type":"option","description":"[Experimental] [default: 3000] Port for Autify Connect Client debug server.","multiple":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.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Autify Command Line Interface (CLI)",
5
5
  "author": "Autify",
6
6
  "bin": {
@@ -25,8 +25,9 @@
25
25
  "@oclif/plugin-update": "^3.0.0",
26
26
  "@oclif/plugin-warn-if-update-available": "^2.0.4",
27
27
  "archiver": "^5.3.1",
28
- "envfile": "^6.17.0",
28
+ "envfile": "^6.18.0",
29
29
  "inquirer": "^8.2.4",
30
+ "is-running": "^2.1.0",
30
31
  "listr": "^0.14.3",
31
32
  "node-emoji": "^1.11.0",
32
33
  "node-fetch": "^2.6.7",
@@ -37,7 +38,7 @@
37
38
  "unzip-stream": "^0.3.1",
38
39
  "uuid": "^8.3.2",
39
40
  "which": "^2.0.2",
40
- "winston": "^3.8.1"
41
+ "winston": "^3.8.2"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@autifyhq/autify-cli-integration-test": "*",
@@ -45,6 +46,7 @@
45
46
  "@types/archiver": "^5.3.1",
46
47
  "@types/chai": "^4",
47
48
  "@types/inquirer": "^8.2.1",
49
+ "@types/is-running": "^2.1.0",
48
50
  "@types/listr": "^0.14.4",
49
51
  "@types/mocha": "^9.1.1",
50
52
  "@types/node": "^16.11.58",
@@ -53,6 +55,7 @@
53
55
  "@types/unzip-stream": "^0.3.1",
54
56
  "@types/uuid": "^8.3.4",
55
57
  "chai": "^4",
58
+ "cross-env": "^7.0.3",
56
59
  "eslint": "^7.32.0",
57
60
  "eslint-config-oclif": "^4",
58
61
  "eslint-config-oclif-typescript": "^1.0.2",
@@ -146,7 +149,9 @@
146
149
  "release": "ts-node ./scripts/release.ts",
147
150
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
148
151
  "test:integration": "npm run build -w integration-test && autify-cli-integration-test",
149
- "test:integration:record": "npm run build -w integration-test && autify-cli-integration-test --record",
152
+ "test:integration:dev": "npm run build -w integration-test && cross-env AUTIFY_CLI_PATH=../bin/dev autify-cli-integration-test",
153
+ "test:integration:record": "npm run build -w integration-test && cross-env AUTIFY_CLI_INTEGRATION_TEST_RECORD=1 autify-cli-integration-test",
154
+ "test:integration:record:dev": "npm run build -w integration-test && cross-env AUTIFY_CLI_PATH=../bin/dev AUTIFY_CLI_INTEGRATION_TEST_RECORD=1 autify-cli-integration-test",
150
155
  "version": "oclif readme && git add README.md",
151
156
  "prepare": "per-env || true",
152
157
  "prepare:development": "husky install",