@autifyhq/autify-cli-integration-test 0.27.0 → 0.29.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.
Files changed (48) hide show
  1. package/__recordings__/{mobile%20build%20upload%20--json%20--workspace-id%3D4yyFEL%20android.apk → mobile%20build%20upload%20android.apk%20--workspace-id%3D4yyFEL}/polly-proxy_3343057686/recording.har +6 -6
  2. package/__recordings__/{mobile%20build%20upload%20--workspace-id%3D4yyFEL%20ios.app → mobile%20build%20upload%20android.apk%20--workspace-id%3D4yyFEL%20--json}/polly-proxy_3343057686/recording.har +6 -6
  3. package/__recordings__/{mobile%20build%20upload%20--workspace-id%3D4yyFEL%20android.apk → mobile%20build%20upload%20ios.app%20--workspace-id%3D4yyFEL}/polly-proxy_3343057686/recording.har +6 -6
  4. package/__recordings__/{mobile%20test%20run%20--build-id%3Dd1ulrD%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97 → mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97%20--build-id%3Dd1ulrD}/polly-proxy_3343057686/recording.har +5 -5
  5. package/__recordings__/mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97%20--build-id%3Dd1ulrD%20--wait/polly-proxy_3343057686/recording.har +962 -0
  6. package/__recordings__/{mobile%20test%20run%20--build-path%3Dandroid.apk%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97 → mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97%20--build-path%3Dandroid.apk}/polly-proxy_3343057686/recording.har +13 -13
  7. package/__recordings__/mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97%20--build-path%3Dandroid.apk%20--wait/polly-proxy_3343057686/recording.har +1704 -0
  8. package/__recordings__/{mobile%20test%20run%20--build-path%3Dios.app%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FkYtlRR → mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FkYtlRR%20--build-path%3Dios.app}/polly-proxy_3343057686/recording.har +13 -13
  9. package/__recordings__/mobile%20test%20run%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FkYtlRR%20--build-path%3Dios.app%20--wait/polly-proxy_3343057686/recording.har +10970 -0
  10. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437/polly-proxy_3343057686/recording.har +15 -15
  11. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437%20--wait/polly-proxy_3343057686/recording.har +561 -0
  12. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437%20--wait%20--autify-connect-client/polly-proxy_3343057686/recording.har +694 -0
  13. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437%20-r%3D%22https%3A%2F%2Fexample.com%20https%3A%2F%2Fexample.net%3Ffoo%3Dbar%22/polly-proxy_3343057686/recording.har +110 -0
  14. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437%20-r%3D%22https%3A%2F%2Fexample.com%3Dhttps%3A%2F%2Fexample.net%3Ffoo%3Dbar%22/polly-proxy_3343057686/recording.har +110 -0
  15. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Ftest_plans%2F169408/polly-proxy_3343057686/recording.har +5 -5
  16. package/__recordings__/web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Ftest_plans%2F169408%20--wait/polly-proxy_3343057686/recording.har +552 -0
  17. package/__recordings__/{web%20test%20run%20--autify-connect-client%20--wait%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Ftest_plans%2F169408 → web%20test%20run%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Ftest_plans%2F169408%20--wait%20--autify-connect-client}/polly-proxy_3343057686/recording.har +97 -138
  18. package/__snapshots__/golden/mobileBuildUpload.test.js.snap +2 -2
  19. package/__snapshots__/golden/mobileBuildUploadIos.test.js.snap +2 -2
  20. package/__snapshots__/golden/mobileBuildUploadJson.test.js.snap +2 -2
  21. package/__snapshots__/golden/mobileTestRun.test.js.snap +3 -3
  22. package/__snapshots__/golden/mobileTestRunAndroid.test.js.snap +4 -4
  23. package/__snapshots__/golden/mobileTestRunAndroidWait.test.js.snap +27 -5
  24. package/__snapshots__/golden/mobileTestRunIos.test.js.snap +4 -4
  25. package/__snapshots__/golden/mobileTestRunIosWait.test.js.snap +195 -6
  26. package/__snapshots__/golden/mobileTestRunWait.test.js.snap +9 -4
  27. package/__snapshots__/golden/webTestRun.test.js.snap +3 -3
  28. package/__snapshots__/golden/webTestRunAutifyConnectClient.test.js.snap +10 -9
  29. package/__snapshots__/golden/webTestRunTestPlan.test.js.snap +3 -3
  30. package/__snapshots__/golden/webTestRunTestPlanAutifyConnectClient.test.js.snap +9 -10
  31. package/__snapshots__/golden/webTestRunTestPlanWait.test.js.snap +6 -5
  32. package/__snapshots__/golden/webTestRunUrlReplacements.test.js.snap +15 -0
  33. package/__snapshots__/golden/webTestRunUrlReplacementsDeprecated.test.js.snap +18 -0
  34. package/__snapshots__/golden/webTestRunWait.test.js.snap +6 -6
  35. package/dist/bin/autify-with-proxy.js +2 -2
  36. package/dist/commands.js +9 -10
  37. package/dist/test/golden/webTestRunUrlReplacements.test.d.ts +1 -0
  38. package/dist/test/golden/webTestRunUrlReplacements.test.js +5 -0
  39. package/dist/test/golden/webTestRunUrlReplacementsDeprecated.test.d.ts +1 -0
  40. package/dist/test/golden/webTestRunUrlReplacementsDeprecated.test.js +5 -0
  41. package/dist/test/helpers/execAutifyCli.js +5 -3
  42. package/package.json +6 -6
  43. package/__recordings__/mobile%20test%20run%20--build-id%3Dd1ulrD%20--wait%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97/polly-proxy_3343057686/recording.har +0 -757
  44. package/__recordings__/mobile%20test%20run%20--build-path%3Dandroid.apk%20--wait%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FWptd97/polly-proxy_3343057686/recording.har +0 -802
  45. package/__recordings__/mobile%20test%20run%20--build-path%3Dios.app%20--wait%20https%3A%2F%2Fmobile-app.autify.com%2Fprojects%2F4yyFEL%2Ftest_plans%2FkYtlRR/polly-proxy_3343057686/recording.har +0 -3221
  46. package/__recordings__/web%20test%20run%20--autify-connect-client%20--wait%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437/polly-proxy_3343057686/recording.har +0 -653
  47. package/__recordings__/web%20test%20run%20--wait%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Fscenarios%2F91437/polly-proxy_3343057686/recording.har +0 -561
  48. package/__recordings__/web%20test%20run%20--wait%20https%3A%2F%2Fapp.autify.com%2Fprojects%2F743%2Ftest_plans%2F169408/polly-proxy_3343057686/recording.har +0 -511
