@mablhq/mabl-cli 1.58.25 → 1.58.28

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 (102) hide show
  1. package/api/basicApiClient.js +15 -21
  2. package/api/mablApiClient.js +48 -40
  3. package/api/mablApiClientFactory.js +1 -1
  4. package/auth/OktaClient.js +2 -1
  5. package/browserEngines/chromiumBrowserEngine.js +2 -1
  6. package/browserEngines/firefoxBrowserEngine.js +2 -2
  7. package/browserEngines/webkitBrowerEngine.js +2 -2
  8. package/browserLauncher/browserLauncherFactory.js +3 -2
  9. package/browserLauncher/elementHandle.js +2 -1
  10. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +20 -12
  11. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +1 -1
  12. package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +10 -7
  13. package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +4 -3
  14. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractElementHandleDelegate.js +5 -4
  15. package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractPageDelegate.js +7 -4
  16. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +1 -1
  17. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +7 -6
  18. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +37 -31
  19. package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +9 -8
  20. package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +8 -4
  21. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +5 -3
  22. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitElementHandleDelegate.js +2 -1
  23. package/browserLauncher/playwrightBrowserLauncher/webkit/webkitFrameDelegate.js +1 -1
  24. package/browserTestMonitoring/metricsRecorder.js +6 -6
  25. package/commands/commandUtil/branches.js +3 -2
  26. package/commands/commandUtil/codeInsights.js +16 -13
  27. package/commands/commandUtil/fileUtil.js +1 -1
  28. package/commands/commandUtil/util.js +5 -3
  29. package/commands/commandUtil/versionUtil.js +5 -4
  30. package/commands/config/config_cmds/list.js +2 -2
  31. package/commands/datatables/datatables_cmds/create.js +3 -2
  32. package/commands/datatables/datatables_cmds/export.js +5 -3
  33. package/commands/datatables/datatables_cmds/list.js +2 -1
  34. package/commands/datatables/datatables_cmds/scenarios.js +2 -1
  35. package/commands/datatables/datatables_cmds/update.js +11 -11
  36. package/commands/datatables/utils.js +9 -9
  37. package/commands/deploy/deploy_cmds/awaitDeploymentCompletion.js +8 -6
  38. package/commands/deploy/deploy_cmds/create.js +13 -11
  39. package/commands/deploy/deploy_cmds/executionResultPresenter.js +11 -8
  40. package/commands/deploy/deploy_cmds/list.js +4 -3
  41. package/commands/deploy/deploy_cmds/watch.js +2 -1
  42. package/commands/environments/environments_cmds/create.js +2 -1
  43. package/commands/environments/environments_cmds/delete.js +2 -1
  44. package/commands/environments/environments_cmds/update.js +2 -1
  45. package/commands/environments/environments_cmds/urls_cmds/list.js +2 -1
  46. package/commands/flows/flows_cmds/export.js +2 -1
  47. package/commands/plans/plans_cmds/describe.js +2 -1
  48. package/commands/tests/mobileEmulationUtil.js +7 -5
  49. package/commands/tests/testsUtil.js +42 -40
  50. package/commands/tests/tests_cmds/export.js +2 -1
  51. package/commands/tests/tests_cmds/import.js +5 -4
  52. package/commands/tests/tests_cmds/run-cloud.js +13 -12
  53. package/commands/tests/tests_cmds/run.js +11 -9
  54. package/commands/users/users_cmds/list.js +2 -2
  55. package/commands/workspaces/workspace_cmds/copy.js +2 -1
  56. package/core/execution/ApiTestUtils.js +94 -82
  57. package/core/messaging/logLineMessaging.js +3 -2
  58. package/core/messaging/messaging.js +7 -6
  59. package/core/trainer/trainingSessions.js +15 -15
  60. package/coreWebVitals/index.js +18 -14
  61. package/execution/index.js +1 -1
  62. package/functions/apiTest/utils.js +5 -4
  63. package/http/MablHttpAgent.js +6 -4
  64. package/http/RequestSecurityError.js +1 -1
  65. package/http/axiosProxyConfig.js +5 -3
  66. package/http/httpUtil.js +3 -2
  67. package/http/requestInterceptor.js +15 -11
  68. package/mablscript/MablAction.js +3 -2
  69. package/mablscript/MablStep.js +4 -2
  70. package/mablscript/MablSymbol.js +1 -1
  71. package/mablscript/actions/ConditionAction.js +4 -2
  72. package/mablscript/actions/FindAction.js +4 -2
  73. package/mablscript/diffing/diffingUtil.js +7 -8
  74. package/mablscript/importer.js +2 -1
  75. package/mablscript/steps/AccessibilityCheck.js +9 -7
  76. package/mablscript/steps/AssertStep.js +16 -11
  77. package/mablscript/steps/ClickAndHoldStep.js +2 -1
  78. package/mablscript/steps/CreateVariableStep.js +2 -1
  79. package/mablscript/steps/DownloadStep.js +2 -1
  80. package/mablscript/steps/EnterTextStep.js +2 -1
  81. package/mablscript/steps/EvaluateFlowStep.js +1 -1
  82. package/mablscript/steps/IfConditionStep.js +6 -4
  83. package/mablscript/steps/ReleaseStep.js +2 -1
  84. package/mablscript/steps/SendHttpRequestStep.js +4 -2
  85. package/mablscript/steps/SendKeyStep.js +1 -1
  86. package/mablscript/steps/SetCookieStep.js +8 -7
  87. package/mablscript/steps/SetViewportStep.js +1 -1
  88. package/mablscript/steps/SwitchContextStep.js +6 -3
  89. package/mablscript/steps/SyntheticStep.js +2 -1
  90. package/middleware.js +2 -1
  91. package/package.json +1 -1
  92. package/popupDismissal/index.js +5 -4
  93. package/providers/authenticationProvider.js +6 -5
  94. package/providers/cliConfigProvider.js +12 -10
  95. package/providers/exportRequestProvider.js +5 -3
  96. package/providers/logging/loggingProvider.js +1 -1
  97. package/reporters/mochAwesome/mochAwesomeReporter.js +14 -12
  98. package/util/TestOutputWriter.js +12 -8
  99. package/util/actionabilityUtil.js +1 -1
  100. package/util/analytics.js +9 -6
  101. package/util/browserTestUtils.js +2 -1
  102. package/util/markdownUtil.js +11 -9
