@autifyhq/autify-cli 0.3.1
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/LICENSE +21 -0
- package/README.md +512 -0
- package/bin/dev +22 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +10 -0
- package/bin/run.cmd +3 -0
- package/dist/autify/web/getTestResultUrl.d.ts +1 -0
- package/dist/autify/web/getTestResultUrl.js +16 -0
- package/dist/autify/web/parseTestResultUrl.d.ts +4 -0
- package/dist/autify/web/parseTestResultUrl.js +17 -0
- package/dist/autify/web/runTest.d.ts +14 -0
- package/dist/autify/web/runTest.js +97 -0
- package/dist/autify/web/waitTestResult.d.ts +8 -0
- package/dist/autify/web/waitTestResult.js +71 -0
- package/dist/commands/mobile/api/run-test-plan.d.ts +10 -0
- package/dist/commands/mobile/api/run-test-plan.js +29 -0
- package/dist/commands/mobile/api/upload-build.d.ts +10 -0
- package/dist/commands/mobile/api/upload-build.js +26 -0
- package/dist/commands/mobile/auth/login.d.ts +7 -0
- package/dist/commands/mobile/auth/login.js +30 -0
- package/dist/commands/web/api/create-url-replacement.d.ts +10 -0
- package/dist/commands/web/api/create-url-replacement.js +29 -0
- package/dist/commands/web/api/delete-url-replacement.d.ts +10 -0
- package/dist/commands/web/api/delete-url-replacement.js +29 -0
- package/dist/commands/web/api/describe-result.d.ts +10 -0
- package/dist/commands/web/api/describe-result.js +29 -0
- package/dist/commands/web/api/describe-scenario.d.ts +10 -0
- package/dist/commands/web/api/describe-scenario.js +29 -0
- package/dist/commands/web/api/execute-scenarios.d.ts +10 -0
- package/dist/commands/web/api/execute-scenarios.js +29 -0
- package/dist/commands/web/api/execute-schedule.d.ts +9 -0
- package/dist/commands/web/api/execute-schedule.js +25 -0
- package/dist/commands/web/api/list-capabilities.d.ts +12 -0
- package/dist/commands/web/api/list-capabilities.js +34 -0
- package/dist/commands/web/api/list-results.d.ts +12 -0
- package/dist/commands/web/api/list-results.js +37 -0
- package/dist/commands/web/api/list-scenarios.d.ts +10 -0
- package/dist/commands/web/api/list-scenarios.js +29 -0
- package/dist/commands/web/api/list-url-replacements.d.ts +9 -0
- package/dist/commands/web/api/list-url-replacements.js +25 -0
- package/dist/commands/web/api/update-url-replacement.d.ts +11 -0
- package/dist/commands/web/api/update-url-replacement.js +33 -0
- package/dist/commands/web/auth/login.d.ts +7 -0
- package/dist/commands/web/auth/login.js +30 -0
- package/dist/commands/web/test/run.d.ts +23 -0
- package/dist/commands/web/test/run.js +114 -0
- package/dist/commands/web/test/wait.d.ts +15 -0
- package/dist/commands/web/test/wait.js +54 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/oclif.manifest.json +1 -0
- package/package.json +141 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class WebApiListScenarios extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
"project-id": import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
7
|
+
page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
5
|
+
const config_1 = require("../../../config");
|
|
6
|
+
class WebApiListScenarios extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(WebApiListScenarios);
|
|
9
|
+
const { configDir, userAgent } = this.config;
|
|
10
|
+
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
11
|
+
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
12
|
+
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
13
|
+
const res = await client.listScenarios(flags["project-id"], flags.page);
|
|
14
|
+
console.log(JSON.stringify(res.data, null, 2));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = WebApiListScenarios;
|
|
18
|
+
WebApiListScenarios.description = "List scenarios.";
|
|
19
|
+
WebApiListScenarios.examples = ["<%= config.bin %> <%= command.id %>"];
|
|
20
|
+
WebApiListScenarios.flags = {
|
|
21
|
+
"project-id": core_1.Flags.integer({
|
|
22
|
+
description: "For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios",
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
page: core_1.Flags.integer({
|
|
26
|
+
description: "The number of page returns.",
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class WebApiListUrlReplacements extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
"test-plan-id": import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
5
|
+
const config_1 = require("../../../config");
|
|
6
|
+
class WebApiListUrlReplacements extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(WebApiListUrlReplacements);
|
|
9
|
+
const { configDir, userAgent } = this.config;
|
|
10
|
+
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
11
|
+
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
12
|
+
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
13
|
+
const res = await client.listUrlReplacements(flags["test-plan-id"]);
|
|
14
|
+
console.log(JSON.stringify(res.data, null, 2));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = WebApiListUrlReplacements;
|
|
18
|
+
WebApiListUrlReplacements.description = "List url replacements for the test plan";
|
|
19
|
+
WebApiListUrlReplacements.examples = ["<%= config.bin %> <%= command.id %>"];
|
|
20
|
+
WebApiListUrlReplacements.flags = {
|
|
21
|
+
"test-plan-id": core_1.Flags.integer({
|
|
22
|
+
description: "For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15",
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class WebApiUpdateUrlReplacement extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
"test-plan-id": import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
7
|
+
"url-replacement-id": import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
8
|
+
"update-url-replacement-request": import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
5
|
+
const config_1 = require("../../../config");
|
|
6
|
+
class WebApiUpdateUrlReplacement extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(WebApiUpdateUrlReplacement);
|
|
9
|
+
const { configDir, userAgent } = this.config;
|
|
10
|
+
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
11
|
+
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
12
|
+
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
13
|
+
const res = await client.updateUrlReplacement(flags["test-plan-id"], flags["url-replacement-id"], JSON.parse(flags["update-url-replacement-request"]));
|
|
14
|
+
console.log(JSON.stringify(res.data, null, 2));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = WebApiUpdateUrlReplacement;
|
|
18
|
+
WebApiUpdateUrlReplacement.description = "Update a url replacement for the test plan";
|
|
19
|
+
WebApiUpdateUrlReplacement.examples = ["<%= config.bin %> <%= command.id %>"];
|
|
20
|
+
WebApiUpdateUrlReplacement.flags = {
|
|
21
|
+
"test-plan-id": core_1.Flags.integer({
|
|
22
|
+
description: "For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15",
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
"url-replacement-id": core_1.Flags.integer({
|
|
26
|
+
description: "url_replacement id",
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
"update-url-replacement-request": core_1.Flags.string({
|
|
30
|
+
description: "The url to replace. Either pattern_url or replacement_url is required.",
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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 WebAuthLogin extends core_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
await this.parse(WebAuthLogin);
|
|
10
|
+
const token = await this.readTokenFromStdin();
|
|
11
|
+
(0, config_1.set)(this.config.configDir, "AUTIFY_WEB_ACCESS_TOKEN", token);
|
|
12
|
+
}
|
|
13
|
+
async readTokenFromStdin() {
|
|
14
|
+
const res = await inquirer.prompt([
|
|
15
|
+
{
|
|
16
|
+
name: "token",
|
|
17
|
+
message: "Enter Access Token",
|
|
18
|
+
type: "password",
|
|
19
|
+
mask: true,
|
|
20
|
+
},
|
|
21
|
+
]);
|
|
22
|
+
return res.token;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = WebAuthLogin;
|
|
26
|
+
WebAuthLogin.description = "Login to Autify for Web";
|
|
27
|
+
WebAuthLogin.examples = [
|
|
28
|
+
"Start interactive setup:\n<%= config.bin %> <%= command.id %>",
|
|
29
|
+
"Reading the token from file:\n<%= config.bin %> <%= command.id %> < token.txt",
|
|
30
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class WebTestRun extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
"url-replacements": import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
|
8
|
+
os: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
"os-version": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
browser: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
device: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
"device-type": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
+
wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
15
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
static args: {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
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 node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
6
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
7
|
+
const config_1 = require("../../../config");
|
|
8
|
+
const runTest_1 = require("../../../autify/web/runTest");
|
|
9
|
+
const getTestResultUrl_1 = require("../../../autify/web/getTestResultUrl");
|
|
10
|
+
const wait_1 = tslib_1.__importDefault(require("./wait"));
|
|
11
|
+
const parseUrlReplacements = (urlReplacements) => {
|
|
12
|
+
return urlReplacements.map((s) => {
|
|
13
|
+
// eslint-disable-next-line camelcase
|
|
14
|
+
const [pattern_url, replacement_url] = s.split("=");
|
|
15
|
+
// eslint-disable-next-line camelcase
|
|
16
|
+
return { pattern_url, replacement_url };
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const urlReplacementsToString = (
|
|
20
|
+
// eslint-disable-next-line camelcase
|
|
21
|
+
urlReplacements) => {
|
|
22
|
+
return urlReplacements
|
|
23
|
+
.map((urlReplacement) => {
|
|
24
|
+
return `${urlReplacement.pattern_url} => ${urlReplacement.replacement_url}`;
|
|
25
|
+
})
|
|
26
|
+
.join(", ");
|
|
27
|
+
};
|
|
28
|
+
class WebTestRun extends core_1.Command {
|
|
29
|
+
async run() {
|
|
30
|
+
var _a;
|
|
31
|
+
const { args, flags } = await this.parse(WebTestRun);
|
|
32
|
+
const capabilityOption = {
|
|
33
|
+
os: flags.os,
|
|
34
|
+
// eslint-disable-next-line camelcase
|
|
35
|
+
os_version: flags["os-version"],
|
|
36
|
+
browser: flags.browser,
|
|
37
|
+
device: flags.device,
|
|
38
|
+
// eslint-disable-next-line camelcase
|
|
39
|
+
device_type: flags["device-type"],
|
|
40
|
+
};
|
|
41
|
+
const urlReplacements = parseUrlReplacements((_a = flags["url-replacements"]) !== null && _a !== void 0 ? _a : []);
|
|
42
|
+
if (urlReplacements.length > 0)
|
|
43
|
+
this.log(`${node_emoji_1.default.get("memo")} Using URL replacements: ${urlReplacementsToString(urlReplacements)}`);
|
|
44
|
+
const { configDir, userAgent } = this.config;
|
|
45
|
+
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
46
|
+
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
47
|
+
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
48
|
+
const { workspaceId, resultId, capability } = await (0, runTest_1.runTest)(client, args["scenario-or-test-plan-url"], {
|
|
49
|
+
option: capabilityOption,
|
|
50
|
+
name: flags.name,
|
|
51
|
+
urlReplacements,
|
|
52
|
+
});
|
|
53
|
+
const testResultUrl = (0, getTestResultUrl_1.getWebTestResultUrl)(configDir, workspaceId, resultId);
|
|
54
|
+
this.log(`${node_emoji_1.default.get("white_check_mark")} Successfully started: ${testResultUrl} (Capability is ${capability})`);
|
|
55
|
+
if (flags.wait) {
|
|
56
|
+
const waitArgs = ["--timeout", flags.timeout.toString(), testResultUrl];
|
|
57
|
+
if (flags.verbose)
|
|
58
|
+
waitArgs.push("--verbose");
|
|
59
|
+
await wait_1.default.run(waitArgs);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.log("To wait for the test result, run the command below:");
|
|
63
|
+
this.log(`${node_emoji_1.default.get("computer")} $ autify web test wait ${testResultUrl}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.default = WebTestRun;
|
|
68
|
+
WebTestRun.description = "Run a scenario or test plan.";
|
|
69
|
+
WebTestRun.examples = [
|
|
70
|
+
"Run a test scenario (Default capability):\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000",
|
|
71
|
+
"Run a test plan:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/test_plans/0000",
|
|
72
|
+
"Run and wait a test scenario:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --wait --timeout 600",
|
|
73
|
+
'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',
|
|
74
|
+
"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",
|
|
75
|
+
'Run a test with specifying the execution name:\n<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/scenarios/0000 --name "Sample execution"',
|
|
76
|
+
];
|
|
77
|
+
WebTestRun.flags = {
|
|
78
|
+
name: core_1.Flags.string({
|
|
79
|
+
char: "n",
|
|
80
|
+
description: "Name of the test execution. (Only for test scenario execution.)",
|
|
81
|
+
}),
|
|
82
|
+
"url-replacements": core_1.Flags.string({
|
|
83
|
+
char: "r",
|
|
84
|
+
description: "URL replacements. Example: http://example.com=http://example.net",
|
|
85
|
+
multiple: true,
|
|
86
|
+
}),
|
|
87
|
+
os: core_1.Flags.string({ description: "OS to run the test" }),
|
|
88
|
+
"os-version": core_1.Flags.string({ description: "OS version to run the test" }),
|
|
89
|
+
browser: core_1.Flags.string({ description: "Browser to run the test" }),
|
|
90
|
+
device: core_1.Flags.string({ description: "Device to run the test" }),
|
|
91
|
+
"device-type": core_1.Flags.string({ description: "Device type to run the test" }),
|
|
92
|
+
wait: core_1.Flags.boolean({
|
|
93
|
+
char: "w",
|
|
94
|
+
description: "Wait until the test finishes.",
|
|
95
|
+
default: false,
|
|
96
|
+
}),
|
|
97
|
+
timeout: core_1.Flags.integer({
|
|
98
|
+
char: "t",
|
|
99
|
+
description: "Timeout seconds when waiting for the finish of the test execution.",
|
|
100
|
+
default: 300,
|
|
101
|
+
}),
|
|
102
|
+
verbose: core_1.Flags.boolean({
|
|
103
|
+
char: "v",
|
|
104
|
+
description: "Verbose output",
|
|
105
|
+
default: false,
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
WebTestRun.args = [
|
|
109
|
+
{
|
|
110
|
+
name: "scenario-or-test-plan-url",
|
|
111
|
+
description: "Scenario URL or Test plan URL e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>",
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class WebTestWait extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
7
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}[];
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
6
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
7
|
+
const config_1 = require("../../../config");
|
|
8
|
+
const parseTestResultUrl_1 = require("../../../autify/web/parseTestResultUrl");
|
|
9
|
+
const waitTestResult_1 = require("../../../autify/web/waitTestResult");
|
|
10
|
+
const getTestResultUrl_1 = require("../../../autify/web/getTestResultUrl");
|
|
11
|
+
class WebTestWait extends core_1.Command {
|
|
12
|
+
async run() {
|
|
13
|
+
const { args, flags } = await this.parse(WebTestWait);
|
|
14
|
+
const { configDir, userAgent } = this.config;
|
|
15
|
+
const accessToken = (0, config_1.getOrThrow)(configDir, "AUTIFY_WEB_ACCESS_TOKEN");
|
|
16
|
+
const basePath = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH");
|
|
17
|
+
const client = new autify_sdk_1.WebClient(accessToken, { basePath, userAgent });
|
|
18
|
+
const { workspaceId, resultId } = (0, parseTestResultUrl_1.parseTestResultUrl)(args["test-result-url"]);
|
|
19
|
+
const testResultUrl = (0, getTestResultUrl_1.getWebTestResultUrl)(configDir, workspaceId, resultId);
|
|
20
|
+
this.log(`${node_emoji_1.default.get("clock1")} Waiting for the test result: ${testResultUrl}`);
|
|
21
|
+
const { isPassed, data } = await (0, waitTestResult_1.waitTestResult)(client, workspaceId, resultId, { timeoutSecond: flags.timeout, verbose: flags.verbose });
|
|
22
|
+
if (isPassed) {
|
|
23
|
+
this.log(`${node_emoji_1.default.get("white_check_mark")} Test passed!: ${testResultUrl}`);
|
|
24
|
+
this.exit();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.error(`${node_emoji_1.default.get("x")} Test didn't pass. See ${testResultUrl}: ${JSON.stringify(data)}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = WebTestWait;
|
|
32
|
+
WebTestWait.description = "Wait a test result until it finishes.";
|
|
33
|
+
WebTestWait.examples = [
|
|
34
|
+
"<%= config.bin %> <%= command.id %> https://app.autify.com/projects/0000/results/0000",
|
|
35
|
+
];
|
|
36
|
+
WebTestWait.flags = {
|
|
37
|
+
timeout: core_1.Flags.integer({
|
|
38
|
+
char: "t",
|
|
39
|
+
description: "Timeout seconds when waiting for the finish of the test execution.",
|
|
40
|
+
default: 300,
|
|
41
|
+
}),
|
|
42
|
+
verbose: core_1.Flags.boolean({
|
|
43
|
+
char: "v",
|
|
44
|
+
description: "Verbose output",
|
|
45
|
+
default: false,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
WebTestWait.args = [
|
|
49
|
+
{
|
|
50
|
+
name: "test-result-url",
|
|
51
|
+
description: "Test result URL e.g. https://app.autify.com/projects/<ID>/results/<ID>",
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
];
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare type Variable = "AUTIFY_WEB_ACCESS_TOKEN" | "AUTIFY_WEB_BASE_PATH" | "AUTIFY_MOBILE_ACCESS_TOKEN" | "AUTIFY_MOBILE_BASE_PATH";
|
|
2
|
+
export declare const set: (configDir: string, key: Variable, value: string | undefined) => void;
|
|
3
|
+
export declare const get: (configDir: string, key: Variable) => string | undefined;
|
|
4
|
+
export declare const getOrThrow: (configDir: string, key: Variable) => string;
|
|
5
|
+
export {};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOrThrow = exports.get = exports.set = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const envfile = tslib_1.__importStar(require("envfile"));
|
|
6
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
7
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
8
|
+
const envFile = (dir) => path.resolve(dir, "config.env");
|
|
9
|
+
const read = (dir) => fs.existsSync(envFile(dir))
|
|
10
|
+
? envfile.parse(fs.readFileSync(envFile(dir)).toString())
|
|
11
|
+
: {};
|
|
12
|
+
const write = (dir, config) => fs.writeFileSync(envFile(dir), envfile.stringify(config));
|
|
13
|
+
const set = (configDir, key, value) => {
|
|
14
|
+
if (!fs.existsSync(configDir)) {
|
|
15
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
const config = read(configDir);
|
|
18
|
+
if (value) {
|
|
19
|
+
config[key] = value;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
delete config[key];
|
|
23
|
+
}
|
|
24
|
+
write(configDir, config);
|
|
25
|
+
};
|
|
26
|
+
exports.set = set;
|
|
27
|
+
const get = (configDir, key) => {
|
|
28
|
+
return key in process.env ? process.env[key] : read(configDir)[key];
|
|
29
|
+
};
|
|
30
|
+
exports.get = get;
|
|
31
|
+
const getOrThrow = (configDir, key) => {
|
|
32
|
+
const value = (0, exports.get)(configDir, key);
|
|
33
|
+
if (!value) {
|
|
34
|
+
throw new Error(`Config for ${key} is not found.`);
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
exports.getOrThrow = getOrThrow;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from "@oclif/core";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.3.1","commands":{"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[]},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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":[],"_globalFlags":{}},"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\""],"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},"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}],"_globalFlags":{}},"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}],"_globalFlags":{}}}}
|
package/package.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@autifyhq/autify-cli",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Autify Command Line Interface (CLI)",
|
|
5
|
+
"author": "Autify",
|
|
6
|
+
"bin": {
|
|
7
|
+
"autify": "./bin/run"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/autifyhq/autify-cli",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"repository": "autifyhq/autify-cli",
|
|
13
|
+
"files": [
|
|
14
|
+
"/bin",
|
|
15
|
+
"/dist",
|
|
16
|
+
"/npm-shrinkwrap.json",
|
|
17
|
+
"/oclif.manifest.json"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@autifyhq/autify-sdk": "^0.1.0",
|
|
21
|
+
"@oclif/core": "^1",
|
|
22
|
+
"@oclif/errors": "^1.3.5",
|
|
23
|
+
"@oclif/plugin-help": "^5",
|
|
24
|
+
"@oclif/plugin-not-found": "^2.3.1",
|
|
25
|
+
"@oclif/plugin-update": "^3.0.0",
|
|
26
|
+
"@oclif/plugin-warn-if-update-available": "^2.0.4",
|
|
27
|
+
"envfile": "^6.17.0",
|
|
28
|
+
"inquirer": "^8.2.4",
|
|
29
|
+
"listr": "^0.14.3",
|
|
30
|
+
"node-emoji": "^1.11.0",
|
|
31
|
+
"per-env": "^1.0.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@autifyhq/autify-cli-integration-test": "*",
|
|
35
|
+
"@oclif/test": "^2",
|
|
36
|
+
"@types/chai": "^4",
|
|
37
|
+
"@types/inquirer": "^8.2.1",
|
|
38
|
+
"@types/listr": "^0.14.4",
|
|
39
|
+
"@types/mocha": "^9.1.1",
|
|
40
|
+
"@types/node": "^16.11.39",
|
|
41
|
+
"@types/node-emoji": "^1.8.1",
|
|
42
|
+
"chai": "^4",
|
|
43
|
+
"eslint": "^7.32.0",
|
|
44
|
+
"eslint-config-oclif": "^4",
|
|
45
|
+
"eslint-config-oclif-typescript": "^1.0.2",
|
|
46
|
+
"eslint-config-prettier": "^8.5.0",
|
|
47
|
+
"husky": "^8.0.1",
|
|
48
|
+
"lint-staged": "^13.0.1",
|
|
49
|
+
"mocha": "^9",
|
|
50
|
+
"oclif": "^3",
|
|
51
|
+
"patch-package": "^6.4.7",
|
|
52
|
+
"prettier": "^2.6.2",
|
|
53
|
+
"shx": "^0.3.4",
|
|
54
|
+
"ts-morph": "^14.0.0",
|
|
55
|
+
"ts-node": "^10.8.1",
|
|
56
|
+
"tslib": "^2.4.0",
|
|
57
|
+
"typescript": "^4.7.3"
|
|
58
|
+
},
|
|
59
|
+
"oclif": {
|
|
60
|
+
"bin": "autify",
|
|
61
|
+
"dirname": "autify",
|
|
62
|
+
"commands": "./dist/commands",
|
|
63
|
+
"plugins": [
|
|
64
|
+
"@oclif/plugin-help",
|
|
65
|
+
"@oclif/plugin-not-found",
|
|
66
|
+
"@oclif/plugin-update",
|
|
67
|
+
"@oclif/plugin-warn-if-update-available"
|
|
68
|
+
],
|
|
69
|
+
"topicSeparator": " ",
|
|
70
|
+
"topics": {
|
|
71
|
+
"web": {
|
|
72
|
+
"description": "Autify for Web"
|
|
73
|
+
},
|
|
74
|
+
"web:api": {
|
|
75
|
+
"description": "Low-level APIs on Autify for Web"
|
|
76
|
+
},
|
|
77
|
+
"web:auth": {
|
|
78
|
+
"description": "Authentication on Autify for Web"
|
|
79
|
+
},
|
|
80
|
+
"web:test": {
|
|
81
|
+
"description": "Test on Autify for Web"
|
|
82
|
+
},
|
|
83
|
+
"mobile": {
|
|
84
|
+
"description": "Autify for Mobile"
|
|
85
|
+
},
|
|
86
|
+
"mobile:api": {
|
|
87
|
+
"description": "Low-level APIs on Autify for Mobile"
|
|
88
|
+
},
|
|
89
|
+
"mobile:auth": {
|
|
90
|
+
"description": "Authentication on Autify for Mobile"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"update": {
|
|
94
|
+
"s3": {
|
|
95
|
+
"bucket": "autify-cli-assets",
|
|
96
|
+
"folder": "autify-cli"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"macos": {
|
|
100
|
+
"identifier": "com.autify.cli"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"scripts": {
|
|
104
|
+
"postinstall": "per-env || true",
|
|
105
|
+
"postinstall:development": "patch-package",
|
|
106
|
+
"postinstall:production": "true",
|
|
107
|
+
"generate:api-commands": "ts-node scripts/generate-api-commands.ts",
|
|
108
|
+
"generate": "npm run generate:api-commands web && npm run generate:api-commands mobile",
|
|
109
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
110
|
+
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
111
|
+
"format": "prettier . --write",
|
|
112
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
113
|
+
"posttest": "npm run lint",
|
|
114
|
+
"prepack": "npm run build && oclif manifest && oclif readme",
|
|
115
|
+
"release": "ts-node ./scripts/release.ts",
|
|
116
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
117
|
+
"test:integration": "npm run build -w integration-test && autify-cli-integration-test",
|
|
118
|
+
"version": "oclif readme && git add README.md",
|
|
119
|
+
"prepare": "per-env || true",
|
|
120
|
+
"prepare:development": "husky install",
|
|
121
|
+
"prepare:production": "true"
|
|
122
|
+
},
|
|
123
|
+
"lint-staged": {
|
|
124
|
+
"**/*.{md,json,yml,js,cjs}": "prettier --write",
|
|
125
|
+
"**/*.ts": [
|
|
126
|
+
"eslint",
|
|
127
|
+
"prettier --write"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"engines": {
|
|
131
|
+
"node": ">=12.0.0"
|
|
132
|
+
},
|
|
133
|
+
"bugs": "https://github.com/autifyhq/autify-cli/issues",
|
|
134
|
+
"keywords": [
|
|
135
|
+
"oclif"
|
|
136
|
+
],
|
|
137
|
+
"workspaces": [
|
|
138
|
+
"integration-test"
|
|
139
|
+
],
|
|
140
|
+
"types": "dist/index.d.ts"
|
|
141
|
+
}
|