@mablhq/playwright-tools 2.49.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.
Files changed (436) hide show
  1. package/Globals.js +69 -0
  2. package/LICENSE.txt +29 -0
  3. package/README.md +219 -0
  4. package/api/ApiError.js +11 -0
  5. package/api/atlassian/bitBucketApiClient.js +81 -0
  6. package/api/atlassian/entities/CodeAnnotation.js +9 -0
  7. package/api/atlassian/entities/CodeReport.js +15 -0
  8. package/api/atlassian/entities/PullRequest.js +2 -0
  9. package/api/basicApiClient.js +293 -0
  10. package/api/entities/Browser.js +11 -0
  11. package/api/entities/Email.js +14 -0
  12. package/api/entities/FindStrategy.js +10 -0
  13. package/api/entities/Label.js +2 -0
  14. package/api/entities/VersionedObject.js +2 -0
  15. package/api/entities/Workspace.js +2 -0
  16. package/api/featureSet.js +44 -0
  17. package/api/mablApiClient.js +1070 -0
  18. package/api/mablApiClientFactory.js +79 -0
  19. package/api/types.js +10 -0
  20. package/auth/AuthClient.js +38 -0
  21. package/auth/OktaClient.js +97 -0
  22. package/browserEngines/browserEngine.js +41 -0
  23. package/browserEngines/browserEngines.js +14 -0
  24. package/browserEngines/chromiumBrowserEngine.js +177 -0
  25. package/browserEngines/firefoxBrowserEngine.js +134 -0
  26. package/browserEngines/unsupportedBrowserEngine.js +29 -0
  27. package/browserEngines/webkitBrowerEngine.js +50 -0
  28. package/browserLauncher/browser.js +2 -0
  29. package/browserLauncher/browserEvent.js +11 -0
  30. package/browserLauncher/browserLauncher.js +17 -0
  31. package/browserLauncher/browserLauncherEventEmitter.js +2 -0
  32. package/browserLauncher/browserLauncherFactory.js +30 -0
  33. package/browserLauncher/elementHandle.js +30 -0
  34. package/browserLauncher/errors.js +26 -0
  35. package/browserLauncher/frame.js +17 -0
  36. package/browserLauncher/frameBase.js +10 -0
  37. package/browserLauncher/httpRequest.js +2 -0
  38. package/browserLauncher/httpResponse.js +2 -0
  39. package/browserLauncher/jsHandle.js +2 -0
  40. package/browserLauncher/page.js +2 -0
  41. package/browserLauncher/pageEvent.js +17 -0
  42. package/browserLauncher/playwrightBrowserLauncher/browserDelegate.js +2 -0
  43. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumBrowserDelegate.js +61 -0
  44. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +129 -0
  45. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +24 -0
  46. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +145 -0
  47. package/browserLauncher/playwrightBrowserLauncher/elementHandleDelegate.js +2 -0
  48. package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxBrowserDelegate.js +50 -0
  49. package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxElementHandleDelegate.js +11 -0
  50. package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +36 -0
  51. package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxPageDelegate.js +15 -0
  52. package/browserLauncher/playwrightBrowserLauncher/frameDelegate.js +2 -0
  53. package/browserLauncher/playwrightBrowserLauncher/internals.js +2 -0
  54. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractBrowserDelegate.js +15 -0
  55. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractElementHandleDelegate.js +73 -0
  56. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractFrameDelegate.js +13 -0
  57. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractPageDelegate.js +81 -0
  58. package/browserLauncher/playwrightBrowserLauncher/pageDelegate.js +2 -0
  59. package/browserLauncher/playwrightBrowserLauncher/playwrightApiResponse.js +18 -0
  60. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +259 -0
  61. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +97 -0
  62. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +319 -0
  63. package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +265 -0
  64. package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +76 -0
  65. package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +26 -0
  66. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +377 -0
  67. package/browserLauncher/playwrightBrowserLauncher/simplePlaywrightLogger.js +36 -0
  68. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitBrowserDelegate.js +50 -0
  69. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitElementHandleDelegate.js +16 -0
  70. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitFrameDelegate.js +19 -0
  71. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitPageDelegate.js +15 -0
  72. package/browserLauncher/playwrightBrowserLauncher/wrappers.js +25 -0
  73. package/browserLauncher/types.js +28 -0
  74. package/browserLauncher/utils.js +9 -0
  75. package/cli.js +66 -0
  76. package/commands/applications/applications.js +5 -0
  77. package/commands/applications/applications_cmds/describe.js +21 -0
  78. package/commands/applications/applications_cmds/list.js +56 -0
  79. package/commands/auth/auth.js +5 -0
  80. package/commands/auth/auth_cmds/activate-key.js +38 -0
  81. package/commands/auth/auth_cmds/clear.js +10 -0
  82. package/commands/auth/auth_cmds/info.js +10 -0
  83. package/commands/auth/auth_cmds/login.js +10 -0
  84. package/commands/branches/branches.js +5 -0
  85. package/commands/branches/branches_cmds/create.js +56 -0
  86. package/commands/branches/branches_cmds/describe.js +50 -0
  87. package/commands/branches/branches_cmds/list.js +84 -0
  88. package/commands/branches/branches_cmds/merge.js +56 -0
  89. package/commands/browserTypes.js +20 -0
  90. package/commands/commandUtil/awaitCompletion.js +67 -0
  91. package/commands/commandUtil/branches.js +44 -0
  92. package/commands/commandUtil/codeInsights.js +181 -0
  93. package/commands/commandUtil/describe.js +32 -0
  94. package/commands/commandUtil/fileUtil.js +50 -0
  95. package/commands/commandUtil/interfaces.js +4 -0
  96. package/commands/commandUtil/list.js +70 -0
  97. package/commands/commandUtil/util.js +127 -0
  98. package/commands/commandUtil/versionUtil.js +33 -0
  99. package/commands/config/config.js +5 -0
  100. package/commands/config/config_cmds/configKeys.js +28 -0
  101. package/commands/config/config_cmds/delete.js +29 -0
  102. package/commands/config/config_cmds/get.js +52 -0
  103. package/commands/config/config_cmds/install.js +119 -0
  104. package/commands/config/config_cmds/list.js +39 -0
  105. package/commands/config/config_cmds/set.js +80 -0
  106. package/commands/constants.js +160 -0
  107. package/commands/credentials/credentials.js +5 -0
  108. package/commands/credentials/credentials_cmds/list.js +66 -0
  109. package/commands/datatables/datatables.js +5 -0
  110. package/commands/datatables/datatables_cmds/create.js +61 -0
  111. package/commands/datatables/datatables_cmds/describe.js +17 -0
  112. package/commands/datatables/datatables_cmds/export.js +86 -0
  113. package/commands/datatables/datatables_cmds/list.js +18 -0
  114. package/commands/datatables/datatables_cmds/scenarios.js +35 -0
  115. package/commands/datatables/datatables_cmds/update.js +120 -0
  116. package/commands/datatables/utils.js +145 -0
  117. package/commands/deploy/deploy.js +5 -0
  118. package/commands/deploy/deploy_cmds/awaitDeploymentCompletion.js +100 -0
  119. package/commands/deploy/deploy_cmds/create.js +342 -0
  120. package/commands/deploy/deploy_cmds/describe.js +54 -0
  121. package/commands/deploy/deploy_cmds/executionResultPresenter.js +117 -0
  122. package/commands/deploy/deploy_cmds/list.js +74 -0
  123. package/commands/deploy/deploy_cmds/watch.js +44 -0
  124. package/commands/environments/environments.js +5 -0
  125. package/commands/environments/environments_cmds/build-files.js +5 -0
  126. package/commands/environments/environments_cmds/build-files_cmds/add.js +73 -0
  127. package/commands/environments/environments_cmds/build-files_cmds/list.js +54 -0
  128. package/commands/environments/environments_cmds/build-files_cmds/update.js +71 -0
  129. package/commands/environments/environments_cmds/create.js +153 -0
  130. package/commands/environments/environments_cmds/delete.js +32 -0
  131. package/commands/environments/environments_cmds/describe.js +28 -0
  132. package/commands/environments/environments_cmds/list.js +56 -0
  133. package/commands/environments/environments_cmds/update.js +46 -0
  134. package/commands/environments/environments_cmds/urls.js +5 -0
  135. package/commands/environments/environments_cmds/urls_cmds/add.js +91 -0
  136. package/commands/environments/environments_cmds/urls_cmds/list.js +49 -0
  137. package/commands/flows/flows.js +5 -0
  138. package/commands/flows/flows_cmds/export.js +78 -0
  139. package/commands/flows/flows_cmds/list.js +64 -0
  140. package/commands/internal/internal.js +6 -0
  141. package/commands/link-agents/link-agents.js +5 -0
  142. package/commands/link-agents/link-agents_cmds/delete.js +38 -0
  143. package/commands/link-agents/link-agents_cmds/list.js +131 -0
  144. package/commands/link-agents/link-agents_cmds/terminate.js +31 -0
  145. package/commands/mobile-build-files/mobile-build-files.js +5 -0
  146. package/commands/mobile-build-files/mobile-build-files_cmds/delete.js +31 -0
  147. package/commands/mobile-build-files/mobile-build-files_cmds/download.js +50 -0
  148. package/commands/mobile-build-files/mobile-build-files_cmds/list.js +72 -0
  149. package/commands/mobile-build-files/mobile-build-files_cmds/upload.js +101 -0
  150. package/commands/plans/plans.js +5 -0
  151. package/commands/plans/plans_cmds/describe.js +23 -0
  152. package/commands/plans/plans_cmds/list.js +63 -0
  153. package/commands/test-runs/test-runs.js +5 -0
  154. package/commands/test-runs/test-runs_cmds/export.js +62 -0
  155. package/commands/tests/mobileEmulationUtil.js +46 -0
  156. package/commands/tests/tests.js +5 -0
  157. package/commands/tests/testsUtil.js +538 -0
  158. package/commands/tests/tests_cmds/create.js +130 -0
  159. package/commands/tests/tests_cmds/edit.js +111 -0
  160. package/commands/tests/tests_cmds/export.js +145 -0
  161. package/commands/tests/tests_cmds/import.js +5 -0
  162. package/commands/tests/tests_cmds/import_cmds/import_playwright.js +439 -0
  163. package/commands/tests/tests_cmds/import_cmds/import_selenium.js +295 -0
  164. package/commands/tests/tests_cmds/list.js +94 -0
  165. package/commands/tests/tests_cmds/run-cloud.js +314 -0
  166. package/commands/tests/tests_cmds/run-mobile.js +260 -0
  167. package/commands/tests/tests_cmds/run.js +314 -0
  168. package/commands/tests/tests_cmds/runUtils.js +60 -0
  169. package/commands/tests/tests_cmds/trainerUtil.js +12 -0
  170. package/commands/users/users.js +5 -0
  171. package/commands/users/users_cmds/list.js +58 -0
  172. package/commands/workspaces/workspace_cmds/copy.js +108 -0
  173. package/commands/workspaces/workspace_cmds/describe.js +21 -0
  174. package/commands/workspaces/workspace_cmds/list.js +67 -0
  175. package/commands/workspaces/workspaces.js +5 -0
  176. package/core/entityValidation/environmentsValidation.js +7 -0
  177. package/core/entityValidation/stepValidation.js +15 -0
  178. package/core/execution/ApiTestUtils.js +1060 -0
  179. package/core/execution/MailboxConstants.js +4 -0
  180. package/core/execution/PostmanUtils.js +53 -0
  181. package/core/execution/RunConfig.js +2 -0
  182. package/core/execution/TestResult.js +15 -0
  183. package/core/execution/VariableUtils.js +154 -0
  184. package/core/execution/VariablesSummary.js +2 -0
  185. package/core/execution/basic-types.js +2 -0
  186. package/core/execution/newman-types.js +42 -0
  187. package/core/messaging/actions/MobileTrainingActions.js +17 -0
  188. package/core/messaging/actions/pdfActions.js +27 -0
  189. package/core/messaging/actions/runnerActions.js +18 -0
  190. package/core/messaging/actions/trainingSessionActions.js +38 -0
  191. package/core/messaging/logLineMessaging.js +50 -0
  192. package/core/messaging/messaging.js +130 -0
  193. package/core/messaging/pageMessaging.js +9 -0
  194. package/core/trainer/openUtils.js +47 -0
  195. package/core/trainer/trainingSessions-types.js +35 -0
  196. package/core/trainer/trainingSessions.js +151 -0
  197. package/core/util.js +52 -0
  198. package/coreWebVitals/index.js +77 -0
  199. package/domUtil/index.js +1 -0
  200. package/env/defaultEnv.js +17 -0
  201. package/env/dev.js +17 -0
  202. package/env/env.js +76 -0
  203. package/env/local.js +17 -0
  204. package/env/prod.js +17 -0
  205. package/execution/index.js +8 -0
  206. package/execution/index.js.LICENSE.txt +254 -0
  207. package/execution/runAppiumServer.js +145 -0
  208. package/functions/apiTest/utils.js +47 -0
  209. package/functions/types.js +2 -0
  210. package/functions/utils.js +12 -0
  211. package/http/MablHttpAgent.js +73 -0
  212. package/http/RequestFilteringHttpAgent.js +119 -0
  213. package/http/RequestSecurityError.js +13 -0
  214. package/http/axiosProxyConfig.js +101 -0
  215. package/http/httpUtil.js +73 -0
  216. package/http/requestInterceptor.js +206 -0
  217. package/index.d.ts +241 -0
  218. package/index.js +14 -0
  219. package/mablApi/index.js +1 -0
  220. package/mablscript/MablAction.js +102 -0
  221. package/mablscript/MablStep.js +191 -0
  222. package/mablscript/MablStepV2.js +73 -0
  223. package/mablscript/MablSymbol.js +35 -0
  224. package/mablscript/actions/AwaitDownloadAction.js +14 -0
  225. package/mablscript/actions/AwaitPDFDownloadAction.js +19 -0
  226. package/mablscript/actions/ConditionAction.js +123 -0
  227. package/mablscript/actions/CountAction.js +16 -0
  228. package/mablscript/actions/ExtractAction.js +71 -0
  229. package/mablscript/actions/FindAction.js +301 -0
  230. package/mablscript/actions/GenerateEmailAddressAction.js +14 -0
  231. package/mablscript/actions/GenerateRandomStringAction.js +20 -0
  232. package/mablscript/actions/GetUrlAction.js +22 -0
  233. package/mablscript/actions/GetVariableValue.js +31 -0
  234. package/mablscript/actions/GetViewportAction.js +17 -0
  235. package/mablscript/actions/JavaScriptAction.js +219 -0
  236. package/mablscript/diffing/diffingUtil.js +229 -0
  237. package/mablscript/importer.js +576 -0
  238. package/mablscript/mobile/steps/CreateVariableMobileStep.js +53 -0
  239. package/mablscript/mobile/steps/EnterTextStep.js +45 -0
  240. package/mablscript/mobile/steps/HideKeyboardStep.js +20 -0
  241. package/mablscript/mobile/steps/InstallAppStep.js +22 -0
  242. package/mablscript/mobile/steps/NavigateBackStep.js +20 -0
  243. package/mablscript/mobile/steps/NavigateHomeStep.js +21 -0
  244. package/mablscript/mobile/steps/OpenAppStep.js +22 -0
  245. package/mablscript/mobile/steps/OpenLinkStep.js +19 -0
  246. package/mablscript/mobile/steps/PrepareSessionStep.js +19 -0
  247. package/mablscript/mobile/steps/PushFileStep.js +27 -0
  248. package/mablscript/mobile/steps/ScrollStep.js +87 -0
  249. package/mablscript/mobile/steps/SetOrientationStep.js +20 -0
  250. package/mablscript/mobile/steps/TapStep.js +37 -0
  251. package/mablscript/mobile/steps/UninstallAppStep.js +22 -0
  252. package/mablscript/mobile/steps/actions/MobileFindAction.js +23 -0
  253. package/mablscript/mobile/steps/stepUtil.js +113 -0
  254. package/mablscript/mobile/tests/StepTestsUtil.js +20 -0
  255. package/mablscript/mobile/tests/TestMobileFindDescriptors.js +282 -0
  256. package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +298 -0
  257. package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +79 -0
  258. package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +304 -0
  259. package/mablscript/mobile/tests/steps/HideKeyboardStep.mobiletest.js +27 -0
  260. package/mablscript/mobile/tests/steps/InstallAppStep.mobiletest.js +20 -0
  261. package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +27 -0
  262. package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +27 -0
  263. package/mablscript/mobile/tests/steps/OpenLinkStep.mobiletest.js +20 -0
  264. package/mablscript/mobile/tests/steps/PushFileStep.mobiletest.js +55 -0
  265. package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +386 -0
  266. package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +32 -0
  267. package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +57 -0
  268. package/mablscript/mobile/tests/steps/UninstallAppStep.mobiletest.js +20 -0
  269. package/mablscript/steps/AbstractAssertionsAndVariablesStep.js +52 -0
  270. package/mablscript/steps/AccessibilityCheck.js +108 -0
  271. package/mablscript/steps/ActionsUtils.js +18 -0
  272. package/mablscript/steps/AssertStep.js +318 -0
  273. package/mablscript/steps/AssertStepOld.js +159 -0
  274. package/mablscript/steps/AwaitTabStep.js +69 -0
  275. package/mablscript/steps/AwaitUploadsStep.js +26 -0
  276. package/mablscript/steps/ClearCookiesStep.js +26 -0
  277. package/mablscript/steps/ClickAndHoldStep.js +76 -0
  278. package/mablscript/steps/ClickStep.js +58 -0
  279. package/mablscript/steps/CookieUtils.js +54 -0
  280. package/mablscript/steps/CreateVariableStep.js +236 -0
  281. package/mablscript/steps/DatabaseQueryStep.js +28 -0
  282. package/mablscript/steps/DoubleClickStep.js +64 -0
  283. package/mablscript/steps/DownloadStep.js +96 -0
  284. package/mablscript/steps/EchoStep.js +34 -0
  285. package/mablscript/steps/ElseIfConditionStep.js +32 -0
  286. package/mablscript/steps/ElseStep.js +27 -0
  287. package/mablscript/steps/EndStep.js +27 -0
  288. package/mablscript/steps/EnterAuthCodeStep.js +59 -0
  289. package/mablscript/steps/EnterTextStep.js +96 -0
  290. package/mablscript/steps/EvaluateFlowStep.js +51 -0
  291. package/mablscript/steps/EvaluateJavaScriptStep.js +50 -0
  292. package/mablscript/steps/HoverStep.js +63 -0
  293. package/mablscript/steps/IfConditionStep.js +191 -0
  294. package/mablscript/steps/NavigateStep.js +30 -0
  295. package/mablscript/steps/OpenEmailStep.js +46 -0
  296. package/mablscript/steps/ReleaseStep.js +76 -0
  297. package/mablscript/steps/RemoveCookieStep.js +36 -0
  298. package/mablscript/steps/RightClickStep.js +58 -0
  299. package/mablscript/steps/SelectStep.js +82 -0
  300. package/mablscript/steps/SendHttpRequestStep.js +48 -0
  301. package/mablscript/steps/SendKeyStep.js +84 -0
  302. package/mablscript/steps/SetCookieStep.js +70 -0
  303. package/mablscript/steps/SetFilesStep.js +71 -0
  304. package/mablscript/steps/SetViewportStep.js +38 -0
  305. package/mablscript/steps/SwitchContextStep.js +122 -0
  306. package/mablscript/steps/SyntheticStep.js +20 -0
  307. package/mablscript/steps/VisitUrlStep.js +68 -0
  308. package/mablscript/steps/WaitStep.js +37 -0
  309. package/mablscript/steps/WaitUntilStep.js +46 -0
  310. package/mablscript/types/AccessibilityCheckStepDescriptor.js +2 -0
  311. package/mablscript/types/AccessibilityCheckTypes.js +9 -0
  312. package/mablscript/types/AssertionsAndVariablesStepDescriptor.js +2 -0
  313. package/mablscript/types/AwaitTabDescriptor.js +2 -0
  314. package/mablscript/types/AwaitUploadStepDescriptor.js +2 -0
  315. package/mablscript/types/ClearCookiesStepDescriptor.js +2 -0
  316. package/mablscript/types/ClickAndHoldStepDescriptor.js +2 -0
  317. package/mablscript/types/ClickStepDescriptor.js +2 -0
  318. package/mablscript/types/ConditionDescriptor.js +133 -0
  319. package/mablscript/types/CountDescriptor.js +2 -0
  320. package/mablscript/types/CreateVariableStepDescriptor.js +12 -0
  321. package/mablscript/types/DownloadStepDescriptor.js +2 -0
  322. package/mablscript/types/EchoStepDescriptor.js +2 -0
  323. package/mablscript/types/EnterTextStepDescriptor.js +2 -0
  324. package/mablscript/types/EvaluateFlowStepDescriptor.js +2 -0
  325. package/mablscript/types/EvaluateJavaScriptStepDescriptor.js +2 -0
  326. package/mablscript/types/ExtractDescriptor.js +21 -0
  327. package/mablscript/types/GetCurrentLocationDescriptor.js +12 -0
  328. package/mablscript/types/GetVariableDescriptor.js +16 -0
  329. package/mablscript/types/GetViewportDescriptor.js +12 -0
  330. package/mablscript/types/HoverStepDescriptor.js +2 -0
  331. package/mablscript/types/NavigateStepDescriptor.js +7 -0
  332. package/mablscript/types/OpenEmailStepDescriptor.js +2 -0
  333. package/mablscript/types/OperatingSystemDescriptor.js +45 -0
  334. package/mablscript/types/ReleaseStepDescriptor.js +7 -0
  335. package/mablscript/types/RemoveCookieStepDescriptor.js +2 -0
  336. package/mablscript/types/SelectStepDescriptor.js +2 -0
  337. package/mablscript/types/SendHttpRequestTypes.js +2 -0
  338. package/mablscript/types/SendKeyStepDescriptor.js +30 -0
  339. package/mablscript/types/SetCookieStepDescriptor.js +2 -0
  340. package/mablscript/types/SetFilesStepDescriptor.js +2 -0
  341. package/mablscript/types/SetViewportStepDescriptor.js +2 -0
  342. package/mablscript/types/SnippetsDescriptor.js +36 -0
  343. package/mablscript/types/StepDescriptor.js +2 -0
  344. package/mablscript/types/SwitchContextStepDescriptor.js +15 -0
  345. package/mablscript/types/VariableNamespace.js +17 -0
  346. package/mablscript/types/VisitUrlStepDescriptor.js +2 -0
  347. package/mablscript/types/WaitStepDescriptor.js +2 -0
  348. package/mablscript/types/WaitUntilStepDescriptor.js +2 -0
  349. package/mablscript/types/mobile/CreateVariableMobileStepDescriptor.js +9 -0
  350. package/mablscript/types/mobile/EnterTextStepDescriptor.js +2 -0
  351. package/mablscript/types/mobile/HideKeyboardStepDescriptor.js +2 -0
  352. package/mablscript/types/mobile/InstallAppStepDescriptor.js +2 -0
  353. package/mablscript/types/mobile/NavigateBackStepDescriptor.js +2 -0
  354. package/mablscript/types/mobile/NavigateHomeStepDescriptor.js +2 -0
  355. package/mablscript/types/mobile/OpenAppStepDescriptor.js +2 -0
  356. package/mablscript/types/mobile/OpenLinkStepDescriptor.js +2 -0
  357. package/mablscript/types/mobile/PrepareSessionStepDescriptor.js +2 -0
  358. package/mablscript/types/mobile/PushFileDescriptor.js +2 -0
  359. package/mablscript/types/mobile/ScrollStepDescriptor.js +32 -0
  360. package/mablscript/types/mobile/SetOrientationStepDescriptor.js +8 -0
  361. package/mablscript/types/mobile/StepWithMobileFindDescriptor.js +8 -0
  362. package/mablscript/types/mobile/TapStepDescriptor.js +8 -0
  363. package/mablscript/types/mobile/UninstallAppStepDescriptor.js +2 -0
  364. package/mablscriptFind/index.js +2 -0
  365. package/mablscriptFind/index.js.LICENSE.txt +25 -0
  366. package/middleware.js +42 -0
  367. package/mobile/index.js +2 -0
  368. package/mobile/types.js +8 -0
  369. package/observers/ObserverBase.js +11 -0
  370. package/observers/mockObserver.js +47 -0
  371. package/package.json +107 -0
  372. package/popupDismissal/candidate.js +2 -0
  373. package/popupDismissal/index.js +255 -0
  374. package/providers/authenticationProvider.js +254 -0
  375. package/providers/cliConfigProvider.js +271 -0
  376. package/providers/exportRequestProvider.js +196 -0
  377. package/providers/logging/loggingProvider.js +90 -0
  378. package/providers/scmContextInterfaces.js +14 -0
  379. package/providers/scmContextProvider.js +335 -0
  380. package/providers/scmContextProviderV2.js +122 -0
  381. package/providers/types.js +9 -0
  382. package/proxy/index.js +2 -0
  383. package/proxy/index.js.LICENSE.txt +12 -0
  384. package/proxy/lib/xpath.js +1 -0
  385. package/reporters/__tests__/resources/sampleData.js +162 -0
  386. package/reporters/mochAwesome/interfaces.js +2 -0
  387. package/reporters/mochAwesome/mochAwesomeReporter.js +227 -0
  388. package/reporters/reporter.js +46 -0
  389. package/resources/actionabilityCheck.js +160 -0
  390. package/resources/coreWebVitals.js +1 -0
  391. package/resources/mablFind.js +2 -0
  392. package/resources/media/mabl_test_audio.wav +0 -0
  393. package/resources/media/mabl_test_pattern.y4m +3 -0
  394. package/resources/pdf-viewer/EmbeddedPdfHandler.js +1 -0
  395. package/resources/pdf-viewer/embeddedPdfDetection.js +225 -0
  396. package/resources/pdf-viewer/index.html +1 -0
  397. package/resources/pdf-viewer/index.js +2 -0
  398. package/resources/pdf-viewer/libEmbeddedPdfHandler.js +279 -0
  399. package/resources/pdf-viewer/libmablPdfViewer.js +21909 -0
  400. package/resources/pdf-viewer/mabl_attention_move.gif +0 -0
  401. package/resources/pdf-viewer/mabl_error_artwork_Unplugged.gif +0 -0
  402. package/resources/pdf-viewer/pdf.worker.9251738a897f697389be.js +2 -0
  403. package/resources/pdf-viewer/pdf.worker.9e2021092643447a5b9f.js +81 -0
  404. package/resources/popupDismissal.js +1 -0
  405. package/resources/webdriver.js +19 -0
  406. package/socketTunnel/index.js +2 -0
  407. package/socketTunnel/index.js.LICENSE.txt +68 -0
  408. package/upload/index.js +2 -0
  409. package/upload/index.js.LICENSE.txt +27 -0
  410. package/util/CloudStorageWriter.js +45 -0
  411. package/util/FileCache.js +180 -0
  412. package/util/IdentifierUtil.js +57 -0
  413. package/util/InternalMetricsTrackingSingleton.js +36 -0
  414. package/util/Lazy.js +90 -0
  415. package/util/MobileAppFileCache.js +103 -0
  416. package/util/RichPromise.js +53 -0
  417. package/util/TestOutputWriter.js +104 -0
  418. package/util/actionabilityUtil.js +165 -0
  419. package/util/analytics-events.js +14 -0
  420. package/util/analytics.js +176 -0
  421. package/util/asyncUtil.js +61 -0
  422. package/util/browserTestUtils.js +17 -0
  423. package/util/clickUtil.js +68 -0
  424. package/util/downloadUtil.js +87 -0
  425. package/util/encodingUtil.js +50 -0
  426. package/util/fileUploadUtil.js +146 -0
  427. package/util/javaScriptStepMigration.js +115 -0
  428. package/util/jestUtil.js +21 -0
  429. package/util/logUtils.js +131 -0
  430. package/util/markdownUtil.js +125 -0
  431. package/util/postInstallMessage.js +14 -0
  432. package/util/pureUtil.js +175 -0
  433. package/util/resourceUtil.js +90 -0
  434. package/util/timeUtil.js +31 -0
  435. package/utilities.js +7 -0
  436. package/webdriver/index.js +44 -0