@@ -15,43 +15,46 @@ function attachListeners() {
15
15
  }
16
16
  exports.attachListeners = attachListeners;
17
17
  function handleNavigationEvent(eventName, callback) {
18
+ var _a;
18
19
  const performanceEntries = performance.getEntriesByType('navigation');
19
- const navigationTiming = performanceEntries?.[0];
20
- const eventTimestamp = navigationTiming?.[eventName];
20
+ const navigationTiming = performanceEntries === null || performanceEntries === void 0 ? void 0 : performanceEntries[0];
21
+ const eventTimestamp = navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming[eventName];
21
22
  callback({
22
23
  name: eventName,
23
24
  value: eventTimestamp,
24
25
  delta: eventTimestamp,
25
26
  rating: 'none',
26
27
  id: `NAV:${eventName}:${eventTimestamp}:${Date.now()}`,
27
- entries: performanceEntries?.map((entry) => entry?.toJSON()),
28
- navigationType: navigationTiming?.type ?? 'navigate',
28
+ entries: performanceEntries === null || performanceEntries === void 0 ? void 0 : performanceEntries.map((entry) => entry === null || entry === void 0 ? void 0 : entry.toJSON()),
29
+ navigationType: (_a = navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming.type) !== null && _a !== void 0 ? _a : 'navigate',
29
30
  });
30
31
  }
31
32
  function pollForEventTimestamp(eventName, callback, navigationTiming) {
33
+ var _a;
32
34
  navigationTiming =
33
- navigationTiming ??
34
- performance.getEntriesByType('navigation')?.[0];
35
- if (navigationTiming?.[eventName]) {
35
+ navigationTiming !== null && navigationTiming !== void 0 ? navigationTiming : (_a = performance.getEntriesByType('navigation')) === null || _a === void 0 ? void 0 : _a[0];
36
+ if (navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming[eventName]) {
36
37
  handleNavigationEvent(eventName, callback);
37
38
  return;
38
39
  }
39
40
  let attempts = 0;
40
41
  const interval = window.setInterval(() => {
42
+ var _a;
41
43
  attempts++;
42
- const navigationTiming = performance.getEntriesByType('navigation')?.[0];
43
- if (navigationTiming?.[eventName] || attempts >= POLLING_MAX_ATTEMPTS) {
44
+ const navigationTiming = (_a = performance.getEntriesByType('navigation')) === null || _a === void 0 ? void 0 : _a[0];
45
+ if ((navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming[eventName]) || attempts >= POLLING_MAX_ATTEMPTS) {
44
46
  handleNavigationEvent(eventName, callback);
45
47
  window.clearInterval(interval);
46
48
  }
47
49
  }, POLLING_INTERVAL_MILLIS);
48
50
  }
49
51
  function onNavigationEvent(callback) {
50
- const navigationTiming = performance.getEntriesByType('navigation')?.[0];
52
+ var _a;
53
+ const navigationTiming = (_a = performance.getEntriesByType('navigation')) === null || _a === void 0 ? void 0 : _a[0];
51
54
  if (navigationTiming !== undefined) {
52
55
  handleNavigationEvent('startTime', callback);
53
56
  }
54
- if (navigationTiming?.domContentLoadedEventEnd) {
57
+ if (navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming.domContentLoadedEventEnd) {
55
58
  handleNavigationEvent('domContentLoadedEventEnd', callback);
56
59
  }
57
60
  else {
@@ -61,13 +64,14 @@ function onNavigationEvent(callback) {
61
64
  }
62
65
  }
63
66
  const sendMetric = (metric) => {
64
- const navigationTiming = performance.getEntriesByType('navigation')?.[0];
65
- window.dispatchMablEvent?.({
67
+ var _a, _b, _c;
68
+ const navigationTiming = (_a = performance.getEntriesByType('navigation')) === null || _a === void 0 ? void 0 : _a[0];
69
+ (_c = (_b = window).dispatchMablEvent) === null || _c === void 0 ? void 0 : _c.call(_b, {
66
70
  createdTime: Date.now(),
67
71
  timeOrigin: performance.timeOrigin,
68
72
  type: 'WEB_PERFORMANCE_METRIC_DETECTED',
69
73
  currentUrl: window.document.URL,
70
- navigationUrl: navigationTiming?.name,
74
+ navigationUrl: navigationTiming === null || navigationTiming === void 0 ? void 0 : navigationTiming.name,
71
75
  metric,
72
76
  });
73
77
  };