@mablhq/mabl-cli 1.61.8 → 2.0.3

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 (86) hide show
  1. package/Globals.js +11 -7
  2. package/api/basicApiClient.js +10 -10
  3. package/api/mablApiClient.js +39 -1
  4. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +6 -6
  5. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +8 -0
  6. package/cli.js +1 -0
  7. package/commands/app-files/app-files.js +5 -0
  8. package/commands/app-files/app-files_cmds/create.js +98 -0
  9. package/commands/app-files/app-files_cmds/delete.js +31 -0
  10. package/commands/app-files/app-files_cmds/download.js +50 -0
  11. package/commands/app-files/app-files_cmds/list.js +72 -0
  12. package/commands/config/config_cmds/install.js +92 -0
  13. package/commands/constants.js +10 -3
  14. package/commands/tests/testsUtil.js +45 -15
  15. package/commands/tests/tests_cmds/run-mobile.js +218 -0
  16. package/commands/tests/tests_cmds/run.js +11 -9
  17. package/core/util.js +36 -2
  18. package/env/defaultEnv.js +2 -1
  19. package/env/dev.js +2 -1
  20. package/env/env.js +3 -1
  21. package/env/local.js +2 -1
  22. package/env/prod.js +2 -1
  23. package/execution/index.js +13 -1
  24. package/execution/runAppiumServer.js +133 -0
  25. package/http/MablHttpAgent.js +4 -1
  26. package/http/RequestFilteringHttpAgent.js +3 -3
  27. package/http/axiosProxyConfig.js +27 -22
  28. package/http/httpUtil.js +6 -10
  29. package/mablApi/index.js +1 -1
  30. package/mablscript/MablAction.js +1 -1
  31. package/mablscript/MablStep.js +28 -2
  32. package/mablscript/MablStepV2.js +51 -0
  33. package/mablscript/MablSymbol.js +6 -2
  34. package/mablscript/actions/ExtractAction.js +11 -6
  35. package/mablscript/actions/FindAction.js +5 -5
  36. package/mablscript/actions/JavaScriptAction.js +19 -12
  37. package/mablscript/importer.js +97 -14
  38. package/mablscript/mobile/steps/CreateVariableMobileStep.js +53 -0
  39. package/mablscript/mobile/steps/EnterTextStep.js +41 -0
  40. package/mablscript/mobile/steps/NavigateBackStep.js +20 -0
  41. package/mablscript/mobile/steps/NavigateHomeStep.js +21 -0
  42. package/mablscript/mobile/steps/ScrollStep.js +37 -0
  43. package/mablscript/mobile/steps/SetOrientationStep.js +20 -0
  44. package/mablscript/mobile/steps/TapStep.js +37 -0
  45. package/mablscript/mobile/steps/actions/MobileFindAction.js +23 -0
  46. package/mablscript/mobile/steps/stepUtil.js +71 -0
  47. package/mablscript/mobile/tests/StepTestsUtil.js +20 -0
  48. package/mablscript/mobile/tests/TestMobileFindDescriptors.js +215 -0
  49. package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +287 -0
  50. package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +74 -0
  51. package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +167 -0
  52. package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +22 -0
  53. package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +22 -0
  54. package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +112 -0
  55. package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +27 -0
  56. package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +53 -0
  57. package/mablscript/steps/AssertStep.js +48 -38
  58. package/mablscript/steps/AssertStepOld.js +30 -2
  59. package/mablscript/steps/CreateVariableStep.js +9 -2
  60. package/mablscript/steps/EchoStep.js +4 -3
  61. package/mablscript/steps/ElseIfConditionStep.js +8 -2
  62. package/mablscript/steps/ElseStep.js +2 -1
  63. package/mablscript/steps/EndStep.js +2 -1
  64. package/mablscript/steps/EvaluateJavaScriptStep.js +6 -1
  65. package/mablscript/steps/IfConditionStep.js +17 -10
  66. package/mablscript/steps/SendHttpRequestStep.js +4 -3
  67. package/mablscript/steps/WaitStep.js +4 -3
  68. package/mablscript/types/GetVariableDescriptor.js +8 -3
  69. package/mablscript/types/mobile/CreateVariableMobileStepDescriptor.js +9 -0
  70. package/mablscript/types/mobile/EnterTextStepDescriptor.js +2 -0
  71. package/mablscript/types/mobile/NavigateBackStepDescriptor.js +2 -0
  72. package/mablscript/types/mobile/NavigateHomeStepDescriptor.js +2 -0
  73. package/mablscript/types/mobile/ScrollStepDescriptor.js +2 -0
  74. package/mablscript/types/mobile/SetOrientationStepDescriptor.js +8 -0
  75. package/mablscript/types/mobile/StepWithMobileFindDescriptor.js +2 -0
  76. package/mablscript/types/mobile/TapStepDescriptor.js +8 -0
  77. package/mablscriptFind/index.js +1 -1
  78. package/package.json +13 -6
  79. package/resources/pdf-viewer/embeddedPdfDetection.js +1 -14
  80. package/resources/webdriver.js +21 -0
  81. package/upload/index.js +5 -0
  82. package/util/FileCache.js +180 -0
  83. package/util/Lazy.js +90 -0
  84. package/util/MobileAppFileCache.js +102 -0
  85. package/util/RichPromise.js +3 -1
  86. package/webdriver/index.js +41 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq/mabl-cli",