@@ -0,0 +1,377 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.PlaywrightPage = void 0;
30
+ const events_1 = __importDefault(require("events"));
31
+ const promises_1 = require("fs/promises");
32
+ const browserLauncher_1 = require("../browserLauncher");
33
+ const playwright = __importStar(require("playwright"));
34
+ const playwrightHttpResponse_1 = require("./playwrightHttpResponse");
35
+ const playwrightHttpRequest_1 = require("./playwrightHttpRequest");
36
+ const playwrightFrame_1 = require("./playwrightFrame");
37
+ const playwrightDom_1 = require("./playwrightDom");
38
+ const utils_1 = require("../utils");
39
+ const wrappers_1 = require("./wrappers");
40
+ const logUtils_1 = require("../../util/logUtils");
41
+ const uuid = __importStar(require("uuid"));
42
+ const path = require("path");
43
+ class PlaywrightPage extends events_1.default {
44
+ constructor(page, browser, delegate) {
45
+ var _a;
46
+ super();
47
+ this.page = page;
48
+ this.browser = browser;
49
+ this.delegate = delegate;
50
+ this.playwrightFrames = new Map();
51
+ this.requestListeners = [];
52
+ const guid = page._guid;
53
+ this.pageId = (_a = delegate.getTargetId()) !== null && _a !== void 0 ? _a : guid;
54
+ page.off('dialog', this.acceptDialogs);
55
+ page.on('dialog', this.acceptDialogs);
56
+ page.on('close', () => {
57
+ this.browser.onPageClose(this);
58
+ });
59
+ page.on('download', async (download) => {
60
+ var _a, _b;
61
+ const guid = uuid.v4();
62
+ const downloadSize = (_b = (_a = (await download.createReadStream())) === null || _a === void 0 ? void 0 : _a.readableLength) !== null && _b !== void 0 ? _b : 0;
63
+ browser.emit(browserLauncher_1.BrowserEvent.DownloadWillBegin, {
64
+ guid,
65
+ suggestedFilename: download.suggestedFilename(),
66
+ url: download.url(),
67
+ });
68
+ browser.emit(browserLauncher_1.BrowserEvent.DownloadProgress, {
69
+ guid,
70
+ totalBytes: downloadSize,
71
+ receivedBytes: downloadSize,
72
+ state: 'completed',
73
+ });
74
+ if (this.browser.browserDelegate.downloadsUsingGuids()) {
75
+ await download.saveAs(path.join(this.browser.getDownloadDirectory(), download.suggestedFilename()));
76
+ }
77
+ });
78
+ }
79
+ addRequestListener(listener) {
80
+ if (this.requestListeners.length === 0) {
81
+ void this.page.route('**/*', async (route) => {
82
+ const listeners = this.requestListeners;
83
+ if (listeners.length === 0) {
84
+ void route.continue();
85
+ return;
86
+ }
87
+ const request = new playwrightHttpRequest_1.PlaywrightHttpRequest(this, route.request(), route);
88
+ for (const listener of listeners) {
89
+ await listener(request);
90
+ if (request.wasIntercepted()) {
91
+ return;
92
+ }
93
+ }
94
+ await route.continue();
95
+ });
96
+ }
97
+ this.requestListeners.push(listener);
98
+ }
99
+ createCDPSession() {
100
+ return this.delegate.createCDPSession();
101
+ }
102
+ async waitForInitialization() {
103
+ await this.delegate.waitForInitialization();
104
+ this.openerPage = await (0, utils_1.mapIfNotNull)(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
105
+ if (this.browser.disableFocusEmulation) {
106
+ await this.delegate.setFocusEmulationEnabled(false);
107
+ }
108
+ }
109
+ on(event, listener) {
110
+ this.wireEvents(event);
111
+ super.on(event, listener);
112
+ return this;
113
+ }
114
+ once(event, listener) {
115
+ this.wireEvents(event);
116
+ super.once(event, listener);
117
+ return this;
118
+ }
119
+ wireEvents(event) {
120
+ try {
121
+ if (event === browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo &&
122
+ !this.listenerCount(event)) {
123
+ this.getCDPSession().on('Network.requestWillBeSentExtraInfo', (event) => {
124
+ this.emit(browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo, event);
125
+ });
126
+ }
127
+ if (event === browserLauncher_1.PageEvent.Response && !this.listenerCount(event)) {
128
+ this.page.on('response', (event) => {
129
+ this.emit(browserLauncher_1.PageEvent.Response, new playwrightHttpResponse_1.PlaywrightHttpResponse(this, event));
130
+ });
131
+ }
132
+ if (event === browserLauncher_1.PageEvent.FrameNavigated && !this.listenerCount(event)) {
133
+ this.page.on('framenavigated', (frame) => {
134
+ this.emit(browserLauncher_1.PageEvent.FrameNavigated, this.getOrCreateFrame(frame));
135
+ });
136
+ }
137
+ if (event === browserLauncher_1.PageEvent.FrameAttached && !this.listenerCount(event)) {
138
+ this.page.on('frameattached', (frame) => {
139
+ this.emit(browserLauncher_1.PageEvent.FrameAttached, this.getOrCreateFrame(frame));
140
+ });
141
+ }
142
+ if (event === browserLauncher_1.PageEvent.Console && !this.listenerCount(event)) {
143
+ this.page.on('console', (console) => {
144
+ this.emit(browserLauncher_1.PageEvent.Console, new wrappers_1.PlaywrightWrappedConsoleMessage(console, this));
145
+ });
146
+ }
147
+ if (event === browserLauncher_1.PageEvent.PageError && !this.listenerCount(event)) {
148
+ this.page.on('pageerror', (error) => {
149
+ this.emit(browserLauncher_1.PageEvent.PageError, error);
150
+ });
151
+ }
152
+ if (event === browserLauncher_1.PageEvent.Error && !this.listenerCount(event)) {
153
+ this.page.on('crash', (error) => {
154
+ this.emit(browserLauncher_1.PageEvent.Error, error);
155
+ });
156
+ }
157
+ if (event === browserLauncher_1.PageEvent.TracingBufferUsage &&
158
+ !this.listenerCount(event)) {
159
+ this.getCDPSession().on('Tracing.bufferUsage', (tracing) => {
160
+ this.emit(browserLauncher_1.PageEvent.TracingBufferUsage, tracing);
161
+ });
162
+ }
163
+ if (event === browserLauncher_1.PageEvent.TracingDataCollected &&
164
+ !this.listenerCount(event)) {
165
+ this.getCDPSession().on('Tracing.dataCollected', (data) => {
166
+ this.emit(browserLauncher_1.PageEvent.TracingDataCollected, data);
167
+ });
168
+ }
169
+ if (event === browserLauncher_1.PageEvent.TracingComplete && !this.listenerCount(event)) {
170
+ this.getCDPSession().on('Tracing.tracingComplete', (tracingComplete) => {
171
+ this.emit(browserLauncher_1.PageEvent.TracingComplete, tracingComplete);
172
+ });
173
+ }
174
+ }
175
+ catch (error) {
176
+ (0, logUtils_1.logInternal)(`Unable to register event ${event.toString()}. Error: ${error}`);
177
+ }
178
+ }
179
+ async screenshot(options) {
180
+ return this.page.screenshot(options);
181
+ }
182
+ sendCharacter(key) {
183
+ return this.page.keyboard.insertText(key);
184
+ }
185
+ getPageId() {
186
+ return this.pageId;
187
+ }
188
+ getPageImpl() {
189
+ if (this.pageImpl === undefined) {
190
+ try {
191
+ return playwright._toImpl(this.page);
192
+ }
193
+ catch (e) {
194
+ }
195
+ }
196
+ return this.pageImpl;
197
+ }
198
+ viewport() {
199
+ return this.page.viewportSize() || undefined;
200
+ }
201
+ exposeFunction(name, playwrightFunction) {
202
+ return this.page.exposeFunction(name, playwrightFunction);
203
+ }
204
+ close() {
205
+ return this.page.close();
206
+ }
207
+ url() {
208
+ return this.page.url();
209
+ }
210
+ evaluate(pageFunction, arg, secondaryWorld = false) {
211
+ return this.mainFrame().evaluate(pageFunction, arg, secondaryWorld);
212
+ }
213
+ $(selector) {
214
+ return this.mainFrame().$(selector);
215
+ }
216
+ $$(selector) {
217
+ return this.mainFrame().$$(selector);
218
+ }
219
+ async $$eval(selector, pageFunction, arg) {
220
+ const result = await this.page.$$eval(selector, pageFunction, playwrightDom_1.PlaywrightJsHandle.unwrapProperties(arg));
221
+ return result;
222
+ }
223
+ async $eval(selector, pageFunction, arg) {
224
+ const result = await this.page.$eval(selector, pageFunction, playwrightDom_1.PlaywrightJsHandle.unwrapProperties(arg));
225
+ return result;
226
+ }
227
+ async $x(xpathQuery) {
228
+ return (await this.page.$$(`xpath=${xpathQuery}`)).map((element) => new playwrightDom_1.PlaywrightElementHandle(element, this, this.delegate.createElementHandleDelegate(element)));
229
+ }
230
+ authenticate(_credentials) {
231
+ throw new Error('PlaywrightPage.authenticate not implemented');
232
+ }
233
+ bringToFront() {
234
+ return this.page.bringToFront();
235
+ }
236
+ cookies() {
237
+ return this.page.context().cookies(this.page.url());
238
+ }
239
+ async deleteCookie(...cookies) {
240
+ const finalCookies = (await this.cookies()).filter((cookie) => !cookies.find((c) => c.name === cookie.name && c.domain === cookie.domain));
241
+ await this.page.context().clearCookies();
242
+ await this.page.context().addCookies(finalCookies);
243
+ }
244
+ async evaluateCodeInSecondaryWorld(code, arg) {
245
+ return (await this.evaluate(code, arg, true));
246
+ }
247
+ async evaluateHandleInSecondaryWorld(code, arg) {
248
+ return new playwrightDom_1.PlaywrightJsHandle(await this.page.evaluateHandle(code, playwrightDom_1.PlaywrightJsHandle.unwrapProperties(arg, true)), this);
249
+ }
250
+ frames() {
251
+ return this.page.frames().map((frame) => this.getOrCreateFrame(frame));
252
+ }
253
+ getBrowserBounds() {
254
+ return this.delegate.getBrowserBounds();
255
+ }
256
+ async goto(url, options) {
257
+ return this.mainFrame().goto(url, options);
258
+ }
259
+ isClosed() {
260
+ return this.page.isClosed();
261
+ }
262
+ keyDown(key) {
263
+ return this.page.keyboard.down(key);
264
+ }
265
+ keyUp(key) {
266
+ return this.page.keyboard.up(key);
267
+ }
268
+ mainFrame() {
269
+ return this.getOrCreateFrame(this.page.mainFrame());
270
+ }
271
+ mouseDown() {
272
+ return this.page.mouse.down();
273
+ }
274
+ mouseMove(x, y, options) {
275
+ return this.page.mouse.move(x, y, options);
276
+ }
277
+ mouseUp() {
278
+ return this.page.mouse.up();
279
+ }
280
+ press(key) {
281
+ return this.page.keyboard.press(key);
282
+ }
283
+ async reload(options) {
284
+ try {
285
+ return (0, utils_1.mapIfNotNull)(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
286
+ }
287
+ catch (e) {
288
+ if (e instanceof playwright.errors.TimeoutError) {
289
+ throw new browserLauncher_1.RUNNER_ERRORS.TimeoutError(e.message);
290
+ }
291
+ throw new browserLauncher_1.RunnerError(e.message);
292
+ }
293
+ }
294
+ async resizeViewport() {
295
+ await this.delegate.resizeViewport();
296
+ }
297
+ async setCookie(...cookies) {
298
+ const pageUrl = this.url();
299
+ const startsWithHTTP = pageUrl.startsWith('http');
300
+ await this.page.context().addCookies(cookies.map((cookie) => {
301
+ const item = { ...cookie };
302
+ if (!item.url && !(item.domain || item.path) && startsWithHTTP) {
303
+ item.url = pageUrl;
304
+ }
305
+ return item;
306
+ }));
307
+ }
308
+ async setViewport(viewport) {
309
+ try {
310
+ this.browser.maybeSetDefaultViewportSize(viewport);
311
+ await this.page.setViewportSize(viewport);
312
+ await this.delegate.setBrowserBounds(viewport.width, viewport.height);
313
+ }
314
+ catch (error) {
315
+ (0, logUtils_1.logInternal)(`Set Browser Bounds during setViewport step failed: ${error}`);
316
+ }
317
+ }
318
+ async emulateDevice(deviceDescriptor) {
319
+ return this.setViewport({
320
+ width: deviceDescriptor.width,
321
+ height: deviceDescriptor.height,
322
+ });
323
+ }
324
+ title() {
325
+ return this.page.title();
326
+ }
327
+ async waitForLoadState(options) {
328
+ try {
329
+ await this.page.waitForLoadState(options === null || options === void 0 ? void 0 : options.waitUntil, {
330
+ timeout: options.timeout,
331
+ });
332
+ }
333
+ catch (e) {
334
+ if (e instanceof playwright.errors.TimeoutError) {
335
+ throw new browserLauncher_1.RUNNER_ERRORS.TimeoutError(e.message);
336
+ }
337
+ throw new browserLauncher_1.RunnerError(e.message);
338
+ }
339
+ }
340
+ async waitForSelector(selector, options) {
341
+ return (0, utils_1.mapIfNotNull)(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this, this.delegate.createElementHandleDelegate(handle)));
342
+ }
343
+ async acceptDialogs(dialog) {
344
+ await dialog.accept();
345
+ }
346
+ opener() {
347
+ return this.openerPage;
348
+ }
349
+ setExtraHTTPHeaders(_headers) {
350
+ throw new Error('PlaywrightPage.setExtraHTTPHeaders not implemented');
351
+ }
352
+ makeCDPCall(method, paramArgs) {
353
+ return this.delegate.makeCDPCall(method, paramArgs);
354
+ }
355
+ getCDPSession() {
356
+ return this.delegate.getCDPSession();
357
+ }
358
+ getOrCreateFrame(frame) {
359
+ const frameId = frame._guid;
360
+ if (!this.playwrightFrames.has(frameId)) {
361
+ const newFrame = new playwrightFrame_1.PlaywrightFrame(frame, this, this.delegate.createFrameDelegate(frame));
362
+ this.playwrightFrames.set(frameId, newFrame);
363
+ }
364
+ return this.playwrightFrames.get(frameId);
365
+ }
366
+ async getContentAsMhtml() {
367
+ return this.delegate.getContentAsMhtml();
368
+ }
369
+ async download(url, destination, encoding = 'binary') {
370
+ const response = await this.page.request.fetch(url);
371
+ const body = await response.body();
372
+ if (body) {
373
+ await (0, promises_1.writeFile)(destination, body, { encoding });
374
+ }
375
+ }
376
+ }
377
+ exports.PlaywrightPage = PlaywrightPage;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimplePlaywrightLogger = void 0;
4
+ class SimplePlaywrightLogger {
5
+ constructor(logger, severityAllowList) {
6
+ this.logger = logger;
7
+ this.severityAllowList = severityAllowList;
8
+ }
9
+ static createWarningLogger(logger) {
10
+ return new SimplePlaywrightLogger(logger, new Set(['error', 'warning']));
11
+ }
12
+ isEnabled(_name, severity) {
13
+ return this.severityAllowList.has(severity);
14
+ }
15
+ log(name, severity, message, args, _hints) {
16
+ const msg = `[Playwright:${name}:${severity}] ${message} ${args}`;
17
+ switch (severity) {
18
+ case 'error':
19
+ this.logger.error(msg);
20
+ break;
21
+ case 'warning':
22
+ this.logger.warn(msg);
23
+ break;
24
+ case 'info':
25
+ this.logger.info(msg);
26
+ break;
27
+ case 'verbose':
28
+ this.logger.verbose(msg);
29
+ break;
30
+ default:
31
+ this.logger.info(msg);
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ exports.SimplePlaywrightLogger = SimplePlaywrightLogger;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.WebkitBrowserDelegate = void 0;
27
+ const playwright = __importStar(require("playwright"));
28
+ const webkitPageDelegate_1 = require("./webkitPageDelegate");
29
+ const nonChromiumAbstractBrowserDelegate_1 = require("../nonChromium/nonChromiumAbstractBrowserDelegate");
30
+ class WebkitBrowserDelegate extends nonChromiumAbstractBrowserDelegate_1.NonChromiumAbstractBrowserDelegate {
31
+ constructor(context) {
32
+ super();
33
+ this.context = context;
34
+ const contextImpl = playwright._toImpl(context);
35
+ this._browser = contextImpl._browser;
36
+ }
37
+ getBrowser() {
38
+ return this._browser;
39
+ }
40
+ createPageDelegate(page) {
41
+ return new webkitPageDelegate_1.WebkitPageDelegate(page);
42
+ }
43
+ getCDPSession() {
44
+ return this._browser._connection.browserSession;
45
+ }
46
+ supportsExposeFunction() {
47
+ return false;
48
+ }
49
+ }
50
+ exports.WebkitBrowserDelegate = WebkitBrowserDelegate;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebkitElementHandleDelegate = void 0;
4
+ const nonChromiumAbstractElementHandleDelegate_1 = require("../nonChromium/nonChromiumAbstractElementHandleDelegate");
5
+ class WebkitElementHandleDelegate extends nonChromiumAbstractElementHandleDelegate_1.NonChromiumAbstractElementHandleDelegate {
6
+ async focusAndSelect(element) {
7
+ const frame = await element.frame();
8
+ return frame.evaluate((element) => {
9
+ var _a;
10
+ element.focus();
11
+ (_a = element.select) === null || _a === void 0 ? void 0 : _a.call(element);
12
+ return element.value;
13
+ }, element);
14
+ }
15
+ }
16
+ exports.WebkitElementHandleDelegate = WebkitElementHandleDelegate;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebkitFrameDelegate = void 0;
4
+ const types_1 = require("../../types");
5
+ const nonChromiumAbstractFrameDelegate_1 = require("../nonChromium/nonChromiumAbstractFrameDelegate");
6
+ class WebkitFrameDelegate extends nonChromiumAbstractFrameDelegate_1.NonChromiumAbstractFrameDelegate {
7
+ addBindingToSecondaryWorld(_binding) {
8
+ return Promise.resolve();
9
+ }
10
+ getLifecycleEventStrategy(value) {
11
+ let waitUntil = value !== null && value !== void 0 ? value : types_1.LifecycleEvent.Load;
12
+ const waitForNetworkIdle = waitUntil !== types_1.LifecycleEvent.DomContentLoaded;
13
+ if (waitForNetworkIdle) {
14
+ waitUntil = types_1.LifecycleEvent.DomContentLoaded;
15
+ }
16
+ return { waitUntil, waitForNetworkIdle };
17
+ }
18
+ }
19
+ exports.WebkitFrameDelegate = WebkitFrameDelegate;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebkitPageDelegate = void 0;
4
+ const webkitElementHandleDelegate_1 = require("./webkitElementHandleDelegate");
5
+ const webkitFrameDelegate_1 = require("./webkitFrameDelegate");
6
+ const nonChromiumAbstractPageDelegate_1 = require("../nonChromium/nonChromiumAbstractPageDelegate");
7
+ class WebkitPageDelegate extends nonChromiumAbstractPageDelegate_1.NonChromiumAbstractPageDelegate {
8
+ createElementHandleDelegate(element) {
9
+ return new webkitElementHandleDelegate_1.WebkitElementHandleDelegate(element);
10
+ }
11
+ createFrameDelegate(frame) {
12
+ return new webkitFrameDelegate_1.WebkitFrameDelegate(this, frame);
13
+ }
14
+ }
15
+ exports.WebkitPageDelegate = WebkitPageDelegate;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlaywrightWrappedConsoleMessage = void 0;
4
+ const playwrightDom_1 = require("./playwrightDom");
5
+ class PlaywrightWrappedConsoleMessage {
6
+ constructor(message, page) {
7
+ this.message = message;
8
+ this.page = page;
9
+ }
10
+ text() {
11
+ return this.message.text();
12
+ }
13
+ args() {
14
+ return this.message
15
+ .args()
16
+ .map((handle) => new playwrightDom_1.PlaywrightJsHandle(handle, this.page));
17
+ }
18
+ type() {
19
+ return this.message.type();
20
+ }
21
+ stackTrace() {
22
+ return [this.message.location()];
23
+ }
24
+ }
25
+ exports.PlaywrightWrappedConsoleMessage = PlaywrightWrappedConsoleMessage;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WaitForOptions = exports.LifecycleEvent = exports.RunnerType = exports.DefaultApiRequestSettings = exports.DefaultTimeouts = void 0;
4
+ class DefaultTimeouts {
5
+ }
6
+ exports.DefaultTimeouts = DefaultTimeouts;
7
+ DefaultTimeouts.defaultTrialTimeoutMs = 5000;
8
+ DefaultTimeouts.defaultWaitTimeoutMs = 5000;
9
+ DefaultTimeouts.defaultActionTimeoutMs = 0;
10
+ class DefaultApiRequestSettings {
11
+ }
12
+ exports.DefaultApiRequestSettings = DefaultApiRequestSettings;
13
+ DefaultApiRequestSettings.defaultApiRequestTimeout = 2 * 60 * 1000;
14
+ DefaultApiRequestSettings.defaultMaxRedirects = 5;
15
+ DefaultApiRequestSettings.verifyUrlBatchSize = 20;
16
+ var RunnerType;
17
+ (function (RunnerType) {
18
+ RunnerType["Playwright"] = "playwright";
19
+ })(RunnerType || (exports.RunnerType = RunnerType = {}));
20
+ var LifecycleEvent;
21
+ (function (LifecycleEvent) {
22
+ LifecycleEvent["DomContentLoaded"] = "domcontentloaded";
23
+ LifecycleEvent["Load"] = "load";
24
+ LifecycleEvent["NetworkIdle"] = "networkidle";
25
+ })(LifecycleEvent || (exports.LifecycleEvent = LifecycleEvent = {}));
26
+ class WaitForOptions {
27
+ }
28
+ exports.WaitForOptions = WaitForOptions;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapIfNotNull = void 0;
4
+ function mapIfNotNull(value, callIfNotNull) {
5
+ return value === null || value === undefined
6
+ ? undefined
7
+ : callIfNotNull(value);
8
+ }
9
+ exports.mapIfNotNull = mapIfNotNull;
package/cli.js ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __importDefault = (this && this.__importDefault) || function (mod) {
27
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ const yargs = __importStar(require("yargs"));
31
+ const env_1 = require("./env/env");
32
+ const constants_1 = require("./commands/constants");
33
+ const middleware_1 = require("./middleware");
34
+ const path_1 = __importDefault(require("path"));
35
+ const fs_1 = __importDefault(require("fs"));
36
+ require('yargonaut').style('cyan').helpStyle('magenta').errorsStyle('red');
37
+ const hasInternalDirectory = fs_1.default.existsSync(path_1.default.resolve(__dirname, 'commands', 'internal', 'internal_cmds'));
38
+ const excludeInternal = !hasInternalDirectory ? { exclude: /.*/gm } : undefined;
39
+ yargs
40
+ .scriptName(env_1.SCRIPT_NAME)
41
+ .commandDir('./commands/applications')
42
+ .commandDir('./commands/auth')
43
+ .commandDir('./commands/branches')
44
+ .commandDir('./commands/config')
45
+ .commandDir('./commands/credentials')
46
+ .commandDir('./commands/datatables')
47
+ .commandDir('./commands/deploy')
48
+ .commandDir('./commands/environments')
49
+ .commandDir('./commands/flows')
50
+ .commandDir('./commands/internal', excludeInternal)
51
+ .commandDir('./commands/link-agents')
52
+ .commandDir('./commands/mobile-build-files')
53
+ .commandDir('./commands/plans')
54
+ .commandDir('./commands/tests')
55
+ .commandDir('./commands/test-runs')
56
+ .commandDir('./commands/users')
57
+ .commandDir('./commands/workspaces')
58
+ .demandCommand(1, '')
59
+ .recommendCommands()
60
+ .strict()
61
+ .help(constants_1.CommandArgHelp)
62
+ .alias(constants_1.CommandArgHelp, constants_1.CommandArgAliases.ShowHelp)
63
+ .alias(constants_1.CommandArgVersion, constants_1.CommandArgAliases.Version)
64
+ .wrap(null)
65
+ .epilogue('Read full docs @ https://help.mabl.com/docs/mabl-cli')
66
+ .middleware(middleware_1.CLI_MIDDLEWARE).argv;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.command = 'applications <command>';
4
+ exports.describe = 'Manage your applications';
5
+ exports.builder = (yargs) => yargs.commandDir('applications_cmds').demandCommand();
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
4
+ const describe_1 = require("../../commandUtil/describe");
5
+ const util_1 = require("../../commandUtil/util");
6
+ exports.command = 'describe <id>';
7
+ exports.describe = (0, util_1.getDescribeDescriptions)('application');
8
+ exports.builder = (0, describe_1.getDescribeBuilderOptions)();
9
+ exports.handler = (0, util_1.failWrapper)(getApplication);
10
+ async function getApplication(parsed) {
11
+ try {
12
+ const applicationId = parsed.id;
13
+ const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
14
+ const application = await apiClient.getApplication(applicationId);
15
+ (0, describe_1.outputEntity)(application, parsed.output);
16
+ return application.id;
17
+ }
18
+ catch (error) {
19
+ throw new Error(`Error getting application: ${error}`);
20
+ }
21
+ }