@@ -1,15 +1,15 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`autify web test run https://app.autify.com/projects/0000/scenarios/0000 --wait 1`] = `
4
- Object {
4
+ {
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/1109244 (Capability is Linux Chrome 104.0)
9
- 🕐 Waiting for the test result: https://app.autify.com/projects/743/results/1109244
8
+ ✅ Successfully started: https://app.autify.com/projects/743/results/1899675 (Capability is Linux Chrome 110.0)
9
+ 🕐 Waiting for the test result: https://app.autify.com/projects/743/results/1899675
10
10
  [HH:MM:SS] Waiting... (timeout: 300 s) [started]
11
- [HH:MM:SS] → TestPlan: ⏳ Waiting, TestCases: ⏳ Waiting
12
- [HH:MM:SS] → TestPlan: ⏳ Waiting, TestCases: ⏳ Waiting
11
+ [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
12
+ [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
13
13
  [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
14
14
  [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
15
15
  [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
@@ -20,7 +20,7 @@ Object {
20
20
  [HH:MM:SS] → TestPlan: 🚗 Running, TestCases: 🚗 Running
21
21
  [HH:MM:SS] → TestPlan: 👍 Passed , TestCases: 👍 Passed
22
22
  [HH:MM:SS] Waiting... (timeout: 300 s) [completed]
23
- ✅ Test passed!: https://app.autify.com/projects/743/results/1109244
23
+ ✅ Test passed!: https://app.autify.com/projects/743/results/1899675
24
24
  [HPM] server close signal received: closing proxy server
25
25
  ",
26
26
  }
@@ -93,8 +93,8 @@ const autifyWithProxy = async (originalArgs) => {
93
93
  env: {
94
94
  AUTIFY_CONNECT_CLIENT_MODE: "fake",
95
95
  ...node_process_1.env,
96
- AUTIFY_WEB_BASE_PATH: `http://localhost:${webProxy.port}/api/v1/`,
97
- AUTIFY_MOBILE_BASE_PATH: `http://localhost:${mobileProxy.port}/api/v1/`,
96
+ AUTIFY_WEB_BASE_PATH: `http://127.0.0.1:${webProxy.port}/api/v1/`,
97
+ AUTIFY_MOBILE_BASE_PATH: `http://127.0.0.1:${mobileProxy.port}/api/v1/`,
98
98
  },
99
99
  stdio: "inherit",
100
100
  shell: true,
