@autifyhq/autify-cli-integration-test 0.5.0 → 0.6.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/__recordings__/mobile%20build%20upload%20--workspace-id%20nYmF1n%20android.apk/polly-proxy_3343057686/recording.har +59 -0
- package/__recordings__/mobile%20test%20run%20--build-id%208DuzpG%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2FnYmF1n%2Ftest_plans%2FDEWt9g/polly-proxy_3343057686/recording.har +60 -0
- package/__recordings__/mobile%20test%20run%20--build-id%208DuzpG%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2FnYmF1n%2Ftest_plans%2FDEWt9g%20--wait/polly-proxy_3343057686/recording.har +1331 -0
- package/__recordings__/mobile%20test%20run%20--build-path%20android.apk%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2FnYmF1n%2Ftest_plans%2FDEWt9g/polly-proxy_3343057686/recording.har +105 -0
- package/__recordings__/mobile%20test%20run%20--build-path%20ios.app%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2FnYmF1n%2Ftest_plans%2FDPjteo/polly-proxy_3343057686/recording.har +105 -0
- package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437/polly-proxy_3343057686/recording.har +15 -15
- package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437%20--wait/polly-proxy_3343057686/recording.har +178 -96
- package/__snapshots__/golden/mobileBuildUpload.test.js.snap +12 -0
- package/__snapshots__/golden/mobileTestRun.test.js.snap +14 -0
- package/__snapshots__/golden/mobileTestRunAndroid.test.js.snap +15 -0
- package/__snapshots__/golden/mobileTestRunIos.test.js.snap +15 -0
- package/__snapshots__/golden/mobileTestRunWait.test.js.snap +47 -0
- package/__snapshots__/golden/webTestRun.test.js.snap +14 -0
- package/__snapshots__/golden/{cli.test.js.snap → webTestRunWait.test.js.snap} +7 -18
- package/dist/bin/autify-cli-integration-test.js +5 -1
- package/dist/bin/autify-with-proxy.js +6 -0
- package/dist/test/golden/{cli.test.d.ts → mobileBuildUpload.test.d.ts} +0 -0
- package/dist/test/golden/mobileBuildUpload.test.js +5 -0
- package/dist/test/golden/mobileTestRun.test.d.ts +1 -0
- package/dist/test/golden/mobileTestRun.test.js +5 -0
- package/dist/test/golden/mobileTestRunAndroid.test.d.ts +1 -0
- package/dist/test/golden/mobileTestRunAndroid.test.js +5 -0
- package/dist/test/golden/mobileTestRunIos.test.d.ts +1 -0
- package/dist/test/golden/mobileTestRunIos.test.js +5 -0
- package/dist/test/golden/mobileTestRunWait.test.d.ts +1 -0
- package/dist/test/golden/mobileTestRunWait.test.js +5 -0
- package/dist/test/golden/webTestRun.test.d.ts +1 -0
- package/dist/test/golden/webTestRun.test.js +5 -0
- package/dist/test/golden/webTestRunWait.test.d.ts +1 -0
- package/dist/test/golden/webTestRunWait.test.js +5 -0
- package/dist/test/helpers/execAutifyCli.js +4 -2
- package/dist/test/helpers/testAutifyCliSnapshot.d.ts +8 -0
- package/dist/test/helpers/testAutifyCliSnapshot.js +33 -0
- package/package.json +7 -5
- package/dist/test/golden/cli.test.js +0 -12
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify mobile build upload --workspace-id nYmF1n android.apk 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully uploaded android.apk (ID: LjujRg). See https://mobile-app.autify.com/projects/nYmF1n/builds?os=android&selectedBuildId=LjujRg&page=1
|
|
9
|
+
[HPM] server close signal received: closing proxy server
|
|
10
|
+
",
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully started: https://mobile-app.autify.com/projects/nYmF1n/results/gMtd01
|
|
9
|
+
To wait for the test result, run the command below:
|
|
10
|
+
💻 $ autify mobile test wait https://mobile-app.autify.com/projects/nYmF1n/results/gMtd01
|
|
11
|
+
[HPM] server close signal received: closing proxy server
|
|
12
|
+
",
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify mobile test run --build-path android.apk https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully uploaded android.apk (ID: rQuo0d). See https://mobile-app.autify.com/projects/nYmF1n/builds?os=android&selectedBuildId=rQuo0d&page=1
|
|
9
|
+
✅ Successfully started: https://mobile-app.autify.com/projects/nYmF1n/results/xjtOvA
|
|
10
|
+
To wait for the test result, run the command below:
|
|
11
|
+
💻 $ autify mobile test wait https://mobile-app.autify.com/projects/nYmF1n/results/xjtOvA
|
|
12
|
+
[HPM] server close signal received: closing proxy server
|
|
13
|
+
",
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify mobile test run --build-path ios.app https://mobile-app.autify.com/projects/nYmF1n/test_plans/DPjteo 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully uploaded ios.app (ID: BXu06G). See https://mobile-app.autify.com/projects/nYmF1n/builds?os=ios&selectedBuildId=BXu06G&page=1
|
|
9
|
+
✅ Successfully started: https://mobile-app.autify.com/projects/nYmF1n/results/5OtDG6
|
|
10
|
+
To wait for the test result, run the command below:
|
|
11
|
+
💻 $ autify mobile test wait https://mobile-app.autify.com/projects/nYmF1n/results/5OtDG6
|
|
12
|
+
[HPM] server close signal received: closing proxy server
|
|
13
|
+
",
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g --wait 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully started: https://mobile-app.autify.com/projects/nYmF1n/results/X1tp12
|
|
9
|
+
🕐 Waiting for the test result: https://mobile-app.autify.com/projects/nYmF1n/results/X1tp12
|
|
10
|
+
[HH:MM:SS] Waiting... (timeout: 300 s) [started]
|
|
11
|
+
[HH:MM:SS] → TestPlan: ⏳ Waiting, TestCases: ⏳ Waiting
|
|
12
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
13
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
14
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
15
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
16
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
17
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
18
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
19
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
20
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
21
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
22
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
23
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
24
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
25
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
26
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
27
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
28
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
29
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
30
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
31
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
32
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
33
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
34
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
35
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
36
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
37
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
38
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
39
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
40
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
41
|
+
[HH:MM:SS] → TestPlan: 👍 Passed , TestCases: 👍 Passed
|
|
42
|
+
[HH:MM:SS] Waiting... (timeout: 300 s) [completed]
|
|
43
|
+
✅ Test passed!: https://mobile-app.autify.com/projects/nYmF1n/results/X1tp12
|
|
44
|
+
[HPM] server close signal received: closing proxy server
|
|
45
|
+
",
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`autify web test run https://app.autify.com/projects/743/scenarios/91437 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"stderr": "",
|
|
6
|
+
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
|
+
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
+
✅ Successfully started: https://app.autify.com/projects/743/results/1096843 (Capability is Linux Chrome 101.0)
|
|
9
|
+
To wait for the test result, run the command below:
|
|
10
|
+
💻 $ autify web test wait https://app.autify.com/projects/743/results/1096843
|
|
11
|
+
[HPM] server close signal received: closing proxy server
|
|
12
|
+
",
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`autify
|
|
3
|
+
exports[`autify web test run https://app.autify.com/projects/743/scenarios/91437 --wait 1`] = `
|
|
4
4
|
Object {
|
|
5
5
|
"stderr": "",
|
|
6
6
|
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
7
7
|
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
8
|
-
✅ Successfully started: https://app.autify.com/projects/743/results/
|
|
9
|
-
🕐 Waiting for the test result: https://app.autify.com/projects/743/results/
|
|
8
|
+
✅ Successfully started: https://app.autify.com/projects/743/results/1096844 (Capability is Linux Chrome 101.0)
|
|
9
|
+
🕐 Waiting for the test result: https://app.autify.com/projects/743/results/1096844
|
|
10
10
|
[HH:MM:SS] Waiting... (timeout: 300 s) [started]
|
|
11
|
-
[HH:MM:SS] → TestPlan:
|
|
11
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
12
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
13
|
+
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
12
14
|
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
13
15
|
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
14
16
|
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
@@ -18,20 +20,7 @@ Object {
|
|
|
18
20
|
[HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
|
|
19
21
|
[HH:MM:SS] → TestPlan: 👍 Passed , TestCases: 👍 Passed
|
|
20
22
|
[HH:MM:SS] Waiting... (timeout: 300 s) [completed]
|
|
21
|
-
✅ Test passed!: https://app.autify.com/projects/743/results/
|
|
22
|
-
[HPM] server close signal received: closing proxy server
|
|
23
|
-
",
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`autify-cli autify web test run https://app.autify.com/projects/743/scenarios/91437 1`] = `
|
|
28
|
-
Object {
|
|
29
|
-
"stderr": "",
|
|
30
|
-
"stdout": "[HPM] Proxy created: / -> https://app.autify.com
|
|
31
|
-
[HPM] Proxy created: / -> https://mobile-app.autify.com
|
|
32
|
-
✅ Successfully started: https://app.autify.com/projects/743/results/846404 (Capability is Linux Chrome 101.0)
|
|
33
|
-
To wait for the test result, run the command below:
|
|
34
|
-
💻 $ autify web test wait https://app.autify.com/projects/743/results/846404
|
|
23
|
+
✅ Test passed!: https://app.autify.com/projects/743/results/1096844
|
|
35
24
|
[HPM] server close signal received: closing proxy server
|
|
36
25
|
",
|
|
37
26
|
}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
5
6
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
7
|
const node_process_1 = require("node:process");
|
|
7
8
|
// eslint-disable-next-line unicorn/prefer-module
|
|
8
9
|
const scriptDir = __dirname;
|
|
9
10
|
const rootDir = node_path_1.default.join(scriptDir, "..", "..");
|
|
10
11
|
const isRecord = node_process_1.argv[2] === "--record";
|
|
11
|
-
|
|
12
|
+
let command = isRecord ? "test:record" : "test";
|
|
13
|
+
if ((0, node_os_1.platform)() === "win32") {
|
|
14
|
+
command = `${command} -- --testPathIgnorePatterns mobileTestRunIos.test`;
|
|
15
|
+
}
|
|
12
16
|
(0, node_child_process_1.execSync)(`npm run ${command}`, {
|
|
13
17
|
stdio: "inherit",
|
|
14
18
|
cwd: rootDir,
|
|
@@ -41,6 +41,12 @@ const createPolly = async (args) => {
|
|
|
41
41
|
flushRequestsOnStop: true,
|
|
42
42
|
matchRequestsBy: {
|
|
43
43
|
headers: false,
|
|
44
|
+
body: (body, _) => {
|
|
45
|
+
// Binary body is not recorded. Ignore for matching.
|
|
46
|
+
if (typeof body !== "string")
|
|
47
|
+
return "";
|
|
48
|
+
return body;
|
|
49
|
+
},
|
|
44
50
|
},
|
|
45
51
|
});
|
|
46
52
|
// Remove headers because access token is included and also we don't care any other headers.
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.mobileBuildUpload);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.mobileTestRun);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.mobileTestRunAndroid);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.mobileTestRunIos);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.mobileTestRunWait);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.webTestRun);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/filename-case */
|
|
4
|
+
const testAutifyCliSnapshot_1 = require("../helpers/testAutifyCliSnapshot");
|
|
5
|
+
(0, testAutifyCliSnapshot_1.testAutifyCliSnapshot)(testAutifyCliSnapshot_1.webTestRunWait);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.execAutifyCli = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
/* eslint-disable unicorn/filename-case */
|
|
5
6
|
const node_util_1 = require("node:util");
|
|
6
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
|
|
7
9
|
const execAutifyCli = async (args) => {
|
|
8
10
|
const command = `autify-with-proxy ${args}`;
|
|
9
11
|
const { stdout, stderr } = await (0, node_util_1.promisify)(node_child_process_1.exec)(command);
|
|
10
12
|
return {
|
|
11
|
-
stdout: stdout.replace(/\d{2}:\d{2}:\d{2}/g, "HH:MM:SS"),
|
|
12
|
-
stderr: stderr,
|
|
13
|
+
stdout: (0, strip_ansi_1.default)(stdout).replace(/\d{2}:\d{2}:\d{2}/g, "HH:MM:SS"),
|
|
14
|
+
stderr: (0, strip_ansi_1.default)(stderr),
|
|
13
15
|
};
|
|
14
16
|
};
|
|
15
17
|
exports.execAutifyCli = execAutifyCli;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const webTestRun = "web test run https://app.autify.com/projects/743/scenarios/91437";
|
|
2
|
+
export declare const webTestRunWait = "web test run https://app.autify.com/projects/743/scenarios/91437 --wait";
|
|
3
|
+
export declare const mobileBuildUpload: string;
|
|
4
|
+
export declare const mobileTestRun = "mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g";
|
|
5
|
+
export declare const mobileTestRunWait = "mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g --wait";
|
|
6
|
+
export declare const mobileTestRunAndroid: string;
|
|
7
|
+
export declare const mobileTestRunIos: string;
|
|
8
|
+
export declare const testAutifyCliSnapshot: (command: string) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testAutifyCliSnapshot = exports.mobileTestRunIos = exports.mobileTestRunAndroid = exports.mobileTestRunWait = exports.mobileTestRun = exports.mobileBuildUpload = exports.webTestRunWait = exports.webTestRun = void 0;
|
|
4
|
+
/* eslint-disable unicorn/filename-case */
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const execAutifyCli_1 = require("../helpers/execAutifyCli");
|
|
8
|
+
const iosBuildPath = "ios.app";
|
|
9
|
+
const androidBuildPath = "android.apk";
|
|
10
|
+
// https://commons.wikimedia.org/wiki/File:Transparent.gif
|
|
11
|
+
const tinyBinary = Buffer.from("R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", "base64");
|
|
12
|
+
// Generate fake build files if not exiting.
|
|
13
|
+
// For recording, you should setup the real files on the same paths.
|
|
14
|
+
if (!(0, node_fs_1.existsSync)(iosBuildPath)) {
|
|
15
|
+
(0, node_fs_1.mkdirSync)(iosBuildPath); // *.app is a directory
|
|
16
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(iosBuildPath, "ios"), tinyBinary); // Add a fake binary file
|
|
17
|
+
}
|
|
18
|
+
if (!(0, node_fs_1.existsSync)(androidBuildPath)) {
|
|
19
|
+
(0, node_fs_1.writeFileSync)(androidBuildPath, tinyBinary); // Create a fake binary file
|
|
20
|
+
}
|
|
21
|
+
exports.webTestRun = "web test run https://app.autify.com/projects/743/scenarios/91437";
|
|
22
|
+
exports.webTestRunWait = "web test run https://app.autify.com/projects/743/scenarios/91437 --wait";
|
|
23
|
+
exports.mobileBuildUpload = `mobile build upload --workspace-id nYmF1n ${androidBuildPath}`;
|
|
24
|
+
exports.mobileTestRun = "mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g";
|
|
25
|
+
exports.mobileTestRunWait = "mobile test run --build-id 8DuzpG https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g --wait";
|
|
26
|
+
exports.mobileTestRunAndroid = `mobile test run --build-path ${androidBuildPath} https://mobile-app.autify.com/projects/nYmF1n/test_plans/DEWt9g`;
|
|
27
|
+
exports.mobileTestRunIos = `mobile test run --build-path ${iosBuildPath} https://mobile-app.autify.com/projects/nYmF1n/test_plans/DPjteo`;
|
|
28
|
+
const testAutifyCliSnapshot = (command) => {
|
|
29
|
+
test(`autify ${command}`, async () => {
|
|
30
|
+
expect(await (0, execAutifyCli_1.execAutifyCli)(command)).toMatchSnapshot();
|
|
31
|
+
}, 300000);
|
|
32
|
+
};
|
|
33
|
+
exports.testAutifyCliSnapshot = testAutifyCliSnapshot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autifyhq/autify-cli-integration-test",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Autify Command Line Interface (CLI) Integration Test",
|
|
5
5
|
"author": "Autify",
|
|
6
6
|
"bin": {
|
|
@@ -25,16 +25,18 @@
|
|
|
25
25
|
"@pollyjs/adapter-node-http": "^6.0.5",
|
|
26
26
|
"@pollyjs/core": "^6.0.5",
|
|
27
27
|
"@pollyjs/persister-fs": "^6.0.5",
|
|
28
|
+
"cross-env": "^7.0.3",
|
|
28
29
|
"express": "^4.18.1",
|
|
29
30
|
"http-proxy-middleware": "^2.0.6",
|
|
30
31
|
"jest": "^28.1.3",
|
|
32
|
+
"strip-ansi": "^6.0.0",
|
|
31
33
|
"tslib": "^2.4.0",
|
|
32
34
|
"which": "^2.0.2"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@types/express": "^4.17.13",
|
|
36
|
-
"@types/jest": "^28.1.
|
|
37
|
-
"@types/node": "^16.11.
|
|
38
|
+
"@types/jest": "^28.1.7",
|
|
39
|
+
"@types/node": "^16.11.52",
|
|
38
40
|
"@types/which": "^2.0.1",
|
|
39
41
|
"shx": "^0.3.4",
|
|
40
42
|
"ts-node": "^10.9.1",
|
|
@@ -43,8 +45,8 @@
|
|
|
43
45
|
"scripts": {
|
|
44
46
|
"build": "shx rm -rf dist && tsc -b",
|
|
45
47
|
"prepack": "npm run build",
|
|
46
|
-
"test": "jest dist/test",
|
|
47
|
-
"test:record": "AUTIFY_POLLY_RECORD=1
|
|
48
|
+
"test": "cross-env AUTIFY_TEST_WAIT_INTERVAL_SECOND=0 jest dist/test",
|
|
49
|
+
"test:record": "AUTIFY_POLLY_RECORD=1 jest dist/test --updateSnapshot"
|
|
48
50
|
},
|
|
49
51
|
"engines": {
|
|
50
52
|
"node": ">=12.0.0"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const execAutifyCli_1 = require("../helpers/execAutifyCli");
|
|
4
|
-
const commands = [
|
|
5
|
-
"web test run https://app.autify.com/projects/743/scenarios/91437",
|
|
6
|
-
"web test run https://app.autify.com/projects/743/scenarios/91437 --wait",
|
|
7
|
-
];
|
|
8
|
-
describe("autify-cli", () => {
|
|
9
|
-
test.each(commands)("autify %s", async (command) => {
|
|
10
|
-
expect(await (0, execAutifyCli_1.execAutifyCli)(command)).toMatchSnapshot();
|
|
11
|
-
}, 300000);
|
|
12
|
-
});
|