3
- "version": "1.61.8",
3
+ "version": "2.0.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",
@@ -20,6 +20,7 @@
20
20
  "node": ">=16.0.0"
21
21
  },
22
22
  "dependencies": {
23
+ "@aws-crypto/crc32c": "5.1.0",
23
24
  "@google-cloud/storage": "6.11.0",
24
25
  "@mablhq/newman-reporter-mabl-console": "0.1.0",
25
26
  "@playwright/test": "1.38.0",
@@ -27,19 +28,21 @@
27
28
  "@types/serve-handler": "6.1.0",
28
29
  "@types/tmp": "0.2.0",
29
30
  "@types/tough-cookie": "4.0.2",
30
- "agent-base": "6.0.2",
31
+ "agent-base": "7.1.0",
31
32
  "analytics-node": "3.5.0",
33
+ "appium": "2.1.2",
32
34
  "async-mutex": "0.3.1",
33
35
  "async-retry": "1.3.3",
34
36
  "axe-core": "4.3.3",
35
37
  "axios": "0.27.2",
36
38
  "axios-cookiejar-support": "1.0.1",
39
+ "cachedir": "2.4.0",
37
40
  "cd": "0.3.3",
38
41
  "chalk": "2.4.2",
39
42
  "change-case": "4.1.1",
40
43
  "chrome-launcher": "0.14.2",
41
44
  "cli-table3": "0.6.1",
42
- "conf": "7.1.2",
45
+ "conf": "10.2.0",
43
46
  "csv-parser": "3.0.0",
44
47
  "csv-stringify": "6.2.3",
45
48
  "decompress-zip": "0.2.2",
@@ -54,9 +57,10 @@
54
57
  "git-repo-info": "2.1.1",
55
58
  "glob": "7.1.6",
56
59
  "hpagent": "1.0.0",
57
- "https-proxy-agent": "5.0.0",
60
+ "http-mitm-proxy": "1.0.0",
61
+ "https-proxy-agent": "7.0.1",
58
62
  "humanize-duration": "3.23.0",
59
- "inquirer": "7.1.0",
63
+ "inquirer": "8.2.5",
60
64
  "js-yaml": "4.1.0",
61
65
  "jsesc": "3.0.2",
62
66
  "jwt-decode": "2.2.0",
@@ -65,6 +69,7 @@
65
69
  "markdown-table": "2.0.0",
66
70
  "mime-types": "2.1.27",
67
71
  "minimist": "1.2.8",
72
+ "mjpeg-consumer": "2.0.0",
68
73
  "mochawesome-report-generator": "6.2.0",
69
74
  "moment": "2.29.4",
70
75
  "murmurhash": "1.0.0",
@@ -83,14 +88,16 @@
83
88
  "serve-handler": "6.1.5",
84
89
  "set-cookie-parser": "2.5.1",
85
90
  "simple-update-notifier": "1.1.0",
86
- "socks-proxy-agent": "6.1.1",
91
+ "socks-proxy-agent": "8.0.1",
87
92
  "stoppable": "1.1.0",
88
93
  "strip-ansi": "6.0.0",
94
+ "tldts": "6.0.12",
89
95
  "tmp-promise": "3.0.2",
90
96
  "tough-cookie": "4.0.0",
91
97
  "triple-beam": "1.3.0",
92
98
  "uuid": "9.0.0",
93
99
  "v8-compile-cache": "2.1.1",
100
+ "webdriverio": "7.30.0",
94
101
  "winston": "3.7.2",
95
102
  "winston-transport": "4.4.0",
96
103
  "y18n": "4.0.1",
@@ -125,7 +125,7 @@ mablEmbeddedPdfDetector = () => {
125
125
  );
126
126
 
127
127
  // Signal embedded PDF detection and pending download
128
- // Wait for the event to be acknowledged before starting the download
128
+ // Wait for PDF to be downloaded by PageFrameContextTracker before continuing
129
129
  await window.dispatchMablEvent({
130
130
  type: MESSAGE_TYPE_EMBEDDED_PDF_DETECTED,
131
131
  baseUri,
@@ -133,9 +133,6 @@ mablEmbeddedPdfDetector = () => {
133
133
  pdfFileName,
134
134
  });
135
135
 
136
- // Trigger a download for the PDF
137
- mablDownloadEmbeddedPdf(pdfFileName, pdfUrl);
138
-
139
136
  // Trigger replacement of the embedded PDF with an interactable version served by PDF server
140
137
  window.dispatchMablEvent({
141
138
  type: MESSAGE_TYPE_EMBEDDED_PDF_MARKED,
@@ -203,16 +200,6 @@ function mablGetPdfFilenameFromUrl(pdfUrl) {
203
200
  return pdfUrl.startsWith('blob:') ? 'blob_pdf' : pdfFileName;
204
201
  }
205
202
 
206
- function mablDownloadEmbeddedPdf(fileName, pdfUrl) {
207
- const aTag = document.createElement('a');
208
- aTag.style.display = 'none';
209
- document.body.appendChild(aTag);
210
- aTag.href = pdfUrl;
211
- aTag.setAttribute('download', fileName);
212
- aTag.click();
213
- document.body.removeChild(aTag);
214
- }
215
-
216
203
  if (!documentHasDocType()) {
217
204
  // If this is executed too quickly, the DOCTYPE has not been loaded yet
218
205
  // so wait a bit before checking again.