@mablhq/mabl-cli 1.16.32 → 1.17.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 (124) hide show
  1. package/api/basicApiClient.js +9 -4
  2. package/api/mablApiClient.js +14 -7
  3. package/browserLauncher/browserLauncherFactory.js +2 -1
  4. package/browserLauncher/elementHandle.js +2 -1
  5. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +5 -1
  6. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +22 -18
  7. package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +10 -6
  8. package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +5 -1
  9. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +13 -9
  10. package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +1 -1
  11. package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +10 -10
  12. package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +6 -6
  13. package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +1 -1
  14. package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +1 -1
  15. package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +3 -3
  16. package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +12 -11
  17. package/cli.js +12 -8
  18. package/commands/applications/applications_cmds/describe.js +4 -4
  19. package/commands/applications/applications_cmds/list.js +4 -4
  20. package/commands/auth/auth_cmds/activate-key.js +1 -1
  21. package/commands/branches/branches_cmds/create.js +4 -4
  22. package/commands/branches/branches_cmds/describe.js +3 -3
  23. package/commands/branches/branches_cmds/list.js +3 -3
  24. package/commands/branches/branches_cmds/merge.js +4 -4
  25. package/commands/commandUtil/codeInsights.js +4 -2
  26. package/commands/commandUtil/describe.js +1 -1
  27. package/commands/commandUtil/fileUtil.js +5 -1
  28. package/commands/commandUtil/util.js +2 -2
  29. package/commands/config/config_cmds/delete.js +1 -1
  30. package/commands/config/config_cmds/set.js +1 -1
  31. package/commands/constants.js +2 -1
  32. package/commands/credentials/credentials_cmds/list.js +4 -4
  33. package/commands/deploy/deploy_cmds/create.js +18 -13
  34. package/commands/deploy/deploy_cmds/describe.js +5 -5
  35. package/commands/deploy/deploy_cmds/executionResultPresenter.js +1 -1
  36. package/commands/deploy/deploy_cmds/list.js +4 -4
  37. package/commands/deploy/deploy_cmds/watch.js +2 -2
  38. package/commands/environments/environments_cmds/create.js +7 -7
  39. package/commands/environments/environments_cmds/delete.js +1 -1
  40. package/commands/environments/environments_cmds/describe.js +4 -4
  41. package/commands/environments/environments_cmds/list.js +4 -4
  42. package/commands/environments/environments_cmds/update.js +2 -2
  43. package/commands/environments/environments_cmds/urls_cmds/add.js +3 -3
  44. package/commands/environments/environments_cmds/urls_cmds/list.js +2 -2
  45. package/commands/flows/flows_cmds/export.js +5 -5
  46. package/commands/flows/flows_cmds/list.js +2 -2
  47. package/commands/link-agents/link-agents_cmds/delete.js +1 -1
  48. package/commands/plans/plans_cmds/describe.js +4 -4
  49. package/commands/plans/plans_cmds/list.js +2 -2
  50. package/commands/test-runs/test-runs_cmds/export.js +2 -2
  51. package/commands/tests/executionUtil.js +5 -5
  52. package/commands/tests/testsUtil.js +19 -12
  53. package/commands/tests/tests_cmds/create.js +3 -3
  54. package/commands/tests/tests_cmds/edit.js +3 -3
  55. package/commands/tests/tests_cmds/export.js +7 -7
  56. package/commands/tests/tests_cmds/import.js +35 -14
  57. package/commands/tests/tests_cmds/list.js +3 -3
  58. package/commands/tests/tests_cmds/run-alpha.js +3 -3
  59. package/commands/tests/tests_cmds/run-cloud.js +4 -4
  60. package/commands/tests/tests_cmds/run-legacy.js +8 -8
  61. package/commands/tests/tests_cmds/run.js +8 -8
  62. package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
  63. package/commands/tests/tests_cmds/trainer_cmds/update.js +1 -1
  64. package/commands/tests/tests_cmds/trainer_cmds/version.js +2 -2
  65. package/commands/workspaces/workspace_cmds/copy.js +2 -2
  66. package/commands/workspaces/workspace_cmds/describe.js +4 -4
  67. package/commands/workspaces/workspace_cmds/list.js +2 -2
  68. package/configGenerators/flowConfigGenerator.js +1 -1
  69. package/configGenerators/selIdeGenerator.js +6 -6
  70. package/core/messaging/actions/runnerActions.js +2 -2
  71. package/core/trainer/openUtils.js +2 -2
  72. package/core/trainer/trainingSessions.js +26 -26
  73. package/domUtil/index.js +1 -1
  74. package/env/env.js +5 -1
  75. package/execution/index.js +1 -1
  76. package/mablApi/index.js +1 -1
  77. package/mablscript/AttributesConstants.js +2 -1
  78. package/mablscript/MablStep.js +6 -12
  79. package/mablscript/actions/ConditionAction.js +1 -1
  80. package/mablscript/actions/FindAction.js +25 -32
  81. package/mablscript/actions/GetUrlAction.js +1 -1
  82. package/mablscript/actions/GetVariableValue.js +1 -1
  83. package/mablscript/actions/JavaScriptAction.js +16 -16
  84. package/mablscript/importer.js +7 -7
  85. package/mablscript/steps/AccessibilityCheck.js +4 -2
  86. package/mablscript/steps/AssertStep.js +16 -16
  87. package/mablscript/steps/AssertStepOld.js +2 -2
  88. package/mablscript/steps/ClickStep.js +1 -1
  89. package/mablscript/steps/CreateVariableStep.js +6 -6
  90. package/mablscript/steps/DoubleClickStep.js +1 -1
  91. package/mablscript/steps/EchoStep.js +2 -2
  92. package/mablscript/steps/EnterTextStep.js +3 -3
  93. package/mablscript/steps/HoverStep.js +1 -1
  94. package/mablscript/steps/IfConditionStep.js +2 -1
  95. package/mablscript/steps/NavigateStep.js +1 -1
  96. package/mablscript/steps/SendHttpRequestStep.js +1 -1
  97. package/mablscript/steps/SendKeyStep.js +2 -2
  98. package/mablscript/steps/SetViewportStep.js +1 -1
  99. package/mablscript/steps/SwitchContextStep.js +9 -9
  100. package/mablscript/steps/VisitUrlStep.js +1 -1
  101. package/mablscript/steps/WaitStep.js +1 -1
  102. package/mablscript/steps/WaitUntilStep.js +1 -1
  103. package/mablscript/types/OperatingSystemDescriptor.js +5 -1
  104. package/mablscript/types/VariableNamespace.js +1 -1
  105. package/mablscriptFind/index.js +1 -1
  106. package/observers/mockObserver.js +4 -2
  107. package/package.json +55 -56
  108. package/popupDismissal/index.js +3 -3
  109. package/providers/authenticationProvider.js +3 -3
  110. package/providers/logging/loggingProvider.js +5 -1
  111. package/proxy/index.js +2 -1
  112. package/proxy/index.js.LICENSE.txt +5 -0
  113. package/reporters/mochAwesome/mochAwesomeReporter.js +11 -7
  114. package/reporters/reporter.js +1 -1
  115. package/resources/mablFind.js +1 -1
  116. package/resources/popupDismissal.js +1 -1
  117. package/util/RichPromise.js +1 -0
  118. package/util/actionabilityUtil.js +18 -14
  119. package/util/analytics.js +7 -3
  120. package/util/downloadUtil.js +6 -2
  121. package/util/httpUtil.js +6 -2
  122. package/util/markdownUtil.js +1 -1
  123. package/util/pureUtil.js +5 -1
  124. package/util/resourceUtil.js +5 -1
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -53,11 +57,12 @@ var AuthType;
53
57
  class BasicApiClient {
54
58
  constructor(options) {
55
59
  var _a, _b, _c, _d;
56
- const config = httpUtil_1.axiosProxyConfig({
60
+ const config = (0, httpUtil_1.axiosProxyConfig)({
57
61
  sslVerify: options.sslVerify,
58
62
  proxyHost: options.proxyUrl,
59
63
  });
60
- config.timeout = (_c = (_a = options.requestTimeoutMillis) !== null && _a !== void 0 ? _a : (_b = options.retryConfig) === null || _b === void 0 ? void 0 : _b.requestTimeoutMillis) !== null && _c !== void 0 ? _c : DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS;
64
+ config.timeout =
65
+ (_c = (_a = options.requestTimeoutMillis) !== null && _a !== void 0 ? _a : (_b = options.retryConfig) === null || _b === void 0 ? void 0 : _b.requestTimeoutMillis) !== null && _c !== void 0 ? _c : DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS;
61
66
  switch (options.authType) {
62
67
  case AuthType.ApiKey:
63
68
  config.auth = {
@@ -184,7 +189,7 @@ class BasicApiClient {
184
189
  },
185
190
  forever: false,
186
191
  };
187
- return asyncUtil_1.promiseWithTimeout(async_retry_1.default(async (bail) => {
192
+ return (0, asyncUtil_1.promiseWithTimeout)((0, async_retry_1.default)(async (bail) => {
188
193
  try {
189
194
  return await requestFunc();
190
195
  }
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -516,10 +520,14 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
516
520
  if (options.mablBranch) {
517
521
  requestBody.source_control_tag = options.mablBranch;
518
522
  }
519
- requestBody.properties.repository_branch_name = (_b = options.sourceControlMetadata) === null || _b === void 0 ? void 0 : _b.branchName;
520
- requestBody.properties.repository_tag_name = (_c = options.sourceControlMetadata) === null || _c === void 0 ? void 0 : _c.branchName;
521
- requestBody.properties.repository_url = (_d = options.sourceControlMetadata) === null || _d === void 0 ? void 0 : _d.repoUrl;
522
- requestBody.properties.repository_name = (_e = options.sourceControlMetadata) === null || _e === void 0 ? void 0 : _e.repoName;
523
+ requestBody.properties.repository_branch_name =
524
+ (_b = options.sourceControlMetadata) === null || _b === void 0 ? void 0 : _b.branchName;
525
+ requestBody.properties.repository_tag_name =
526
+ (_c = options.sourceControlMetadata) === null || _c === void 0 ? void 0 : _c.branchName;
527
+ requestBody.properties.repository_url =
528
+ (_d = options.sourceControlMetadata) === null || _d === void 0 ? void 0 : _d.repoUrl;
529
+ requestBody.properties.repository_name =
530
+ (_e = options.sourceControlMetadata) === null || _e === void 0 ? void 0 : _e.repoName;
523
531
  const planOverrides = {};
524
532
  if ((_f = options.browserTypes) === null || _f === void 0 ? void 0 : _f.length) {
525
533
  planOverrides.browser_types = options.browserTypes;
@@ -712,8 +720,7 @@ function sortTemporallyAscending(entities) {
712
720
  entities.sort((a, b) => (a.created_time >= b.created_time ? 1 : -1));
713
721
  }
714
722
  function toApiError(summary, cause) {
715
- var _a;
716
- const errorResponse = (_a = cause) === null || _a === void 0 ? void 0 : _a.response;
723
+ const errorResponse = cause === null || cause === void 0 ? void 0 : cause.response;
717
724
  const code = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.status;
718
725
  const mablError = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.data;
719
726
  const message = `${summary}: ${mablError
@@ -18,7 +18,8 @@ class BrowserLauncherFactory {
18
18
  static createRunner(runnerType = runnerType_1.RunnerType.Playwright, loggerFunc) {
19
19
  const runnerFromEnv = BrowserLauncherFactory.getRunnerFromEnvironment();
20
20
  const runner = runnerFromEnv ? runnerFromEnv : runnerType;
21
- loggerFunc = loggerFunc !== null && loggerFunc !== void 0 ? loggerFunc : ((line) => logUtils_1.logCliOutput(loggingProvider_1.LogLevel.Info, line));
21
+ loggerFunc =
22
+ loggerFunc !== null && loggerFunc !== void 0 ? loggerFunc : ((line) => (0, logUtils_1.logCliOutput)(loggingProvider_1.LogLevel.Info, line));
22
23
  if (runner === runnerType_1.RunnerType.Playwright) {
23
24
  loggerFunc(chalk_1.default.cyan(`Browser launcher:`, chalk_1.default.magenta('Playwright')));
24
25
  return new playwrightBrowserLauncher_1.PlaywrightBrowserLauncher();
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isElementHandle = exports.getHighlightColor = exports.MAX_HIGHLIGHT_OPACITY = void 0;
4
4
  exports.MAX_HIGHLIGHT_OPACITY = 0.9;
5
- exports.getHighlightColor = (transparency) => ({
5
+ const getHighlightColor = (transparency) => ({
6
6
  r: 196,
7
7
  g: 68,
8
8
  b: 183,
9
9
  a: transparency,
10
10
  });
11
+ exports.getHighlightColor = getHighlightColor;
11
12
  function isElementHandle(value) {
12
13
  return (value &&
13
14
  typeof value === 'object' &&
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -44,12 +48,12 @@ class PlaywrightJsHandle {
44
48
  }
45
49
  async evaluateHandle(code, arg) {
46
50
  const handle = await this.handle.evaluateHandle(code, PlaywrightJsHandle.unwrapProperties(arg));
47
- return utils_1.mapIfNotNull(handle, (handle) => handle.asElement()
51
+ return (0, utils_1.mapIfNotNull)(handle, (handle) => handle.asElement()
48
52
  ? new PlaywrightElementHandle(handle.asElement(), this.page)
49
53
  : new PlaywrightJsHandle(handle, this.page));
50
54
  }
51
55
  async getProperty(propertyName) {
52
- return utils_1.mapIfNotNull(await this.handle.getProperty(propertyName), (handle) => new PlaywrightJsHandle(handle, this.page));
56
+ return (0, utils_1.mapIfNotNull)(await this.handle.getProperty(propertyName), (handle) => new PlaywrightJsHandle(handle, this.page));
53
57
  }
54
58
  jsonValue() {
55
59
  return this.handle.jsonValue();
@@ -97,7 +101,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
97
101
  this.elementImpl = playwright._toImpl(this.element);
98
102
  this.cdpSession = (_c = (_b = (_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._context) === null || _b === void 0 ? void 0 : _b._delegate) === null || _c === void 0 ? void 0 : _c._client;
99
103
  if (this.elementImpl === undefined) {
100
- logUtils_1.logInternal(`Unable to get the Element's internal implementation.
104
+ (0, logUtils_1.logInternal)(`Unable to get the Element's internal implementation.
101
105
  Some functionality, such as getting the clickable point or element highlighting might not work.`);
102
106
  }
103
107
  else if (this.cdpSession === undefined) {
@@ -106,13 +110,13 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
106
110
  : ((_f = this.elementImpl) === null || _f === void 0 ? void 0 : _f._context) !== undefined
107
111
  ? '_delegate'
108
112
  : '_context';
109
- logUtils_1.logInternal(`Unable to get the CDP Session of the element handle.
113
+ (0, logUtils_1.logInternal)(`Unable to get the CDP Session of the element handle.
110
114
  ${undefinedField} is undefined.
111
115
  Some functionality, such as element highlighting will not work.`);
112
116
  }
113
117
  }
114
118
  catch (e) {
115
- logUtils_1.logInternal(`Unable to get the element handle's implementation. Error: ${e}`);
119
+ (0, logUtils_1.logInternal)(`Unable to get the element handle's implementation. Error: ${e}`);
116
120
  }
117
121
  }
118
122
  uploadFile(filePath) {
@@ -122,10 +126,10 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
122
126
  return (await this.element.$$(`xpath=${xpathQuery}`)).map((element) => new PlaywrightElementHandle(element, this.page));
123
127
  }
124
128
  asElement() {
125
- return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new PlaywrightElementHandle(handle, this.page));
129
+ return (0, utils_1.mapIfNotNull)(this.handle.asElement(), (handle) => new PlaywrightElementHandle(handle, this.page));
126
130
  }
127
131
  async boundingBox() {
128
- return utils_1.mapIfNotNull(await this.element.boundingBox(), (boundingBox) => boundingBox);
132
+ return (0, utils_1.mapIfNotNull)(await this.element.boundingBox(), (boundingBox) => boundingBox);
129
133
  }
130
134
  async click(options) {
131
135
  var _a, _b, _c, _d;
@@ -140,7 +144,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
140
144
  }
141
145
  catch (error) {
142
146
  if (error.message.includes(exports.NAVIGATION_ERROR_MESSAGE)) {
143
- logUtils_1.logInternal(`Action timed out due to navigation timeout. ${error.toString()}`);
147
+ (0, logUtils_1.logInternal)(`Action timed out due to navigation timeout. ${error.toString()}`);
144
148
  return;
145
149
  }
146
150
  throw error;
@@ -158,7 +162,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
158
162
  }
159
163
  catch (error) {
160
164
  if (error.message.includes(exports.NAVIGATION_ERROR_MESSAGE)) {
161
- logUtils_1.logInternal(`Action timed out due to navigation timeout. ${error.toString()}`);
165
+ (0, logUtils_1.logInternal)(`Action timed out due to navigation timeout. ${error.toString()}`);
162
166
  }
163
167
  }
164
168
  }
@@ -172,13 +176,13 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
172
176
  return clickablePoint;
173
177
  }
174
178
  async contentFrame() {
175
- return utils_1.mapIfNotNull(await this.element.contentFrame(), (frame) => this.page.getOrCreateFrame(frame));
179
+ return (0, utils_1.mapIfNotNull)(await this.element.contentFrame(), (frame) => this.page.getOrCreateFrame(frame));
176
180
  }
177
181
  focus() {
178
182
  return this.element.focus();
179
183
  }
180
184
  async frame() {
181
- return utils_1.mapIfNotNull(await this.element.ownerFrame(), (frame) => this.page.getOrCreateFrame(frame));
185
+ return (0, utils_1.mapIfNotNull)(await this.element.ownerFrame(), (frame) => this.page.getOrCreateFrame(frame));
182
186
  }
183
187
  hover() {
184
188
  return this.element.hover();
@@ -213,7 +217,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
213
217
  getRemoteObjectId() {
214
218
  var _a, _b, _c;
215
219
  if (((_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._objectId) === undefined) {
216
- logUtils_1.logInternal('ObjectId of an element handle was not found.');
220
+ (0, logUtils_1.logInternal)('ObjectId of an element handle was not found.');
217
221
  }
218
222
  return (_c = (_b = this.elementImpl) === null || _b === void 0 ? void 0 : _b._objectId) !== null && _c !== void 0 ? _c : '';
219
223
  }
@@ -228,8 +232,8 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
228
232
  const highlightConfig = {
229
233
  backendNodeId: nodeInfo.node.backendNodeId,
230
234
  highlightConfig: {
231
- borderColor: elementHandle_1.getHighlightColor(0),
232
- contentColor: elementHandle_1.getHighlightColor(1),
235
+ borderColor: (0, elementHandle_1.getHighlightColor)(0),
236
+ contentColor: (0, elementHandle_1.getHighlightColor)(1),
233
237
  colorFormat: 'rgb',
234
238
  },
235
239
  };
@@ -252,7 +256,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
252
256
  x * (1 - x) * 4 * elementHandle_1.MAX_HIGHLIGHT_OPACITY;
253
257
  }
254
258
  await this.makeCdpCall('Overlay.highlightNode', highlightConfig);
255
- await testsUtil_1.sleep(phaseIntervalMilliseconds);
259
+ await (0, testsUtil_1.sleep)(phaseIntervalMilliseconds);
256
260
  }
257
261
  }
258
262
  async enableDom() {
@@ -273,11 +277,11 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
273
277
  }
274
278
  async getAttribute(attributeName) {
275
279
  const result = await this.element.evaluate((el, attributeName) => el.getAttribute(attributeName), attributeName);
276
- return pureUtil_1.isNullish(result) ? undefined : result;
280
+ return (0, pureUtil_1.isNullish)(result) ? undefined : result;
277
281
  }
278
282
  async getInnerText() {
279
283
  const result = await this.element.evaluate((el) => el.innerText);
280
- return pureUtil_1.isNullish(result) ? undefined : result;
284
+ return (0, pureUtil_1.isNullish)(result) ? undefined : result;
281
285
  }
282
286
  }
283
287
  exports.PlaywrightElementHandle = PlaywrightElementHandle;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -44,7 +48,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
44
48
  if (this.utilityWorldAvailable === undefined) {
45
49
  await Promise.race([
46
50
  this._contextData.get(UTILITY_CONTEXT).contextPromise,
47
- testsUtil_1.sleep(WAIT_FOR_CONTEXT_TIMEOUT),
51
+ (0, testsUtil_1.sleep)(WAIT_FOR_CONTEXT_TIMEOUT),
48
52
  ]);
49
53
  this.utilityWorldAvailable =
50
54
  this._contextData.get(UTILITY_CONTEXT).context !== null;
@@ -75,7 +79,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
75
79
  functionHandleOverride.bind(serverFrame);
76
80
  }
77
81
  async $(selector) {
78
- return utils_1.mapIfNotNull(await this.frame.$(selector), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
82
+ return (0, utils_1.mapIfNotNull)(await this.frame.$(selector), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
79
83
  }
80
84
  async $$(selector) {
81
85
  const maybePlaywrightHandles = await this.frame.$$(selector);
@@ -128,7 +132,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
128
132
  timeout: types_1.DefaultTimeouts.quickActionTimeoutMs,
129
133
  });
130
134
  }
131
- return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this.parentPage, response));
135
+ return (0, utils_1.mapIfNotNull)(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this.parentPage, response));
132
136
  }
133
137
  catch (e) {
134
138
  if (e instanceof playwright.errors.TimeoutError) {
@@ -144,13 +148,13 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
144
148
  return this.frame.name();
145
149
  }
146
150
  parentFrame() {
147
- return utils_1.mapIfNotNull(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
151
+ return (0, utils_1.mapIfNotNull)(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
148
152
  }
149
153
  url() {
150
154
  return this.frame.url();
151
155
  }
152
156
  async waitForSelector(selector, options) {
153
- return utils_1.mapIfNotNull(await this.frame.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
157
+ return (0, utils_1.mapIfNotNull)(await this.frame.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
154
158
  }
155
159
  page() {
156
160
  return this.parentPage;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -68,7 +72,7 @@ class PlaywrightPage extends events_1.default {
68
72
  });
69
73
  }
70
74
  async waitForInitialization() {
71
- this.openerPage = await utils_1.mapIfNotNull(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
75
+ this.openerPage = await (0, utils_1.mapIfNotNull)(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
72
76
  this.fallbackCdpSession = await this.createFallbackCdpSession();
73
77
  }
74
78
  on(event, listener) {
@@ -143,7 +147,7 @@ class PlaywrightPage extends events_1.default {
143
147
  }
144
148
  }
145
149
  catch (error) {
146
- logUtils_1.logInternal(`Unable to register event ${event.toString()}. Error: ${error}`);
150
+ (0, logUtils_1.logInternal)(`Unable to register event ${event.toString()}. Error: ${error}`);
147
151
  }
148
152
  }
149
153
  async screenshot(clip) {
@@ -227,7 +231,7 @@ class PlaywrightPage extends events_1.default {
227
231
  async goto(url, options) {
228
232
  try {
229
233
  const response = await this.page.goto(url, options);
230
- return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
234
+ return (0, utils_1.mapIfNotNull)(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
231
235
  }
232
236
  catch (e) {
233
237
  if (e instanceof playwright.errors.TimeoutError) {
@@ -262,7 +266,7 @@ class PlaywrightPage extends events_1.default {
262
266
  }
263
267
  async reload(options) {
264
268
  try {
265
- return utils_1.mapIfNotNull(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
269
+ return (0, utils_1.mapIfNotNull)(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
266
270
  }
267
271
  catch (e) {
268
272
  if (e instanceof playwright.errors.TimeoutError) {
@@ -305,7 +309,7 @@ class PlaywrightPage extends events_1.default {
305
309
  await this.setBrowserBounds(viewport.width, viewport.height);
306
310
  }
307
311
  catch (error) {
308
- logUtils_1.logInternal(`Set Browser Bounds during setViewport step failed: ${error}`);
312
+ (0, logUtils_1.logInternal)(`Set Browser Bounds during setViewport step failed: ${error}`);
309
313
  }
310
314
  }
311
315
  async emulateDevice(deviceDescriptor) {
@@ -320,7 +324,7 @@ class PlaywrightPage extends events_1.default {
320
324
  async waitForNavigation(options) {
321
325
  try {
322
326
  const result = await this.page.waitForNavigation(options);
323
- return utils_1.mapIfNotNull(result, (result) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
327
+ return (0, utils_1.mapIfNotNull)(result, (result) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
324
328
  }
325
329
  catch (e) {
326
330
  if (e instanceof playwright.errors.TimeoutError) {
@@ -330,7 +334,7 @@ class PlaywrightPage extends events_1.default {
330
334
  }
331
335
  }
332
336
  async waitForSelector(selector, options) {
333
- return utils_1.mapIfNotNull(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this));
337
+ return (0, utils_1.mapIfNotNull)(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this));
334
338
  }
335
339
  acceptDialogs(dialog) {
336
340
  return dialog.accept();
@@ -352,7 +356,7 @@ class PlaywrightPage extends events_1.default {
352
356
  : ((_f = this.getPageImpl()) === null || _f === void 0 ? void 0 : _f._delegate) !== undefined
353
357
  ? '_mainFrameSession'
354
358
  : 'pageImpl';
355
- logUtils_1.logInternal(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
359
+ (0, logUtils_1.logInternal)(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
356
360
  Creating a fallback session. Some functionality might not work as expected.`);
357
361
  }
358
362
  return ((_k = (_j = (_h = (_g = this.getPageImpl()) === null || _g === void 0 ? void 0 : _g._delegate) === null || _h === void 0 ? void 0 : _h._mainFrameSession) === null || _j === void 0 ? void 0 : _j._client) !== null && _k !== void 0 ? _k : this.fallbackCdpSession);
@@ -103,7 +103,7 @@ class PuppeteerBrowser extends events_1.default {
103
103
  async waitForPage(opener, options) {
104
104
  try {
105
105
  const pageTarget = opener.getPuppeteerPage().target();
106
- const newTarget = await this.browser.waitForTarget((target) => target.opener() === pageTarget, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
106
+ const newTarget = await this.browser.waitForTarget((target) => target.opener() === pageTarget, (0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options));
107
107
  return this.getOrCreatePage((await newTarget.page()));
108
108
  }
109
109
  catch (e) {
@@ -18,7 +18,7 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
18
18
  }
19
19
  async contentFrame() {
20
20
  const frame = await this.element.contentFrame();
21
- return utils_1.mapIfNotNull(frame, (frame) => this.parentPage.getOrCreateFrame(frame));
21
+ return (0, utils_1.mapIfNotNull)(frame, (frame) => this.parentPage.getOrCreateFrame(frame));
22
22
  }
23
23
  focus() {
24
24
  return this.element.focus();
@@ -46,11 +46,11 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
46
46
  return Promise.resolve();
47
47
  }
48
48
  await this.element.click();
49
- await testsUtil_1.sleep(msBetweenClicks);
49
+ await (0, testsUtil_1.sleep)(msBetweenClicks);
50
50
  return this.element.click({ clickCount: 2 });
51
51
  }
52
52
  asElement() {
53
- return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new PuppeteerElementHandle(handle, this.parentPage));
53
+ return (0, utils_1.mapIfNotNull)(this.handle.asElement(), (handle) => new PuppeteerElementHandle(handle, this.parentPage));
54
54
  }
55
55
  type(text, options) {
56
56
  return this.element.type(text, options);
@@ -60,10 +60,10 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
60
60
  }
61
61
  async boundingBox() {
62
62
  const boundingBox = await this.element.boundingBox();
63
- return utils_1.mapIfNotNull(boundingBox, (boundingBox) => boundingBox);
63
+ return (0, utils_1.mapIfNotNull)(boundingBox, (boundingBox) => boundingBox);
64
64
  }
65
65
  frame() {
66
- return Promise.resolve(utils_1.mapIfNotNull(this.element.executionContext().frame(), (frame) => this.parentPage.getOrCreateFrame(frame)));
66
+ return Promise.resolve((0, utils_1.mapIfNotNull)(this.element.executionContext().frame(), (frame) => this.parentPage.getOrCreateFrame(frame)));
67
67
  }
68
68
  press(key) {
69
69
  return this.element.press(key);
@@ -82,8 +82,8 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
82
82
  const highlightConfig = {
83
83
  backendNodeId: nodeInfo.node.backendNodeId,
84
84
  highlightConfig: {
85
- borderColor: elementHandle_1.getHighlightColor(0),
86
- contentColor: elementHandle_1.getHighlightColor(1),
85
+ borderColor: (0, elementHandle_1.getHighlightColor)(0),
86
+ contentColor: (0, elementHandle_1.getHighlightColor)(1),
87
87
  colorFormat: 'rgb',
88
88
  },
89
89
  };
@@ -112,7 +112,7 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
112
112
  x * (1 - x) * 4 * elementHandle_1.MAX_HIGHLIGHT_OPACITY;
113
113
  }
114
114
  await this.makeCdpCall('Overlay.highlightNode', highlightConfig);
115
- await testsUtil_1.sleep(phaseIntervalMilliseconds);
115
+ await (0, testsUtil_1.sleep)(phaseIntervalMilliseconds);
116
116
  }
117
117
  }
118
118
  getCdpClient() {
@@ -126,14 +126,14 @@ class PuppeteerElementHandle extends puppeteerJsHandle_1.PuppeteerJsHandle {
126
126
  }
127
127
  async getInnerText() {
128
128
  const result = await this.element.evaluate((el) => el.innerText);
129
- return pureUtil_1.isNullish(result) ? undefined : result;
129
+ return (0, pureUtil_1.isNullish)(result) ? undefined : result;
130
130
  }
131
131
  getTagName() {
132
132
  return this.element.evaluate((el) => el.tagName.toLowerCase());
133
133
  }
134
134
  async getAttribute(attributeName) {
135
135
  const result = await this.element.evaluate((el, attributeName) => el.getAttribute(attributeName), attributeName);
136
- return pureUtil_1.isNullish(result) ? undefined : result;
136
+ return (0, pureUtil_1.isNullish)(result) ? undefined : result;
137
137
  }
138
138
  }
139
139
  exports.PuppeteerElementHandle = PuppeteerElementHandle;
@@ -43,7 +43,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
43
43
  }
44
44
  async $(selector) {
45
45
  const handle = await this.frame.$(selector);
46
- return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
46
+ return (0, utils_1.mapIfNotNull)(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
47
47
  }
48
48
  async $$(selector) {
49
49
  return (await this.frame.$$(selector)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this.parentPage));
@@ -62,8 +62,8 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
62
62
  }
63
63
  async goto(url, options) {
64
64
  try {
65
- const response = await this.frame.goto(url, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
66
- return utils_1.mapIfNotNull(response, (response) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this.parentPage));
65
+ const response = await this.frame.goto(url, (0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options));
66
+ return (0, utils_1.mapIfNotNull)(response, (response) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this.parentPage));
67
67
  }
68
68
  catch (e) {
69
69
  if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
@@ -73,7 +73,7 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
73
73
  }
74
74
  }
75
75
  parentFrame() {
76
- return utils_1.mapIfNotNull(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
76
+ return (0, utils_1.mapIfNotNull)(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
77
77
  }
78
78
  evaluate(pageFunction, arg) {
79
79
  return this.frame.evaluate(pageFunction, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg));
@@ -98,8 +98,8 @@ class PuppeteerFrame extends browserLauncher_1.Frame {
98
98
  return new puppeteerJsHandle_1.PuppeteerJsHandle(await this.frame.evaluateHandle(code, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg)), this.parentPage);
99
99
  }
100
100
  async waitForSelector(selector, options) {
101
- const handle = await this.frame.waitForSelector(selector, puppeteerBrowserLauncher_1.convertWaitForOptions(options));
102
- return utils_1.mapIfNotNull(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
101
+ const handle = await this.frame.waitForSelector(selector, (0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options));
102
+ return (0, utils_1.mapIfNotNull)(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
103
103
  }
104
104
  async getFrameOwnerElement() {
105
105
  const parentFrame = this.parentFrame();
@@ -23,7 +23,7 @@ class PuppeteerHttpRequest {
23
23
  });
24
24
  }
25
25
  frame() {
26
- return utils_1.mapIfNotNull(this.request.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
26
+ return (0, utils_1.mapIfNotNull)(this.request.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
27
27
  }
28
28
  url() {
29
29
  return this.request.url();
@@ -15,7 +15,7 @@ class PuppeteerHttpResponse {
15
15
  return this.response.url();
16
16
  }
17
17
  frame() {
18
- return utils_1.mapIfNotNull(this.response.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
18
+ return (0, utils_1.mapIfNotNull)(this.response.frame(), (frame) => this.parentPage.getOrCreateFrame(frame));
19
19
  }
20
20
  request() {
21
21
  return new puppeteerHttpRequest_1.PuppeteerHttpRequest(this.response.request(), this.parentPage);
@@ -10,16 +10,16 @@ class PuppeteerJsHandle {
10
10
  }
11
11
  async evaluateHandle(code, arg) {
12
12
  const handle = await this.handle.evaluateHandle(code, PuppeteerJsHandle.unwrapProperties(arg));
13
- return utils_1.mapIfNotNull(handle, (handle) => new PuppeteerJsHandle(handle, this.parentPage));
13
+ return (0, utils_1.mapIfNotNull)(handle, (handle) => new PuppeteerJsHandle(handle, this.parentPage));
14
14
  }
15
15
  asElement() {
16
- return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
16
+ return (0, utils_1.mapIfNotNull)(this.handle.asElement(), (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this.parentPage));
17
17
  }
18
18
  jsonValue() {
19
19
  return this.handle.jsonValue();
20
20
  }
21
21
  async getProperty(propertyName) {
22
- return utils_1.mapIfNotNull(await this.handle.getProperty(propertyName), (handle) => new PuppeteerJsHandle(handle, this.parentPage));
22
+ return (0, utils_1.mapIfNotNull)(await this.handle.getProperty(propertyName), (handle) => new PuppeteerJsHandle(handle, this.parentPage));
23
23
  }
24
24
  evaluate(pageFunction, arg) {
25
25
  return this.handle.evaluate(pageFunction, PuppeteerJsHandle.unwrapProperties(arg));