package/dist/commands.js CHANGED
@@ -14,18 +14,23 @@ const concatFlagAndValue = (args) => {
14
14
  let flag = null;
15
15
  for (const arg of args) {
16
16
  if (flag !== null) {
17
- if (arg.startsWith("--")) {
17
+ if (arg.startsWith("-")) {
18
18
  newArgs.push(flag);
19
19
  flag = arg;
20
20
  continue;
21
21
  }
22
22
  else {
23
- newArgs.push(`${flag}=${arg}`);
23
+ if (flag === "-r" || flag === "--url-replacements") {
24
+ newArgs.push(`${flag}="${arg}"`);
25
+ }
26
+ else {
27
+ newArgs.push(`${flag}=${arg}`);
28
+ }
24
29
  flag = null;
25
30
  continue;
26
31
  }
27
32
  }
28
- if (arg.startsWith("--")) {
33
+ if (arg.startsWith("-")) {
29
34
  flag = arg;
30
35
  continue;
31
36
  }
@@ -59,12 +64,6 @@ const replaceMobileWorkspaceId = (arg) => arg.startsWith("--workspace-id=")
59
64
  const replaceMobileAndroidBuildId = (arg) => arg.startsWith("--build-id=") ? `--build-id=${mobileAndroidBuildId}` : arg;
60
65
  const replaceMobileAndroidBuildPath = (arg) => arg.replace(/^(--[^=]+=)?.+\.apk$/, `$1${exports.androidBuildPath}`);
61
66
  const replaceMobileIosBuildPath = (arg) => arg.replace(/^(--[^=]+=)?.+\.app$/, `$1${exports.iosBuildPath}`);
62
- const sortParameters = (args) => {
63
- // Currently assuming the first three arguments are for command and the rest are parameters.
64
- const command = args.slice(0, 3);
65
- const parameters = args.slice(3);
66
- return [...command, ...parameters.sort()];
67
- };
68
67
  // Assuming ios command contains .app
69
68
  const isIos = (args) => args.some((a) => a.endsWith(".app"));
70
69
  const replaceConstants = (args) => {
@@ -87,5 +86,5 @@ const replaceConstants = (args) => {
87
86
  }
88
87
  return args;
89
88
  };
90
- const normalizeCommand = (args) => replaceConstants(sortParameters(concatFlagAndValue(args)));
89
+ const normalizeCommand = (args) => replaceConstants(concatFlagAndValue(args));
91
90
  exports.normalizeCommand = normalizeCommand;
@@ -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)('web test run https://app.autify.com/projects/0000/scenarios/0000 -r "https://example.com https://example.net?foo=bar"');
@@ -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)('web test run https://app.autify.com/projects/0000/scenarios/0000 -r "https://example.com=https://example.net?foo=bar"');
@@ -12,14 +12,16 @@ const normalize = (stdout) => stdout
12
12
  .replace(/path: .+autifyconnect[^,]*,/g, "path: /path/to/autifyconnect,")
13
13
  .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/g, "YYYY-MM-DDTHH:MM:SS.MMMZ")
14
14
  .replace(/debugServerPort: \d+,/g, "debugServerPort: <random>,")
15
- .replace(/debug server on http:\/\/localhost:\d+/g, "debug server on http://localhost:<random>")
16
- .replace(/Your session ID is "[^"]+"/, 'Your session ID is "fake"');
15
+ .replace(/debug server on http:\/\/localhost:\d+/g, "debug server on http://127.0.0.1:<random>")
16
+ .replace(/debug server on http:\/\/127.0.0.1:\d+/g, "debug server on http://127.0.0.1:<random>")
17
+ .replace(/Your session ID is "[^"]+"/, 'Your session ID is "fake"')
18
+ .replace(/»/g, "›");
17
19
  const execAutifyCli = async (args) => {
18
20
  const command = `autify-with-proxy ${args}`;
19
21
  const { stdout, stderr } = await (0, node_util_1.promisify)(node_child_process_1.exec)(command, { env: node_process_1.env });
20
22
  return {
21
23
  stdout: normalize((0, strip_ansi_1.default)(stdout)),
22
- stderr: (0, strip_ansi_1.default)(stderr),
24
+ stderr: normalize((0, strip_ansi_1.default)(stderr)),
23
25
  };
24
26
  };
25
27
  exports.execAutifyCli = execAutifyCli;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autifyhq/autify-cli-integration-test",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "Autify Command Line Interface (CLI) Integration Test",
5
5
  "author": "Autify",
6
6
  "bin": {
@@ -30,15 +30,15 @@
30
30
  "cross-env": "^7.0.3",
31
31
  "express": "^4.18.2",
32
32
  "http-proxy-middleware": "^2.0.6",
33
- "jest": "^28.1.3",
33
+ "jest": "^29.5.0",
34
34
  "strip-ansi": "^6.0.1",
35
35
  "tslib": "^2.5.0",
36
- "which": "^2.0.2"
36
+ "which": "^3.0.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/express": "^4.17.17",
40
- "@types/jest": "^28.1.8",
41
- "@types/node": "^16.18.12",
40
+ "@types/jest": "^29.4.0",
41
+ "@types/node": "^18.14.2",
42
42
  "@types/which": "^2.0.1",
43
43
  "shx": "^0.3.4",
44
44
  "ts-node": "^10.9.1",
@@ -51,7 +51,7 @@
51
51
  "test:record": "AUTIFY_POLLY_RECORD=1 jest --testMatch **/dist/test/**/*.test.js --updateSnapshot"
52
52
  },
53
53
  "engines": {
54
- "node": ">=12.0.0"
54
+ "node": ">=v18.14.2"
55
55
  },
56
56
  "bugs": {
57
57
  "url": "https://github.com/autifyhq/autify-cli/issues"