@mablhq/mabl-cli 1.16.16 → 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 (126) 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 +24 -13
  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 +34 -38
  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 +56 -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/pdf-viewer/embeddedPdfDetection.js +19 -8
  117. package/resources/popupDismissal.js +1 -1
  118. package/util/RichPromise.js +1 -0
  119. package/util/actionabilityUtil.js +18 -14
  120. package/util/analytics.js +7 -3
  121. package/util/downloadUtil.js +6 -2
  122. package/util/httpUtil.js +6 -2
  123. package/util/logUtils.js +7 -1
  124. package/util/markdownUtil.js +1 -1
  125. package/util/pureUtil.js +5 -1
  126. package/util/resourceUtil.js +5 -1
@@ -107,7 +107,8 @@ exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS = [
107
107
  'username',
108
108
  ];
109
109
  const ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET = new Set(exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS);
110
- exports.isAllowedAssertableUrlAttrProps = (x) => ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET.has(x);
110
+ const isAllowedAssertableUrlAttrProps = (x) => ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET.has(x);
111
+ exports.isAllowedAssertableUrlAttrProps = isAllowedAssertableUrlAttrProps;
111
112
  exports.ALLOWED_ASSERTABLE_EMAIL_ATTRS_PROPS = [
112
113
  'from',
113
114
  'subject',
@@ -4,6 +4,7 @@ exports.buildObjectString = exports.buildSourceRepresentationOfObject = exports.
4
4
  const MablAction_1 = require("./MablAction");
5
5
  const SeleniumIdeStep_1 = require("./steps/SeleniumIdeStep");
6
6
  const MablSymbol_1 = require("./MablSymbol");
7
+ const domUtil_1 = require("../domUtil");
7
8
  class MablStep extends MablAction_1.MablAction {
8
9
  constructor(name, args, actions) {
9
10
  super(name, args);
@@ -37,7 +38,7 @@ class MablStep extends MablAction_1.MablAction {
37
38
  if (argument instanceof MablSymbol_1.MablSymbol) {
38
39
  return argument.name;
39
40
  }
40
- if (MablAction_1.argumentIsMablVariable(argument)) {
41
+ if ((0, MablAction_1.argumentIsMablVariable)(argument)) {
41
42
  const matches = argument.match(MablSymbol_1.SINGLE_VARIABLE_PATTERN_REGEX);
42
43
  if (matches) {
43
44
  return matches[1];
@@ -83,7 +84,7 @@ class MablStep extends MablAction_1.MablAction {
83
84
  return formatted;
84
85
  }
85
86
  produceSelIdeFormattedSteps(_stepIndex) {
86
- const selIdeEcho = SeleniumIdeStep_1.buildSeleniumIdeStep('echo');
87
+ const selIdeEcho = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo');
87
88
  const unSupportedStepMessage = `[${this.getStepName()}] Step is not supported for Selenium IDE export`;
88
89
  selIdeEcho.comment = unSupportedStepMessage;
89
90
  selIdeEcho.target = unSupportedStepMessage;
@@ -124,7 +125,7 @@ function buildSourceRepresentationOfObject(object) {
124
125
  if (typeof value === 'number') {
125
126
  return `${key}: ${value}`;
126
127
  }
127
- return `${key}: "${escapeMablscriptString(value)}"`;
128
+ return `${key}: "${(0, domUtil_1.escapeMablscriptString)(value)}"`;
128
129
  }
129
130
  return `${key}: ${buildSourceRepresentationOfObject(value)}`;
130
131
  });
@@ -140,14 +141,14 @@ function buildObjectString(objectString) {
140
141
  return final;
141
142
  }
142
143
  if (typeof objectString[key] === 'string') {
143
- return final.push(`${key}: "${escapeMablscriptString(objectString[key])}"`);
144
+ return final.push(`${key}: "${(0, domUtil_1.escapeMablscriptString)(objectString[key])}"`);
144
145
  }
145
146
  else if (typeof objectString[key] === 'number') {
146
147
  return final.push(`${key}: ${objectString[key]}`);
147
148
  }
148
149
  else if (Array.isArray(objectString[key])) {
149
150
  return final.push(`"${key}": [${objectString[key]
150
- .map((arrayVal) => `"${escapeMablscriptString(arrayVal)}"`)
151
+ .map((arrayVal) => `"${(0, domUtil_1.escapeMablscriptString)(arrayVal)}"`)
151
152
  .join(', ')}]`);
152
153
  }
153
154
  return final.push(`${key}: {${buildObjectString(objectString[key])}}`);
@@ -155,10 +156,3 @@ function buildObjectString(objectString) {
155
156
  return final;
156
157
  }
157
158
  exports.buildObjectString = buildObjectString;
158
- function escapeMablscriptString(unescapedString) {
159
- return unescapedString
160
- .replace(/\\/g, '\\\\')
161
- .replace(/\n/g, '\\n')
162
- .replace(/"/g, '\\"')
163
- .replace(/\r/g, '');
164
- }
@@ -35,7 +35,7 @@ class ConditionAction extends MablAction_1.MablAction {
35
35
  return {
36
36
  conditionType: ConditionDescriptor_1.ConditionType.Comparison,
37
37
  comparisonType: ConditionDescriptor_1.ComparisonType.fromString(this.conditionAttribute),
38
- comparatorValue: MablAction_1.parseArgument(this.conditionValueAttribute),
38
+ comparatorValue: (0, MablAction_1.parseArgument)(this.conditionValueAttribute),
39
39
  };
40
40
  }
41
41
  getEvaluatePresence() {
@@ -19,16 +19,16 @@ class FindAction extends MablAction_1.MablAction {
19
19
  constructor(name, args) {
20
20
  super(name, args);
21
21
  const actionName = this.getActionName();
22
- if (!mablscriptFind_1.isFindType(actionName)) {
22
+ if (!(0, mablscriptFind_1.isFindType)(actionName)) {
23
23
  throw new Error(`Unknown find type for action: ${actionName}`);
24
24
  }
25
25
  const findType = mablscriptFind_1.FindType.fromString(actionName);
26
26
  const [selectors, options] = this.getActionArgs();
27
- const error = new Error(`Unexpected arguments for ${findType} action: ${JSON.stringify(this.getActionArgs())}`);
27
+ this.isValid = true;
28
28
  switch (findType) {
29
29
  case mablscriptFind_1.FindType.FIND_ONE:
30
30
  if (!isElementSelector(selectors)) {
31
- throw error;
31
+ this.isValid = false;
32
32
  }
33
33
  const [target, ancestor] = Array.isArray(selectors)
34
34
  ? [...selectors]
@@ -41,7 +41,7 @@ class FindAction extends MablAction_1.MablAction {
41
41
  findType,
42
42
  findTarget,
43
43
  };
44
- if (mablscriptFind_1.isFindOptions(options)) {
44
+ if ((0, mablscriptFind_1.isFindOptions)(options)) {
45
45
  this.findDescriptor.findOptions = options;
46
46
  }
47
47
  break;
@@ -49,8 +49,8 @@ class FindAction extends MablAction_1.MablAction {
49
49
  case mablscriptFind_1.FindType.FIND_LAST:
50
50
  case mablscriptFind_1.FindType.FIND_ANY:
51
51
  case mablscriptFind_1.FindType.FIND_ALL:
52
- if (!mablscriptFind_1.isCssSelector(selectors) && !mablscriptFind_1.isXPathSelector(selectors)) {
53
- throw error;
52
+ if (!(0, mablscriptFind_1.isCssSelector)(selectors) && !(0, mablscriptFind_1.isXPathSelector)(selectors)) {
53
+ this.isValid = false;
54
54
  }
55
55
  this.findDescriptor = {
56
56
  findType,
@@ -58,8 +58,8 @@ class FindAction extends MablAction_1.MablAction {
58
58
  };
59
59
  break;
60
60
  case mablscriptFind_1.FindType.FIND_COOKIE:
61
- if (!mablscriptFind_1.isCookieSelector(selectors)) {
62
- throw error;
61
+ if (!(0, mablscriptFind_1.isCookieSelector)(selectors)) {
62
+ this.isValid = false;
63
63
  }
64
64
  this.findDescriptor = {
65
65
  findType,
@@ -67,8 +67,8 @@ class FindAction extends MablAction_1.MablAction {
67
67
  };
68
68
  break;
69
69
  case mablscriptFind_1.FindType.FIND_EMAIL:
70
- if (!mablscriptFind_1.isEmailSelector(selectors)) {
71
- throw error;
70
+ if (!(0, mablscriptFind_1.isEmailSelector)(selectors)) {
71
+ this.isValid = false;
72
72
  }
73
73
  this.findDescriptor = {
74
74
  findType,
@@ -76,8 +76,8 @@ class FindAction extends MablAction_1.MablAction {
76
76
  };
77
77
  break;
78
78
  case mablscriptFind_1.FindType.FIND_TAB:
79
- if (selectors !== 'initial' && !mablscriptFind_1.isTabSelector(selectors)) {
80
- throw error;
79
+ if (selectors !== 'initial' && !(0, mablscriptFind_1.isTabSelector)(selectors)) {
80
+ this.isValid = false;
81
81
  }
82
82
  this.findDescriptor = {
83
83
  findType,
@@ -143,7 +143,7 @@ class FindAction extends MablAction_1.MablAction {
143
143
  case mablscriptFind_1.FindType.FIND_LAST:
144
144
  case mablscriptFind_1.FindType.FIND_ANY:
145
145
  case mablscriptFind_1.FindType.FIND_ALL:
146
- if (mablscriptFind_1.isCssSelector(this.findDescriptor.findTarget)) {
146
+ if ((0, mablscriptFind_1.isCssSelector)(this.findDescriptor.findTarget)) {
147
147
  return `css=${this.findDescriptor.findTarget.css_query}`;
148
148
  }
149
149
  return `xpath=${this.findDescriptor.findTarget.xpath}`;
@@ -162,15 +162,16 @@ class FindAction extends MablAction_1.MablAction {
162
162
  case mablscriptFind_1.FindType.FIND_ONE: {
163
163
  const find = this.findDescriptor;
164
164
  const action = find.findType;
165
- const selectors = ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length) ? '[' +
166
- [
167
- find.findTarget.selector,
168
- ...find.findTarget.auxiliaryDescriptors.map((descriptor) => descriptor.selector),
169
- ]
170
- .map(buildElementSelectorString)
171
- .join(', ') +
172
- ']'
173
- : buildElementSelectorString(find.findTarget.selector);
165
+ const selectors = ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length)
166
+ ? '[' +
167
+ [
168
+ find.findTarget.selector,
169
+ ...find.findTarget.auxiliaryDescriptors.map((descriptor) => descriptor.selector),
170
+ ]
171
+ .map(mablscriptFind_1.buildElementSelectorString)
172
+ .join(', ') +
173
+ ']'
174
+ : (0, mablscriptFind_1.buildElementSelectorString)(find.findTarget.selector);
174
175
  const options = buildFindOptionsString(find.findOptions);
175
176
  const args = [selectors, options].filter((str) => str).join(', ');
176
177
  return `${action}(${args})`;
@@ -183,18 +184,21 @@ class FindAction extends MablAction_1.MablAction {
183
184
  case mablscriptFind_1.FindType.FIND_EMAIL: {
184
185
  const find = this.findDescriptor;
185
186
  const action = find.findType;
186
- const args = buildElementSelectorString(find.findTarget);
187
+ const args = (0, mablscriptFind_1.buildElementSelectorString)(find.findTarget);
187
188
  return `${action}(${args})`;
188
189
  }
189
190
  case mablscriptFind_1.FindType.FIND_TAB:
190
191
  if (this.findDescriptor.findTarget === 'initial') {
191
192
  return `${this.findDescriptor.findType}("${this.findDescriptor.findTarget}")`;
192
193
  }
193
- return `${this.findDescriptor.findType}(${buildElementSelectorString(this.findDescriptor.findTarget)})`;
194
+ return `${this.findDescriptor.findType}(${(0, mablscriptFind_1.buildElementSelectorString)(this.findDescriptor.findTarget)})`;
194
195
  default:
195
196
  throw new Error(`Error generating mablscript: Unexpected find type in ${JSON.stringify(this.findDescriptor)}`);
196
197
  }
197
198
  }
199
+ isValidDescriptor() {
200
+ return this.isValid;
201
+ }
198
202
  }
199
203
  exports.FindAction = FindAction;
200
204
  FindAction.mablScriptStepNames = [
@@ -223,35 +227,27 @@ function buildFindOptionsString(findOptions) {
223
227
  }
224
228
  let findOptionsFinal = '{';
225
229
  if (findOptions.hints) {
226
- findOptionsFinal += `hints: {${MablStep_1.buildObjectString(findOptions.hints).join(', ')}}`;
230
+ findOptionsFinal += `hints: {${(0, MablStep_1.buildObjectString)(findOptions.hints).join(', ')}}`;
227
231
  }
228
232
  if (findOptions.waitUntil) {
229
- findOptionsFinal += `waitUntil: {${MablStep_1.buildObjectString(findOptions.waitUntil)}}`;
233
+ findOptionsFinal += `waitUntil: {${(0, MablStep_1.buildObjectString)(findOptions.waitUntil)}}`;
230
234
  }
231
235
  findOptionsFinal += '}';
232
236
  return findOptionsFinal;
233
237
  }
234
- function buildElementSelectorString(selectorObject) {
235
- const findInfoList = MablStep_1.buildObjectString(selectorObject);
236
- if (!findInfoList.find((info) => info.includes('selector_type'))) {
237
- findInfoList.push('selector_type: "element"');
238
- }
239
- findInfoList.sort();
240
- return `{${findInfoList.join(', ')}}`;
241
- }
242
238
  function isElementSelector(maybeSelectors) {
243
239
  const [target, ancestor] = Array.isArray(maybeSelectors)
244
240
  ? [...maybeSelectors]
245
241
  : [maybeSelectors];
246
- const validTarget = mablscriptFind_1.isStandardSelector(target) || mablscriptFind_1.isNormalizedFindDescriptor(target);
242
+ const validTarget = (0, mablscriptFind_1.isStandardSelector)(target) || (0, mablscriptFind_1.isNormalizedFindDescriptor)(target);
247
243
  const validAncestor = !ancestor ||
248
- mablscriptFind_1.isStandardSelector(ancestor) ||
249
- mablscriptFind_1.isNormalizedFindDescriptor(ancestor);
244
+ (0, mablscriptFind_1.isStandardSelector)(ancestor) ||
245
+ (0, mablscriptFind_1.isNormalizedFindDescriptor)(ancestor);
250
246
  return !!(validTarget && validAncestor);
251
247
  }
252
248
  exports.isElementSelector = isElementSelector;
253
249
  function normalize(maybeFindDescriptor) {
254
- if (mablscriptFind_1.isNormalizedFindDescriptor(maybeFindDescriptor)) {
250
+ if ((0, mablscriptFind_1.isNormalizedFindDescriptor)(maybeFindDescriptor)) {
255
251
  return { ...maybeFindDescriptor };
256
252
  }
257
253
  return { selector: maybeFindDescriptor };
@@ -11,7 +11,7 @@ class GetUrlAction extends MablAction_1.MablAction {
11
11
  return `get_current_location()`;
12
12
  }
13
13
  toDescriptor() {
14
- return GetCurrentLocationDescriptor_1.newGetCurrentLocationDescriptor();
14
+ return (0, GetCurrentLocationDescriptor_1.newGetCurrentLocationDescriptor)();
15
15
  }
16
16
  generateMablscriptFindOne() {
17
17
  return 'get_current_location()';
@@ -17,7 +17,7 @@ class GetVariableValue extends MablAction_1.MablAction {
17
17
  return `get_variable_value(${this.subVariable(this.variable.toString())})`;
18
18
  }
19
19
  toDescriptor() {
20
- return GetVariableDescriptor_1.newGetVariableDescriptor(this.variable);
20
+ return (0, GetVariableDescriptor_1.newGetVariableDescriptor)(this.variable);
21
21
  }
22
22
  generateMablscriptFindOne() {
23
23
  return `get_variable_value(${this.variable.name})`;
@@ -75,7 +75,7 @@ class JavaScriptAction extends MablAction_1.MablAction {
75
75
  }
76
76
  static fromDescriptor(descriptor) {
77
77
  const { javaScript } = descriptor;
78
- if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(javaScript)) {
78
+ if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(javaScript)) {
79
79
  return new JavaScriptAction(JavaScriptAction.mablscriptName, [
80
80
  {
81
81
  id: javaScript.snippetId,
@@ -84,20 +84,20 @@ class JavaScriptAction extends MablAction_1.MablAction {
84
84
  { parameter_overrides: javaScript.parameterOverrides },
85
85
  ]);
86
86
  }
87
- else if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(javaScript)) {
87
+ else if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(javaScript)) {
88
88
  return new JavaScriptAction(JavaScriptAction.mablscriptName, [
89
89
  javaScript.inlineSnippet,
90
90
  { parameter_overrides: javaScript.parameterOverrides },
91
91
  ]);
92
92
  }
93
- else if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(javaScript)) {
93
+ else if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(javaScript)) {
94
94
  return new JavaScriptAction(JavaScriptAction.mablscriptName, [
95
95
  {
96
96
  id: javaScript.snippetInvariantId,
97
97
  },
98
98
  ]);
99
99
  }
100
- else if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(javaScript)) {
100
+ else if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(javaScript)) {
101
101
  return new JavaScriptAction(JavaScriptAction.mablscriptName, [
102
102
  javaScript.encodedJS,
103
103
  ]);
@@ -106,19 +106,19 @@ class JavaScriptAction extends MablAction_1.MablAction {
106
106
  }
107
107
  toYaml() {
108
108
  const actionYaml = {};
109
- if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(this.javaScript)) {
109
+ if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(this.javaScript)) {
110
110
  actionYaml.snippetId = this.javaScript.snippetId;
111
111
  actionYaml.snippetInvariantId = this.javaScript.snippetInvariantId;
112
112
  actionYaml.parameterOverrides = this.javaScript.parameterOverrides;
113
113
  }
114
- else if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(this.javaScript)) {
114
+ else if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(this.javaScript)) {
115
115
  actionYaml.snippet = this.javaScript.inlineSnippet;
116
116
  actionYaml.parameterOverrides = this.javaScript.parameterOverrides;
117
117
  }
118
- else if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(this.javaScript)) {
118
+ else if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(this.javaScript)) {
119
119
  actionYaml.snippetId = this.javaScript.snippetInvariantId;
120
120
  }
121
- else if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(this.javaScript)) {
121
+ else if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(this.javaScript)) {
122
122
  actionYaml.code = this.javaScript.encodedJS;
123
123
  }
124
124
  else {
@@ -160,27 +160,27 @@ class JavaScriptAction extends MablAction_1.MablAction {
160
160
  return new JavaScriptAction(MABLSCRIPT_NAME, args);
161
161
  }
162
162
  toMablscript() {
163
- if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(this.javaScript)) {
164
- const snippetReference = domUtil_1.buildStepArgumentString({
163
+ if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(this.javaScript)) {
164
+ const snippetReference = (0, domUtil_1.buildStepArgumentString)({
165
165
  id: this.javaScript.snippetId,
166
166
  invariant_id: this.javaScript.snippetInvariantId,
167
167
  snippet_type: 'javascript',
168
168
  });
169
- const snippetOptions = `, {parameter_overrides: ${domUtil_1.buildStepArgumentString(this.javaScript.parameterOverrides)}}`;
169
+ const snippetOptions = `, {parameter_overrides: ${(0, domUtil_1.buildStepArgumentString)(this.javaScript.parameterOverrides)}}`;
170
170
  return `evaluate_js(${snippetReference}${snippetOptions})`;
171
171
  }
172
- if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(this.javaScript)) {
173
- const snippetReference = domUtil_1.buildStepArgumentString({
172
+ if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(this.javaScript)) {
173
+ const snippetReference = (0, domUtil_1.buildStepArgumentString)({
174
174
  ...this.javaScript.inlineSnippet,
175
175
  snippet_type: 'javascript',
176
176
  });
177
- const snippetOptions = `, {parameter_overrides: ${domUtil_1.buildStepArgumentString(this.javaScript.parameterOverrides)}}`;
177
+ const snippetOptions = `, {parameter_overrides: ${(0, domUtil_1.buildStepArgumentString)(this.javaScript.parameterOverrides)}}`;
178
178
  return `evaluate_js(${snippetReference}${snippetOptions})`;
179
179
  }
180
- if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(this.javaScript)) {
180
+ if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(this.javaScript)) {
181
181
  return `evaluate_js({id: "${this.javaScript.snippetInvariantId}", snippet_type: "javascript"})`;
182
182
  }
183
- if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(this.javaScript)) {
183
+ if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(this.javaScript)) {
184
184
  return `evaluate_js("${this.javaScript.encodedJS}")`;
185
185
  }
186
186
  throw new Error(`Cannot export action to mablscript: ${JSON.stringify(this.javaScript)}`);
@@ -99,10 +99,10 @@ const StepTypes = [
99
99
  WaitStep_1.WaitStep,
100
100
  ];
101
101
  function parseMablScript(mablscript) {
102
- const ast = esprima_1.parseScript(mablscript, { loc: true });
102
+ const ast = (0, esprima_1.parseScript)(mablscript, { loc: true });
103
103
  const stepStack = {};
104
104
  let stepLine = 0;
105
- estraverse_1.traverse(ast, {
105
+ (0, estraverse_1.traverse)(ast, {
106
106
  enter(node) {
107
107
  switch (node.type) {
108
108
  case 'ExpressionStatement':
@@ -161,7 +161,7 @@ function loadMablScriptIntoSteps(parsedMablscript) {
161
161
  exports.loadMablScriptIntoSteps = loadMablScriptIntoSteps;
162
162
  function yamlifyTheLoadedSteps(translatedSteps, fullLocatorsOn = true) {
163
163
  const steps = translatedSteps.map((step) => step.getFormattedStep(fullLocatorsOn));
164
- return js_yaml_1.dump(steps);
164
+ return (0, js_yaml_1.dump)(steps);
165
165
  }
166
166
  exports.yamlifyTheLoadedSteps = yamlifyTheLoadedSteps;
167
167
  const yamlMablscriptToObjectsStepMap = {};
@@ -169,7 +169,7 @@ StepTypes.forEach((step) => {
169
169
  step.yamlMablScriptNames.forEach((name) => (yamlMablscriptToObjectsStepMap[name] = step.fromYaml));
170
170
  });
171
171
  function loadYamlSteps(yamlSteps) {
172
- const loadedStepData = js_yaml_1.safeLoad(yamlSteps);
172
+ const loadedStepData = (0, js_yaml_1.safeLoad)(yamlSteps);
173
173
  return loadedStepData.map((stepObject) => {
174
174
  const stepName = Object.keys(stepObject)[0];
175
175
  const stepArgs = stepObject[stepName];
@@ -239,19 +239,19 @@ function getArgumentsFromCallExpressionArgs(expressionArguments) {
239
239
  break;
240
240
  case 'Identifier':
241
241
  const singleIdentifier = expressionArg;
242
- expressionArgs.push(MablSymbol_1.formatSymbol(singleIdentifier.name));
242
+ expressionArgs.push((0, MablSymbol_1.formatSymbol)(singleIdentifier.name));
243
243
  break;
244
244
  case 'MemberExpression':
245
245
  const memberExpression = expressionArg;
246
246
  if (expressionArg.object.type === 'MemberExpression') {
247
247
  const chainedVariableExpression = memberExpressionChainBuilder(memberExpression);
248
248
  const property = memberExpression.property;
249
- expressionArgs.push(MablSymbol_1.formatSymbol(`${chainedVariableExpression}.${property.name}`));
249
+ expressionArgs.push((0, MablSymbol_1.formatSymbol)(`${chainedVariableExpression}.${property.name}`));
250
250
  }
251
251
  else {
252
252
  const identifier = memberExpression.object;
253
253
  const property = memberExpression.property;
254
- expressionArgs.push(MablSymbol_1.formatSymbol(`${identifier.name}.${property.name}`));
254
+ expressionArgs.push((0, MablSymbol_1.formatSymbol)(`${identifier.name}.${property.name}`));
255
255
  }
256
256
  break;
257
257
  case 'ObjectExpression':
@@ -85,8 +85,10 @@ class AccessibilityCheckStep extends MablStep_1.MablStep {
85
85
  toMablscript() {
86
86
  var _a, _b, _c;
87
87
  let argString = '';
88
- if (((_a = this.checkConfig) === null || _a === void 0 ? void 0 : _a.tags) || ((_b = this.checkConfig) === null || _b === void 0 ? void 0 : _b.disabledRules) || ((_c = this.checkConfig) === null || _c === void 0 ? void 0 : _c.rules)) {
89
- argString = `{${MablStep_1.buildObjectString(this.checkConfig)}}`;
88
+ if (((_a = this.checkConfig) === null || _a === void 0 ? void 0 : _a.tags) ||
89
+ ((_b = this.checkConfig) === null || _b === void 0 ? void 0 : _b.disabledRules) ||
90
+ ((_c = this.checkConfig) === null || _c === void 0 ? void 0 : _c.rules)) {
91
+ argString = `{${(0, MablStep_1.buildObjectString)(this.checkConfig)}}`;
90
92
  }
91
93
  let findAction = '';
92
94
  if (this.findAction) {
@@ -78,7 +78,7 @@ class AssertStep extends MablStep_1.MablStep {
78
78
  determineIfWaitUntilStep() {
79
79
  var _a, _b;
80
80
  const find = this.primaryAction.toDescriptor();
81
- if (mablscriptFind_1.isFindElementDescriptor(find)) {
81
+ if ((0, mablscriptFind_1.isFindElementDescriptor)(find)) {
82
82
  if ((_b = (_a = find.findOptions) === null || _a === void 0 ? void 0 : _a.waitUntil) === null || _b === void 0 ? void 0 : _b.timeoutSeconds) {
83
83
  return true;
84
84
  }
@@ -129,7 +129,7 @@ class AssertStep extends MablStep_1.MablStep {
129
129
  formatted.assertionValue = this.assertionValue;
130
130
  }
131
131
  const find = this.primaryAction.toDescriptor();
132
- if (GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) || GetVariableDescriptor_1.isGetVariableDescriptor(find)) {
132
+ if ((0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) || (0, GetVariableDescriptor_1.isGetVariableDescriptor)(find)) {
133
133
  }
134
134
  else {
135
135
  switch (find.findType) {
@@ -185,8 +185,8 @@ class AssertStep extends MablStep_1.MablStep {
185
185
  }
186
186
  produceSelIdeFormattedSteps(stepIndex) {
187
187
  const find = this.primaryAction.toDescriptor();
188
- if (!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) &&
189
- !GetVariableDescriptor_1.isGetVariableDescriptor(find) &&
188
+ if (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
189
+ !(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
190
190
  (find.findType === mablscriptFind_1.FindType.FIND_EMAIL ||
191
191
  find.findType === mablscriptFind_1.FindType.FIND_COOKIE)) {
192
192
  return [this.unsupportedSelIdeExportStep()];
@@ -198,7 +198,7 @@ class AssertStep extends MablStep_1.MablStep {
198
198
  if (this.primaryAction instanceof GetVariableValue_1.GetVariableValue) {
199
199
  throw new Error('Invalid state. You cannot assert presence against variable properties.');
200
200
  }
201
- const assertPresentStep = SeleniumIdeStep_1.buildSeleniumIdeStep('assertElementPresent', this);
201
+ const assertPresentStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('assertElementPresent', this);
202
202
  assertPresentStep.target = this.primaryAction.getSelIdeTarget();
203
203
  return [assertPresentStep];
204
204
  }
@@ -209,21 +209,21 @@ class AssertStep extends MablStep_1.MablStep {
209
209
  if (this.primaryAction instanceof GetVariableValue_1.GetVariableValue) {
210
210
  throw new Error('Invalid state. You cannot assert presence against variable properties.');
211
211
  }
212
- const assertNotPresentStep = SeleniumIdeStep_1.buildSeleniumIdeStep('assertElementNotPresent', this);
212
+ const assertNotPresentStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('assertElementNotPresent', this);
213
213
  assertNotPresentStep.target = this.primaryAction.getSelIdeTarget();
214
214
  return [assertNotPresentStep];
215
215
  }
216
- return buildSeleniumIdeJsAssertion(stepIndex, (!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) &&
217
- !GetVariableDescriptor_1.isGetVariableDescriptor(find) &&
216
+ return buildSeleniumIdeJsAssertion(stepIndex, (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
217
+ !(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
218
218
  find.findType === mablscriptFind_1.FindType.FIND_ONE &&
219
219
  find.findTarget.selector.xpath) ||
220
220
  '', this.extractAction ? this.extractAction.extractionAttribute : '', this.substituteSeleniumVariable(this.conditionAction.conditionValueAttribute || ''), this.assertionType, this);
221
221
  }
222
222
  unsupportedSelIdeExportStep() {
223
- const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
223
+ const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
224
224
  const findDescriptor = this.primaryAction.toDescriptor();
225
- seleniumStep.value = `[${this.getStepName()}] step with find type [${FindAction_1.findTypesToFormattedType[(!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(findDescriptor) &&
226
- !GetVariableDescriptor_1.isGetVariableDescriptor(findDescriptor) &&
225
+ seleniumStep.value = `[${this.getStepName()}] step with find type [${FindAction_1.findTypesToFormattedType[(!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(findDescriptor) &&
226
+ !(0, GetVariableDescriptor_1.isGetVariableDescriptor)(findDescriptor) &&
227
227
  findDescriptor.findType) ||
228
228
  'unknown']} is not supported for Selenium IDE export`;
229
229
  return seleniumStep;
@@ -253,11 +253,11 @@ function buildSeleniumIdeJsAssertion(stepIndex, xpath, assertionAttribute, asser
253
253
  const variableName = `assertVariable-${stepIndex}`;
254
254
  let storeAttribute;
255
255
  if (assertionAttribute !== 'innerText') {
256
- storeAttribute = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', step);
256
+ storeAttribute = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', step);
257
257
  storeAttribute.target = `return document.evaluate('${xpath}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue['${assertionAttribute}']`;
258
258
  }
259
259
  else {
260
- storeAttribute = SeleniumIdeStep_1.buildSeleniumIdeStep('storeText', step);
260
+ storeAttribute = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeText', step);
261
261
  storeAttribute.target = `xpath=${xpath}`;
262
262
  }
263
263
  storeAttribute.value = variableName;
@@ -300,10 +300,10 @@ function buildSeleniumIdeJsAssertion(stepIndex, xpath, assertionAttribute, asser
300
300
  condition = `!\${${variableName}} <= '${assertAgainst}'`;
301
301
  break;
302
302
  }
303
- const ifStep = SeleniumIdeStep_1.buildSeleniumIdeStep('if', step);
303
+ const ifStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('if', step);
304
304
  ifStep.target = condition;
305
- const throwError = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', step);
305
+ const throwError = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', step);
306
306
  throwError.target = `throw new Error('${exports.fieldToAssertionStep[assertionType]} step failure')`;
307
- const endStep = SeleniumIdeStep_1.buildSeleniumIdeStep('end', step);
307
+ const endStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('end', step);
308
308
  return [storeAttribute, ifStep, throwError, endStep];
309
309
  }
@@ -84,8 +84,8 @@ class AssertStepOld extends MablStep_1.MablStep {
84
84
  return formatted;
85
85
  }
86
86
  getNewAssertionStep() {
87
- const yamlified = importer_1.yamlifyTheLoadedSteps([this]);
88
- const reloadedSteps = importer_1.loadYamlSteps(yamlified);
87
+ const yamlified = (0, importer_1.yamlifyTheLoadedSteps)([this]);
88
+ const reloadedSteps = (0, importer_1.loadYamlSteps)(yamlified);
89
89
  const result = reloadedSteps[0];
90
90
  if (this.stepSourceIndexInFlow !== undefined) {
91
91
  result.setStepSourceIndexInFlow(this.stepSourceIndexInFlow);
@@ -38,7 +38,7 @@ class ClickStep extends MablStep_1.MablStep {
38
38
  };
39
39
  }
40
40
  produceSelIdeFormattedSteps(_stepIndex) {
41
- const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('click', this);
41
+ const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('click', this);
42
42
  seleniumStep.target = this.findAction.getSelIdeTarget();
43
43
  return [seleniumStep];
44
44
  }
@@ -156,10 +156,10 @@ class CreateVariableStep extends MablStep_1.MablStep {
156
156
  switch (this.generationType) {
157
157
  case CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE:
158
158
  if (this.actions[1].extractionAttribute === 'innerText') {
159
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('storeText', this);
159
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeText', this);
160
160
  }
161
161
  else {
162
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('storeAttribute', this);
162
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeAttribute', this);
163
163
  }
164
164
  seleniumStep.target = this.actions[0].getSelIdeTarget();
165
165
  seleniumStep.value = this.variableName;
@@ -176,20 +176,20 @@ class CreateVariableStep extends MablStep_1.MablStep {
176
176
  return `\${Math.round((Math.pow(36, ${length} + 1) - Math.random() * Math.pow(36, ${length}))).toString(36).slice(1)}`;
177
177
  });
178
178
  const executeScript = 'return ' + '`' + translated + '`';
179
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', this);
179
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', this);
180
180
  seleniumStep.target = executeScript;
181
181
  seleniumStep.value = this.variableName;
182
182
  return [seleniumStep];
183
183
  case CreateVariableStepDescriptor_1.VariableGenerator.EMAIL:
184
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
184
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
185
185
  seleniumStep.value = `Generate email address for variable name '${this.variableName} is not supported for Selenium IDE export`;
186
186
  return [seleniumStep];
187
187
  case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
188
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
188
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
189
189
  seleniumStep.value = `Find and store count of elements for variable name '${this.variableName} is not supported for Selenium IDE export`;
190
190
  return [seleniumStep];
191
191
  case CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT:
192
- seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
192
+ seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
193
193
  seleniumStep.value = `[${this.getStepName()}${this.actions[0].javaScript
194
194
  ? ' from JavaScript'
195
195
  : ''}] step for variable name '${this.variableName} is not supported for Selenium IDE export`;
@@ -47,7 +47,7 @@ class DoubleClickStep extends MablStep_1.MablStep {
47
47
  return new DoubleClickStep('double_click', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
48
48
  }
49
49
  produceSelIdeFormattedSteps(_stepIndex) {
50
- const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('doubleClick', this);
50
+ const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('doubleClick', this);
51
51
  seleniumStep.target = this.findAction.getSelIdeTarget();
52
52
  return [seleniumStep];
53
53
  }
@@ -7,7 +7,7 @@ const MablAction_1 = require("../MablAction");
7
7
  class EchoStep extends MablStep_1.MablStep {
8
8
  constructor(name, args, actions) {
9
9
  super(name, args, actions);
10
- this.echoValue = MablAction_1.parseArgument(this.getActionArgs()[0]);
10
+ this.echoValue = (0, MablAction_1.parseArgument)(this.getActionArgs()[0]);
11
11
  }
12
12
  getStepName() {
13
13
  return 'Echo';
@@ -16,7 +16,7 @@ class EchoStep extends MablStep_1.MablStep {
16
16
  return { value: this.echoValue.toString() };
17
17
  }
18
18
  produceSelIdeFormattedSteps(_stepIndex) {
19
- const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
19
+ const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
20
20
  seleniumStep.target = this.substituteSeleniumVariable(this.echoValue);
21
21
  return [seleniumStep];
22
22
  }