@autifyhq/autify-cli 0.7.2 → 0.8.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 +69 -44
- package/dist/autify/connect/installClient.d.ts +6 -0
- package/dist/autify/connect/installClient.js +117 -0
- package/dist/autify/connect/spawnClient.d.ts +21 -0
- package/dist/autify/connect/spawnClient.js +106 -0
- package/dist/autify/mobile/createZip.js +26 -19
- package/dist/autify/web/runTest.d.ts +2 -2
- package/dist/autify/web/runTest.js +5 -5
- package/dist/commands/connect/access-point/set.d.ts +10 -0
- package/dist/commands/connect/access-point/set.js +37 -0
- package/dist/commands/connect/client/install.d.ts +8 -0
- package/dist/commands/connect/client/install.js +17 -0
- package/dist/commands/connect/client/start.d.ts +10 -0
- package/dist/commands/connect/client/start.js +46 -0
- package/dist/commands/web/test/run.d.ts +1 -0
- package/dist/commands/web/test/run.js +63 -18
- package/dist/config.d.ts +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +25 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Autify Command Line Interface (CLI)
|
|
2
2
|
|
|
3
|
+
 [](https://oclif.io)
|
|
4
|
+
|
|
3
5
|
Autify CLI can help your integration with Autify!
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+

|
|
6
8
|
|
|
7
9
|
<!-- toc -->
|
|
8
10
|
* [Autify Command Line Interface (CLI)](#autify-command-line-interface-cli)
|
|
@@ -12,50 +14,14 @@ Autify CLI can help your integration with Autify!
|
|
|
12
14
|
|
|
13
15
|
# Usage
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<!-- usage -->
|
|
18
|
-
```sh-session
|
|
19
|
-
$ npm install -g @autifyhq/autify-cli
|
|
20
|
-
$ autify COMMAND
|
|
21
|
-
running command...
|
|
22
|
-
$ autify (--version)
|
|
23
|
-
@autifyhq/autify-cli/0.7.2 linux-x64 node-v16.17.0
|
|
24
|
-
$ autify --help [COMMAND]
|
|
25
|
-
USAGE
|
|
26
|
-
$ autify COMMAND
|
|
27
|
-
...
|
|
28
|
-
```
|
|
29
|
-
<!-- usagestop -->
|
|
30
|
-
|
|
31
|
-
## Download Prebuilt package
|
|
32
|
-
|
|
33
|
-
We provide prebuilt packages in the forms below (Node.js runtime is included):
|
|
34
|
-
|
|
35
|
-
| OS | Architecture | Package type | Download Link | Note |
|
|
36
|
-
| :------ | :----------- | :----------- | :--------------------------------------------------------------------------------------------------------------------- | :----------------------- |
|
|
37
|
-
| Linux | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.gz) |
|
|
38
|
-
| Linux | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.xz) |
|
|
39
|
-
| Linux | Arm 32bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.gz) |
|
|
40
|
-
| Linux | Arm 32bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.xz) |
|
|
41
|
-
| macOS | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.gz) |
|
|
42
|
-
| macOS | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.xz) |
|
|
43
|
-
| macOS | Intel 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.pkg) | Not properly signed yet. |
|
|
44
|
-
| macOS | Arm 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.gz) |
|
|
45
|
-
| macOS | Arm 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.xz) |
|
|
46
|
-
| macOS | Arm 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-arm64.pkg) | Not properly signed yet. |
|
|
47
|
-
| Windows | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.gz) |
|
|
48
|
-
| Windows | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.xz) |
|
|
49
|
-
| Windows | Intel 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.exe) | Not properly signed yet. |
|
|
50
|
-
| Windows | Intel 32bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.gz) |
|
|
51
|
-
| Windows | Intel 32bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.xz) |
|
|
52
|
-
| Windows | Intel 32bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x86.exe) | Not properly signed yet. |
|
|
53
|
-
|
|
54
|
-
After the installation, you can always get the latest update on `stable` channel automatically, or by running `autify update`.
|
|
17
|
+
See our official document: https://help.autify.com/docs/autify-command-line-interface
|
|
55
18
|
|
|
56
19
|
# Commands
|
|
57
20
|
|
|
58
21
|
<!-- commands -->
|
|
22
|
+
* [`autify connect access-point set`](#autify-connect-access-point-set)
|
|
23
|
+
* [`autify connect client install`](#autify-connect-client-install)
|
|
24
|
+
* [`autify connect client start`](#autify-connect-client-start)
|
|
59
25
|
* [`autify help [COMMAND]`](#autify-help-command)
|
|
60
26
|
* [`autify mobile api describe-test-result`](#autify-mobile-api-describe-test-result)
|
|
61
27
|
* [`autify mobile api list-test-results`](#autify-mobile-api-list-test-results)
|
|
@@ -81,6 +47,64 @@ After the installation, you can always get the latest update on `stable` channel
|
|
|
81
47
|
* [`autify web test run SCENARIO-OR-TEST-PLAN-URL`](#autify-web-test-run-scenario-or-test-plan-url)
|
|
82
48
|
* [`autify web test wait TEST-RESULT-URL`](#autify-web-test-wait-test-result-url)
|
|
83
49
|
|
|
50
|
+
## `autify connect access-point set`
|
|
51
|
+
|
|
52
|
+
[Experimental] Set Autify Connect Access Point
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
USAGE
|
|
56
|
+
$ autify connect access-point set --name <value>
|
|
57
|
+
|
|
58
|
+
FLAGS
|
|
59
|
+
--name=<value> (required) Name of the Autify Connect Access Point already created
|
|
60
|
+
|
|
61
|
+
DESCRIPTION
|
|
62
|
+
[Experimental] Set Autify Connect Access Point
|
|
63
|
+
|
|
64
|
+
EXAMPLES
|
|
65
|
+
Start interactive setup:
|
|
66
|
+
|
|
67
|
+
$ autify connect access-point set --name=NAME
|
|
68
|
+
|
|
69
|
+
Reading the key from file:
|
|
70
|
+
|
|
71
|
+
$ autify connect access-point set --name=NAME < key.txt
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## `autify connect client install`
|
|
75
|
+
|
|
76
|
+
[Experimental] Install the latest stable version of Autify Connect Client
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
USAGE
|
|
80
|
+
$ autify connect client install
|
|
81
|
+
|
|
82
|
+
DESCRIPTION
|
|
83
|
+
[Experimental] Install the latest stable version of Autify Connect Client
|
|
84
|
+
|
|
85
|
+
EXAMPLES
|
|
86
|
+
$ autify connect client install
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## `autify connect client start`
|
|
90
|
+
|
|
91
|
+
[Experimental] Start Autify Connect Client
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
USAGE
|
|
95
|
+
$ autify connect client start [--verbose] [--file-logging]
|
|
96
|
+
|
|
97
|
+
FLAGS
|
|
98
|
+
--file-logging Logging Autify Connect Client log to a file instead of console.
|
|
99
|
+
--verbose Make the operation more talkative.
|
|
100
|
+
|
|
101
|
+
DESCRIPTION
|
|
102
|
+
[Experimental] Start Autify Connect Client
|
|
103
|
+
|
|
104
|
+
EXAMPLES
|
|
105
|
+
$ autify connect client start
|
|
106
|
+
```
|
|
107
|
+
|
|
84
108
|
## `autify help [COMMAND]`
|
|
85
109
|
|
|
86
110
|
Display help for autify.
|
|
@@ -575,9 +599,9 @@ Run a scenario or test plan.
|
|
|
575
599
|
|
|
576
600
|
```
|
|
577
601
|
USAGE
|
|
578
|
-
$ autify web test run [SCENARIO-OR-TEST-PLAN-URL] [-n <value>] [-r <value>] [--autify-connect <value>
|
|
579
|
-
<value>] [--os-version <value>] [--browser <value>] [--device <value>] [--device-type
|
|
580
|
-
[-v]
|
|
602
|
+
$ 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]
|
|
581
605
|
|
|
582
606
|
ARGUMENTS
|
|
583
607
|
SCENARIO-OR-TEST-PLAN-URL Scenario URL or Test plan URL e.g.
|
|
@@ -590,6 +614,7 @@ FLAGS
|
|
|
590
614
|
-v, --verbose Verbose output
|
|
591
615
|
-w, --wait Wait until the test finishes.
|
|
592
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.)
|
|
593
618
|
--browser=<value> Browser to run the test
|
|
594
619
|
--device=<value> Device to run the test
|
|
595
620
|
--device-type=<value> Device type to run the test
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installClient = exports.getInstallVersion = exports.getInstallPath = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable unicorn/filename-case */
|
|
6
|
+
const errors_1 = require("@oclif/errors");
|
|
7
|
+
const node_process_1 = require("node:process");
|
|
8
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const node_stream_1 = require("node:stream");
|
|
11
|
+
const node_util_1 = require("node:util");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
|
14
|
+
const unzip_stream_1 = require("unzip-stream");
|
|
15
|
+
const getOs = () => {
|
|
16
|
+
const os = node_process_1.platform;
|
|
17
|
+
if (os === "linux")
|
|
18
|
+
return "linux";
|
|
19
|
+
if (os === "darwin")
|
|
20
|
+
return "darwin";
|
|
21
|
+
if (os === "win32")
|
|
22
|
+
return "windows";
|
|
23
|
+
throw new errors_1.CLIError(`Unsupported OS: ${os}`);
|
|
24
|
+
};
|
|
25
|
+
const getArch = () => {
|
|
26
|
+
if (node_process_1.arch === "ia32")
|
|
27
|
+
return "386";
|
|
28
|
+
if (node_process_1.arch === "x64")
|
|
29
|
+
return "amd64";
|
|
30
|
+
if (node_process_1.arch === "arm64")
|
|
31
|
+
return "arm64";
|
|
32
|
+
throw new errors_1.CLIError(`Unsupported Architecture: ${node_process_1.arch}`);
|
|
33
|
+
};
|
|
34
|
+
const getExt = () => (getOs() === "windows" ? "zip" : "tar.gz");
|
|
35
|
+
const baseUrl = "https://autifyconnect.s3.ap-northeast-1.amazonaws.com/autifyconnect/versions/stable";
|
|
36
|
+
const getUrl = () => {
|
|
37
|
+
const os = getOs();
|
|
38
|
+
const arch = getArch();
|
|
39
|
+
const ext = getExt();
|
|
40
|
+
return new URL(`${baseUrl}/autifyconnect_${os}_${arch}.${ext}`);
|
|
41
|
+
};
|
|
42
|
+
const download = async (workspaceDir) => {
|
|
43
|
+
const url = getUrl();
|
|
44
|
+
const downloadPath = (0, node_path_1.join)(workspaceDir, (0, node_path_1.basename)(url.pathname));
|
|
45
|
+
const response = await (0, node_fetch_1.default)(url);
|
|
46
|
+
if (!response.ok)
|
|
47
|
+
throw new errors_1.CLIError(`Failed to fetch ${url}: ${response.status}`);
|
|
48
|
+
const streamPipeline = (0, node_util_1.promisify)(node_stream_1.pipeline);
|
|
49
|
+
await streamPipeline(response.body, (0, node_fs_1.createWriteStream)(downloadPath));
|
|
50
|
+
return downloadPath;
|
|
51
|
+
};
|
|
52
|
+
const extract = async (downloadPath) => {
|
|
53
|
+
const file = (0, node_path_1.basename)(downloadPath);
|
|
54
|
+
const dir = (0, node_path_1.dirname)(downloadPath);
|
|
55
|
+
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");
|
|
59
|
+
}
|
|
60
|
+
if (file.endsWith(".zip")) {
|
|
61
|
+
const streamPipeline = (0, node_util_1.promisify)(node_stream_1.pipeline);
|
|
62
|
+
await streamPipeline((0, node_fs_1.createReadStream)(downloadPath),
|
|
63
|
+
// eslint-disable-next-line new-cap
|
|
64
|
+
(0, unzip_stream_1.Extract)({ path: dir }));
|
|
65
|
+
return (0, node_path_1.join)(dir, "autifyconnect.exe");
|
|
66
|
+
}
|
|
67
|
+
throw new errors_1.CLIError(`Unsupported file format: ${downloadPath}`);
|
|
68
|
+
};
|
|
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})`);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
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");
|
|
81
|
+
exports.getInstallPath = getInstallPath;
|
|
82
|
+
const getInstallVersion = async (path) => {
|
|
83
|
+
if (!(0, node_fs_1.existsSync)(path))
|
|
84
|
+
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`);
|
|
86
|
+
const version = stderr.trim();
|
|
87
|
+
if (version === "")
|
|
88
|
+
throw new errors_1.CLIError("Version is empty");
|
|
89
|
+
return version;
|
|
90
|
+
};
|
|
91
|
+
exports.getInstallVersion = getInstallVersion;
|
|
92
|
+
const installClient = async (cacheDir) => {
|
|
93
|
+
const workspaceDir = getWorkspaceDir(cacheDir);
|
|
94
|
+
// Clean up workspace in case something is left by previous command.
|
|
95
|
+
if ((0, node_fs_1.existsSync)(workspaceDir))
|
|
96
|
+
(0, node_fs_1.rmSync)(workspaceDir, { recursive: true, force: true });
|
|
97
|
+
(0, node_fs_1.mkdirSync)(workspaceDir);
|
|
98
|
+
const downloadPath = await download(workspaceDir);
|
|
99
|
+
const extractPath = await extract(downloadPath);
|
|
100
|
+
// Pre-install validation
|
|
101
|
+
await validateVersion(extractPath);
|
|
102
|
+
const installPath = (0, exports.getInstallPath)(cacheDir);
|
|
103
|
+
(0, node_fs_1.renameSync)(extractPath, installPath);
|
|
104
|
+
const version = await validateVersion(installPath);
|
|
105
|
+
// Clean up workspace. Ignore any exception as install is already done.
|
|
106
|
+
try {
|
|
107
|
+
(0, node_fs_1.rmSync)(workspaceDir, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error(`Workspace clean up failed. Ignoring because already installed. (error: ${error})`);
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
version,
|
|
114
|
+
path: installPath,
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
exports.installClient = installClient;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
8
|
+
export declare type AutifyConnectClient = Readonly<{
|
|
9
|
+
version: string;
|
|
10
|
+
logFile?: string;
|
|
11
|
+
accessPoint: string;
|
|
12
|
+
kill: () => void;
|
|
13
|
+
waitReady: () => Promise<any[]>;
|
|
14
|
+
waitExit: () => Promise<any[]>;
|
|
15
|
+
}>;
|
|
16
|
+
declare type SpawnClientOptions = Readonly<{
|
|
17
|
+
verbose?: boolean;
|
|
18
|
+
fileLogging?: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const spawnClient: (configDir: string, cacheDir: string, { verbose, fileLogging }: SpawnClientOptions) => Promise<AutifyConnectClient>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spawnClient = exports.ClientExitError = void 0;
|
|
4
|
+
/* eslint-disable unicorn/filename-case */
|
|
5
|
+
const errors_1 = require("@oclif/errors");
|
|
6
|
+
const node_child_process_1 = require("node:child_process");
|
|
7
|
+
const config_1 = require("../../config");
|
|
8
|
+
const installClient_1 = require("./installClient");
|
|
9
|
+
const node_readline_1 = require("node:readline");
|
|
10
|
+
const node_events_1 = require("node:events");
|
|
11
|
+
const winston_1 = require("winston");
|
|
12
|
+
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
|
+
};
|
|
25
|
+
const logger = (0, winston_1.createLogger)({
|
|
26
|
+
level: "debug",
|
|
27
|
+
});
|
|
28
|
+
const setupLogger = (logFile) => {
|
|
29
|
+
if (logFile) {
|
|
30
|
+
logger.add(new winston_1.transports.File({
|
|
31
|
+
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}`)),
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
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}`)),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const onLogMsg = (input, handler) => {
|
|
42
|
+
return (0, node_readline_1.createInterface)({
|
|
43
|
+
input,
|
|
44
|
+
crlfDelay: Number.POSITIVE_INFINITY,
|
|
45
|
+
}).on("line", (line) => {
|
|
46
|
+
let msg = line;
|
|
47
|
+
try {
|
|
48
|
+
const log = JSON.parse(line);
|
|
49
|
+
msg = log.msg;
|
|
50
|
+
logger.log(log.level, log.msg);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
handler(msg);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
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 }) => {
|
|
69
|
+
const state = new node_events_1.EventEmitter();
|
|
70
|
+
const clientPath = (0, installClient_1.getInstallPath)(cacheDir);
|
|
71
|
+
const args = ["--log-format", "json"];
|
|
72
|
+
if (verbose)
|
|
73
|
+
args.push("--verbose");
|
|
74
|
+
const version = await (0, installClient_1.getInstallVersion)(clientPath);
|
|
75
|
+
const { accessPoint, key } = getOrCreateAccessPoint(configDir);
|
|
76
|
+
const childProcess = (0, node_child_process_1.spawn)(clientPath, args, {
|
|
77
|
+
env: {
|
|
78
|
+
AUTIFY_CONNECT_KEY: key,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
const logFile = fileLogging
|
|
82
|
+
? (0, node_path_1.join)(cacheDir, `autifyconnect-${Date.now()}-${childProcess.pid}.log`)
|
|
83
|
+
: undefined;
|
|
84
|
+
setupLogger(logFile);
|
|
85
|
+
process.on("SIGINT", childProcess.kill);
|
|
86
|
+
process.on("SIGTERM", childProcess.kill);
|
|
87
|
+
childProcess.on("exit", (code, signal) => {
|
|
88
|
+
state.emit("error", new ClientExitError(code, signal, logFile));
|
|
89
|
+
});
|
|
90
|
+
childProcess.stderr.pipe(process.stderr);
|
|
91
|
+
onLogMsg(childProcess.stdout, (msg) => {
|
|
92
|
+
if (msg.includes("Successfully connected")) {
|
|
93
|
+
state.emit("ready");
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return {
|
|
97
|
+
version,
|
|
98
|
+
logFile,
|
|
99
|
+
accessPoint,
|
|
100
|
+
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, "_"),
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
exports.spawnClient = spawnClient;
|
|
@@ -6,17 +6,12 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const errors_1 = require("@oclif/errors");
|
|
7
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
|
-
const node_os_1 = require("node:os");
|
|
10
9
|
const node_path_1 = require("node:path");
|
|
11
10
|
const which_1 = tslib_1.__importDefault(require("which"));
|
|
12
11
|
const tsimportlib_1 = require("tsimportlib");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!supportedPlatforms.includes(p)) {
|
|
17
|
-
throw new errors_1.CLIError(`${p} is not supported to zip file. Only supports: ${supportedPlatforms}`);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
12
|
+
const archiver_1 = tslib_1.__importDefault(require("archiver"));
|
|
13
|
+
const node_events_1 = require("node:events");
|
|
14
|
+
const node_stream_zip_1 = tslib_1.__importDefault(require("node-stream-zip"));
|
|
20
15
|
const checkBuildPath = (buildPath) => {
|
|
21
16
|
if (!(0, node_fs_1.lstatSync)(buildPath).isDirectory()) {
|
|
22
17
|
throw new errors_1.CLIError(`Build path (${buildPath}) is expected to directory.`);
|
|
@@ -25,23 +20,35 @@ const checkBuildPath = (buildPath) => {
|
|
|
25
20
|
const name = (0, node_path_1.basename)(buildPath);
|
|
26
21
|
return [parentPath, name];
|
|
27
22
|
};
|
|
28
|
-
const findZip = () => {
|
|
29
|
-
const zip = which_1.default.sync("zip", { nothrow: true });
|
|
30
|
-
if (!zip) {
|
|
31
|
-
throw new errors_1.CLIError("Can't find zip command in PATH.");
|
|
32
|
-
}
|
|
33
|
-
return zip;
|
|
34
|
-
};
|
|
23
|
+
const findZip = () => which_1.default.sync("zip", { nothrow: true });
|
|
35
24
|
const createZip = async (buildPath) => {
|
|
36
|
-
checkPlatform();
|
|
37
25
|
const [parentPath, name] = checkBuildPath(buildPath);
|
|
38
|
-
const zip = findZip();
|
|
39
26
|
const { temporaryFile } = (await (0, tsimportlib_1.dynamicImport)("tempy",
|
|
40
27
|
// eslint-disable-next-line unicorn/prefer-module
|
|
41
28
|
module));
|
|
42
29
|
const zipFile = temporaryFile({ name: "build.zip" });
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
const zip = findZip();
|
|
31
|
+
if (zip) {
|
|
32
|
+
(0, node_child_process_1.execFileSync)(zip, ["-r", zipFile, name], { cwd: parentPath });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const archive = (0, archiver_1.default)("zip");
|
|
36
|
+
const output = (0, node_fs_1.createWriteStream)(zipFile);
|
|
37
|
+
const close = (0, node_events_1.once)(output, "close");
|
|
38
|
+
archive.pipe(output);
|
|
39
|
+
archive.directory(buildPath, name);
|
|
40
|
+
await archive.finalize();
|
|
41
|
+
await close;
|
|
42
|
+
}
|
|
43
|
+
// Ensure zip file is valid.
|
|
44
|
+
try {
|
|
45
|
+
// eslint-disable-next-line new-cap
|
|
46
|
+
const zipStream = new node_stream_zip_1.default.async({ file: zipFile });
|
|
47
|
+
await zipStream.close();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new errors_1.CLIError(`Failed to create a valid zip file (${zipFile}): ${error}`);
|
|
51
|
+
}
|
|
45
52
|
return zipFile;
|
|
46
53
|
};
|
|
47
54
|
exports.createZip = createZip;
|
|
@@ -5,9 +5,9 @@ declare type RunTestProps = Readonly<{
|
|
|
5
5
|
option: CapabilityOption;
|
|
6
6
|
name?: string;
|
|
7
7
|
urlReplacements: CreateUrlReplacementRequest[];
|
|
8
|
-
|
|
8
|
+
autifyConnectAccessPoint?: string;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const runTest: (client: WebClient, url: string, { option, name, urlReplacements,
|
|
10
|
+
export declare const runTest: (client: WebClient, url: string, { option, name, urlReplacements, autifyConnectAccessPoint }: RunTestProps) => Promise<{
|
|
11
11
|
workspaceId: number;
|
|
12
12
|
resultId: number;
|
|
13
13
|
capability: string;
|
|
@@ -52,7 +52,7 @@ const capabilityToString = ({ os, os_version, browser, browser_version, device,
|
|
|
52
52
|
.filter((s) => Boolean(s))
|
|
53
53
|
.join(" ");
|
|
54
54
|
};
|
|
55
|
-
const runTest = async (client, url, { option, name, urlReplacements,
|
|
55
|
+
const runTest = async (client, url, { option, name, urlReplacements, autifyConnectAccessPoint }) => {
|
|
56
56
|
const scenario = parseScenarioUrl(url);
|
|
57
57
|
const testPlan = parseTestPlanUrl(url);
|
|
58
58
|
if (scenario) {
|
|
@@ -64,10 +64,10 @@ const runTest = async (client, url, { option, name, urlReplacements, autifyConne
|
|
|
64
64
|
scenarios: [{ id: scenarioId }],
|
|
65
65
|
// eslint-disable-next-line camelcase
|
|
66
66
|
url_replacements: urlReplacements,
|
|
67
|
-
...(
|
|
67
|
+
...(autifyConnectAccessPoint && {
|
|
68
68
|
// eslint-disable-next-line camelcase
|
|
69
69
|
autify_connect: {
|
|
70
|
-
name:
|
|
70
|
+
name: autifyConnectAccessPoint,
|
|
71
71
|
},
|
|
72
72
|
}),
|
|
73
73
|
});
|
|
@@ -82,8 +82,8 @@ const runTest = async (client, url, { option, name, urlReplacements, autifyConne
|
|
|
82
82
|
throw new errors_1.CLIError(`Running TestPlan doesn't support capability override: ${JSON.stringify(option)}`);
|
|
83
83
|
if (name)
|
|
84
84
|
throw new errors_1.CLIError(`Running TestPlan doesn't support --name: ${name}`);
|
|
85
|
-
if (
|
|
86
|
-
throw new errors_1.CLIError(
|
|
85
|
+
if (autifyConnectAccessPoint)
|
|
86
|
+
throw new errors_1.CLIError("Running TestPlan doesn't support Autify Connect Access Point");
|
|
87
87
|
const { workspaceId, testPlanId } = testPlan;
|
|
88
88
|
const urlReplacementIds = [];
|
|
89
89
|
for await (const urlReplacement of urlReplacements !== null && urlReplacements !== void 0 ? urlReplacements : []) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class ConnectAccessPointSet extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
private readKeyFromStdin;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const inquirer = tslib_1.__importStar(require("inquirer"));
|
|
6
|
+
const config_1 = require("../../../config");
|
|
7
|
+
class ConnectAccessPointSet extends core_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(ConnectAccessPointSet);
|
|
10
|
+
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);
|
|
13
|
+
}
|
|
14
|
+
async readKeyFromStdin() {
|
|
15
|
+
const res = await inquirer.prompt([
|
|
16
|
+
{
|
|
17
|
+
name: "key",
|
|
18
|
+
message: "Enter Autify Connect Access Point Key",
|
|
19
|
+
type: "password",
|
|
20
|
+
mask: true,
|
|
21
|
+
},
|
|
22
|
+
]);
|
|
23
|
+
return res.key;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = ConnectAccessPointSet;
|
|
27
|
+
ConnectAccessPointSet.description = "[Experimental] Set Autify Connect Access Point";
|
|
28
|
+
ConnectAccessPointSet.examples = [
|
|
29
|
+
"Start interactive setup:\n<%= config.bin %> <%= command.id %> --name=NAME",
|
|
30
|
+
"Reading the key from file:\n<%= config.bin %> <%= command.id %> --name=NAME < key.txt",
|
|
31
|
+
];
|
|
32
|
+
ConnectAccessPointSet.flags = {
|
|
33
|
+
name: core_1.Flags.string({
|
|
34
|
+
description: "Name of the Autify Connect Access Point already created",
|
|
35
|
+
required: true,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const installClient_1 = require("../../../autify/connect/installClient");
|
|
5
|
+
class ConnectClientInstall extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
await this.parse(ConnectClientInstall);
|
|
8
|
+
const { cacheDir } = this.config;
|
|
9
|
+
const { version, path } = await (0, installClient_1.installClient)(cacheDir);
|
|
10
|
+
this.log(`Successfully installed Autify Connect Client (path: ${path}, version: ${version})`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
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.flags = {};
|
|
17
|
+
ConnectClientInstall.args = [];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class ConnectClientStart extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
"file-logging": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const spawnClient_1 = require("../../../autify/connect/spawnClient");
|
|
5
|
+
class ConnectClientStart extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
var _a;
|
|
8
|
+
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, {
|
|
13
|
+
verbose,
|
|
14
|
+
fileLogging,
|
|
15
|
+
});
|
|
16
|
+
this.log(`Starting Autify Connect Client for Access Point "${accessPoint}" (${version})...`);
|
|
17
|
+
if (logFile)
|
|
18
|
+
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
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = ConnectClientStart;
|
|
35
|
+
ConnectClientStart.description = "[Experimental] Start Autify Connect Client";
|
|
36
|
+
ConnectClientStart.examples = ["<%= config.bin %> <%= command.id %>"];
|
|
37
|
+
ConnectClientStart.flags = {
|
|
38
|
+
verbose: core_1.Flags.boolean({
|
|
39
|
+
description: "Make the operation more talkative.",
|
|
40
|
+
default: false,
|
|
41
|
+
}),
|
|
42
|
+
"file-logging": core_1.Flags.boolean({
|
|
43
|
+
description: "Logging Autify Connect Client log to a file instead of console.",
|
|
44
|
+
default: false,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
@@ -6,6 +6,7 @@ export default class WebTestRun extends Command {
|
|
|
6
6
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
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
|
+
"autify-connect-client": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
os: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
11
|
"os-version": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
12
|
browser: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
@@ -8,6 +8,7 @@ const config_1 = require("../../../config");
|
|
|
8
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
|
+
const spawnClient_1 = require("../../../autify/connect/spawnClient");
|
|
11
12
|
const parseUrlReplacements = (urlReplacements) => {
|
|
12
13
|
return urlReplacements.map((s) => {
|
|
13
14
|
// eslint-disable-next-line camelcase
|
|
@@ -41,28 +42,66 @@ class WebTestRun extends core_1.Command {
|
|
|
41
42
|
const urlReplacements = parseUrlReplacements((_a = flags["url-replacements"]) !== null && _a !== void 0 ? _a : []);
|
|
42
43
|
if (urlReplacements.length > 0)
|
|
43
44
|
this.log(`${node_emoji_1.default.get("memo")} Using URL replacements: ${urlReplacementsToString(urlReplacements)}`);
|
|
44
|
-
const
|
|
45
|
-
const { configDir, userAgent } = this.config;
|
|
45
|
+
const { configDir, cacheDir, userAgent } = this.config;
|
|
46
46
|
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
47
47
|
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
48
48
|
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
const verbose = flags.verbose;
|
|
50
|
+
let autifyConnectAccessPoint = flags["autify-connect"];
|
|
51
|
+
let autifyConnectClient;
|
|
52
|
+
if (flags["autify-connect-client"]) {
|
|
53
|
+
const fileLogging = !verbose;
|
|
54
|
+
autifyConnectClient = await (0, spawnClient_1.spawnClient)(configDir, cacheDir, {
|
|
55
|
+
verbose,
|
|
56
|
+
fileLogging,
|
|
57
|
+
});
|
|
58
|
+
const { version, logFile, accessPoint, waitReady } = autifyConnectClient;
|
|
59
|
+
autifyConnectAccessPoint = accessPoint;
|
|
60
|
+
this.log(`Starting Autify Connect Client for Access Point "${accessPoint}" (${version})...`);
|
|
61
|
+
if (logFile)
|
|
62
|
+
this.log(`Log file is located at ${logFile}`);
|
|
63
|
+
this.log("Waiting until Autify Connect Client is ready...");
|
|
64
|
+
await waitReady();
|
|
65
|
+
this.log("Autify Connect Client is ready!");
|
|
62
66
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
try {
|
|
68
|
+
const { workspaceId, resultId, capability } = await (0, runTest_1.runTest)(client, args["scenario-or-test-plan-url"], {
|
|
69
|
+
option: capabilityOption,
|
|
70
|
+
name: flags.name,
|
|
71
|
+
urlReplacements,
|
|
72
|
+
autifyConnectAccessPoint,
|
|
73
|
+
});
|
|
74
|
+
const testResultUrl = (0, getTestResultUrl_1.getWebTestResultUrl)(configDir, workspaceId, resultId);
|
|
75
|
+
this.log(`${node_emoji_1.default.get("white_check_mark")} Successfully started: ${testResultUrl} (Capability is ${capability})`);
|
|
76
|
+
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);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.log("To wait for the test result, run the command below:");
|
|
84
|
+
this.log(`${node_emoji_1.default.get("computer")} $ autify web test wait ${testResultUrl}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
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;
|
|
104
|
+
}
|
|
66
105
|
}
|
|
67
106
|
}
|
|
68
107
|
}
|
|
@@ -89,6 +128,12 @@ WebTestRun.flags = {
|
|
|
89
128
|
}),
|
|
90
129
|
"autify-connect": core_1.Flags.string({
|
|
91
130
|
description: "Name of the Autify Connect Access Point (Only for test scenario execution.)",
|
|
131
|
+
exclusive: ["autify-connect-client"],
|
|
132
|
+
}),
|
|
133
|
+
"autify-connect-client": core_1.Flags.boolean({
|
|
134
|
+
description: "[Experimental] Start Autify Connect Client (Only for test scenario execution.)",
|
|
135
|
+
exclusive: ["autify-connect"],
|
|
136
|
+
dependsOn: ["wait"],
|
|
92
137
|
}),
|
|
93
138
|
os: core_1.Flags.string({ description: "OS to run the test" }),
|
|
94
139
|
"os-version": core_1.Flags.string({ description: "OS version 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_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_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;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.7.2","commands":{"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},"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.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}]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autifyhq/autify-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Autify Command Line Interface (CLI)",
|
|
5
5
|
"author": "Autify",
|
|
6
6
|
"bin": {
|
|
@@ -24,24 +24,32 @@
|
|
|
24
24
|
"@oclif/plugin-not-found": "^2.3.1",
|
|
25
25
|
"@oclif/plugin-update": "^3.0.0",
|
|
26
26
|
"@oclif/plugin-warn-if-update-available": "^2.0.4",
|
|
27
|
+
"archiver": "^5.3.1",
|
|
27
28
|
"envfile": "^6.17.0",
|
|
28
29
|
"inquirer": "^8.2.4",
|
|
29
30
|
"listr": "^0.14.3",
|
|
30
31
|
"node-emoji": "^1.11.0",
|
|
32
|
+
"node-fetch": "^2.6.7",
|
|
33
|
+
"node-stream-zip": "^1.15.0",
|
|
31
34
|
"per-env": "^1.0.2",
|
|
32
35
|
"tempy": "^3.0.0",
|
|
33
36
|
"tsimportlib": "^0.0.3",
|
|
34
|
-
"
|
|
37
|
+
"unzip-stream": "^0.3.1",
|
|
38
|
+
"which": "^2.0.2",
|
|
39
|
+
"winston": "^3.8.1"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
42
|
"@autifyhq/autify-cli-integration-test": "*",
|
|
38
43
|
"@oclif/test": "^2",
|
|
44
|
+
"@types/archiver": "^5.3.1",
|
|
39
45
|
"@types/chai": "^4",
|
|
40
46
|
"@types/inquirer": "^8.2.1",
|
|
41
47
|
"@types/listr": "^0.14.4",
|
|
42
48
|
"@types/mocha": "^9.1.1",
|
|
43
49
|
"@types/node": "^16.11.52",
|
|
44
50
|
"@types/node-emoji": "^1.8.1",
|
|
51
|
+
"@types/node-fetch": "^2.6.2",
|
|
52
|
+
"@types/unzip-stream": "^0.3.1",
|
|
45
53
|
"chai": "^4",
|
|
46
54
|
"eslint": "^7.32.0",
|
|
47
55
|
"eslint-config-oclif": "^4",
|
|
@@ -91,6 +99,21 @@
|
|
|
91
99
|
},
|
|
92
100
|
"mobile:auth": {
|
|
93
101
|
"description": "Authentication on Autify for Mobile"
|
|
102
|
+
},
|
|
103
|
+
"mobile:build": {
|
|
104
|
+
"description": "Build on Autify for Mobile"
|
|
105
|
+
},
|
|
106
|
+
"mobile:test": {
|
|
107
|
+
"description": "Test on Autify for Mobile"
|
|
108
|
+
},
|
|
109
|
+
"connect": {
|
|
110
|
+
"description": "Autify Connect"
|
|
111
|
+
},
|
|
112
|
+
"connect:access-point": {
|
|
113
|
+
"description": "Autify Connect Access Point"
|
|
114
|
+
},
|
|
115
|
+
"connect:client": {
|
|
116
|
+
"description": "Autify Connect Client"
|
|
94
117
|
}
|
|
95
118
|
},
|
|
96
119
|
"update": {
|