@mablhq/mabl-cli 1.17.0 → 1.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/api/basicApiClient.js +7 -1
  2. package/api/featureSet.js +1 -4
  3. package/api/mablApiClient.js +3 -3
  4. package/browserLauncher/browserLauncherFactory.js +2 -3
  5. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +3 -0
  6. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +11 -9
  7. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +1 -11
  8. package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +18 -0
  9. package/browserLauncher/runnerType.js +0 -1
  10. package/commands/constants.js +3 -2
  11. package/commands/tests/testsUtil.js +11 -6
  12. package/commands/tests/tests_cmds/run.js +5 -0
  13. package/domUtil/index.js +1 -1
  14. package/domUtil/index.js.LICENSE.txt +5 -5
  15. package/execution/index.js +1 -1
  16. package/execution/index.js.LICENSE.txt +7 -5
  17. package/index.d.ts +0 -1
  18. package/mablscript/MablAction.js +1 -1
  19. package/mablscript/MablStep.js +21 -3
  20. package/mablscript/actions/AwaitPDFDownloadAction.js +2 -1
  21. package/mablscript/actions/ConditionAction.js +11 -3
  22. package/mablscript/actions/ExtractAction.js +16 -7
  23. package/mablscript/actions/FindAction.js +101 -69
  24. package/mablscript/actions/GenerateRandomStringAction.js +2 -1
  25. package/mablscript/actions/GetUrlAction.js +1 -1
  26. package/mablscript/actions/GetVariableValue.js +2 -2
  27. package/mablscript/diffing/diffingUtil.js +146 -0
  28. package/mablscript/importer.js +20 -2
  29. package/mablscript/steps/AccessibilityCheck.js +5 -5
  30. package/mablscript/steps/AssertStep.js +45 -31
  31. package/mablscript/steps/AssertStepOld.js +39 -21
  32. package/mablscript/steps/AwaitTabStep.js +7 -6
  33. package/mablscript/steps/ClickAndHoldStep.js +6 -6
  34. package/mablscript/steps/ClickStep.js +5 -5
  35. package/mablscript/steps/CreateVariableStep.js +2 -2
  36. package/mablscript/steps/DoubleClickStep.js +6 -6
  37. package/mablscript/steps/DownloadStep.js +3 -2
  38. package/mablscript/steps/EchoStep.js +3 -1
  39. package/mablscript/steps/ElseIfConditionStep.js +5 -2
  40. package/mablscript/steps/EnterTextStep.js +11 -8
  41. package/mablscript/steps/EvaluateFlowStep.js +40 -0
  42. package/mablscript/steps/HoverStep.js +5 -5
  43. package/mablscript/steps/IfConditionStep.js +6 -6
  44. package/mablscript/steps/ReleaseStep.js +7 -6
  45. package/mablscript/steps/RemoveCookieStep.js +2 -3
  46. package/mablscript/steps/SelectStep.js +5 -5
  47. package/mablscript/steps/SendHttpRequestStep.js +3 -3
  48. package/mablscript/steps/SendKeyStep.js +8 -8
  49. package/mablscript/steps/SetCookieStep.js +2 -4
  50. package/mablscript/steps/SetFilesStep.js +5 -5
  51. package/mablscript/steps/SetViewportStep.js +1 -1
  52. package/mablscript/steps/SwitchContextStep.js +3 -3
  53. package/mablscript/steps/VisitUrlStep.js +2 -1
  54. package/mablscript/steps/WaitStep.js +1 -4
  55. package/mablscript/steps/WaitUntilStep.js +3 -3
  56. package/{browserLauncher/puppeteerBrowserLauncher/internals.js → mablscript/types/EvaluateFlowStepDescriptor.js} +0 -0
  57. package/mablscript/types/GetCurrentLocationDescriptor.js +4 -3
  58. package/mablscriptFind/index.js +1 -1
  59. package/mablscriptFind/index.js.LICENSE.txt +5 -5
  60. package/package.json +3 -3
  61. package/resources/mablFind.js +1 -1
  62. package/resources/pdf-viewer/index.js +1 -1
  63. package/resources/pdf-viewer/libEmbeddedPdfHandler.js +11 -2
  64. package/util/actionabilityUtil.js +1 -24
  65. package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +0 -134
  66. package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +0 -45
  67. package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +0 -139
  68. package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +0 -115
  69. package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +0 -38
  70. package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +0 -27
  71. package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +0 -36
  72. package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +0 -332
  73. package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +0 -25
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ElseIfConditionStep = void 0;
4
+ const MablAction_1 = require("../MablAction");
4
5
  const IfConditionStep_1 = require("./IfConditionStep");
5
6
  class ElseIfConditionStep extends IfConditionStep_1.IfConditionStep {
6
7
  getStepName() {
7
8
  return 'ElseIf';
8
9
  }
9
10
  static fromYaml(_stepName, stepArgs) {
10
- const actions = IfConditionStep_1.IfConditionStep.getActionsFromYamlForCondition(stepArgs);
11
+ const actions = [new MablAction_1.MablAction('conditional_else', [])];
12
+ actions.push(...IfConditionStep_1.IfConditionStep.getActionsFromYamlForCondition(stepArgs));
11
13
  return new ElseIfConditionStep('conditional_else_if', [], actions);
12
14
  }
13
15
  toMablscript() {
14
- return `conditional_else().${this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '')}conditional_else_if()`;
16
+ const actions = this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '');
17
+ return `conditional_else()${actions}conditional_else_if()`;
15
18
  }
16
19
  }
17
20
  exports.ElseIfConditionStep = ElseIfConditionStep;
@@ -5,14 +5,14 @@ const FindAction_1 = require("../actions/FindAction");
5
5
  const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
6
6
  const MablAction_1 = require("../MablAction");
7
7
  const MablStep_1 = require("../MablStep");
8
- const mablscriptFind_1 = require("../../mablscriptFind");
8
+ const domUtil_1 = require("../../domUtil");
9
9
  class EnterTextStep extends MablStep_1.MablStep {
10
10
  constructor(name, args, actions) {
11
11
  super(name, args, actions);
12
12
  const arg = this.getActionArgs()[0];
13
13
  this.text = (0, MablAction_1.parseArgument)(arg);
14
14
  this.validate();
15
- if ((0, mablscriptFind_1.isFindElementType)(this.actions[0].getActionName())) {
15
+ if ((0, domUtil_1.isFindElementType)(this.actions[0].getActionName())) {
16
16
  this.findAction = this.actions[0];
17
17
  }
18
18
  else {
@@ -30,10 +30,10 @@ class EnterTextStep extends MablStep_1.MablStep {
30
30
  toStepDescriptor() {
31
31
  const find = this.findAction.toDescriptor();
32
32
  switch (find.findType) {
33
- case mablscriptFind_1.FindType.FIND_FIRST:
34
- case mablscriptFind_1.FindType.FIND_LAST:
35
- case mablscriptFind_1.FindType.FIND_ANY:
36
- case mablscriptFind_1.FindType.FIND_ONE:
33
+ case domUtil_1.FindType.FIND_FIRST:
34
+ case domUtil_1.FindType.FIND_LAST:
35
+ case domUtil_1.FindType.FIND_ANY:
36
+ case domUtil_1.FindType.FIND_ONE:
37
37
  return {
38
38
  find,
39
39
  descriptorToActionMap: new Map().set(find, this.findAction),
@@ -56,7 +56,7 @@ class EnterTextStep extends MablStep_1.MablStep {
56
56
  if (this.description) {
57
57
  formatted[stepName].description = this.description;
58
58
  }
59
- if (step.find.findType === mablscriptFind_1.FindType.FIND_ONE) {
59
+ if (step.find.findType === domUtil_1.FindType.FIND_ONE) {
60
60
  formatted[stepName].selector = step.find.findTarget.selector;
61
61
  if ((_a = step.find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length) {
62
62
  formatted[stepName].selectorAncestors =
@@ -80,7 +80,10 @@ class EnterTextStep extends MablStep_1.MablStep {
80
80
  return new EnterTextStep('enter_text', [stepArgs.text], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
81
81
  }
82
82
  toMablscript() {
83
- return `${this.findAction.toMablscript()}.enter_text(${this.substituteMablscriptVariable(this.text)})`;
83
+ const enterText = typeof this.text === 'string'
84
+ ? `"${(0, domUtil_1.escapeMablscriptString)(this.text)}"`
85
+ : this.substituteMablscriptVariable(this.text);
86
+ return `${this.findAction.toMablscript()}.enter_text(${enterText})`;
84
87
  }
85
88
  }
86
89
  exports.EnterTextStep = EnterTextStep;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EvaluateFlowStep = void 0;
4
+ const MablStep_1 = require("../MablStep");
5
+ const domUtil_1 = require("../../domUtil");
6
+ class EvaluateFlowStep extends MablStep_1.MablStep {
7
+ constructor(name, args, actions) {
8
+ super(name, args, actions);
9
+ if (args.length < 1 || args.length > 2) {
10
+ throw new Error('EvaluateFlowStep expects 1 or 2 arguments');
11
+ }
12
+ this.flowDescriptor = this.getActionArgs()[0];
13
+ if (args.length === 2) {
14
+ this.config = this.getActionArgs()[1];
15
+ }
16
+ }
17
+ getStepName() {
18
+ return EvaluateFlowStep.yamlMablScriptNames[0];
19
+ }
20
+ toStepDescriptor() {
21
+ return {
22
+ descriptor: this.flowDescriptor,
23
+ config: this.config,
24
+ };
25
+ }
26
+ static fromYaml(_stepName, stepArgs) {
27
+ const { descriptor, config } = stepArgs;
28
+ return new EvaluateFlowStep(EvaluateFlowStep.mablScriptStepNames[0], [descriptor, config], []);
29
+ }
30
+ toMablscript() {
31
+ const flowReference = (0, domUtil_1.buildStepArgumentString)(this.flowDescriptor);
32
+ const flowConfig = this.config
33
+ ? ', ' + (0, domUtil_1.buildStepArgumentString)(this.config)
34
+ : '';
35
+ return `${EvaluateFlowStep.mablScriptStepNames[0]}(${flowReference}${flowConfig})`;
36
+ }
37
+ }
38
+ exports.EvaluateFlowStep = EvaluateFlowStep;
39
+ EvaluateFlowStep.mablScriptStepNames = ['evaluate_flow'];
40
+ EvaluateFlowStep.yamlMablScriptNames = ['EvaluateFlow'];
@@ -4,7 +4,7 @@ exports.HoverStep = void 0;
4
4
  const FindAction_1 = require("../actions/FindAction");
5
5
  const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
6
6
  const MablStep_1 = require("../MablStep");
7
- const mablscriptFind_1 = require("../../mablscriptFind");
7
+ const domUtil_1 = require("../../domUtil");
8
8
  class HoverStep extends MablStep_1.MablStep {
9
9
  constructor(name, args, actions) {
10
10
  super(name, args, actions);
@@ -22,10 +22,10 @@ class HoverStep extends MablStep_1.MablStep {
22
22
  toStepDescriptor() {
23
23
  const find = this.findAction.toDescriptor();
24
24
  switch (find.findType) {
25
- case mablscriptFind_1.FindType.FIND_FIRST:
26
- case mablscriptFind_1.FindType.FIND_LAST:
27
- case mablscriptFind_1.FindType.FIND_ANY:
28
- case mablscriptFind_1.FindType.FIND_ONE:
25
+ case domUtil_1.FindType.FIND_FIRST:
26
+ case domUtil_1.FindType.FIND_LAST:
27
+ case domUtil_1.FindType.FIND_ANY:
28
+ case domUtil_1.FindType.FIND_ONE:
29
29
  return {
30
30
  find,
31
31
  descriptorToActionMap: new Map().set(find, this.findAction),
@@ -7,7 +7,7 @@ const AssertStep_1 = require("./AssertStep");
7
7
  const FindAction_1 = require("../actions/FindAction");
8
8
  const MablStep_1 = require("../MablStep");
9
9
  const ExtractAction_1 = require("../actions/ExtractAction");
10
- const mablscriptFind_1 = require("../../mablscriptFind");
10
+ const domUtil_1 = require("../../domUtil");
11
11
  const JavaScriptAction_1 = require("../actions/JavaScriptAction");
12
12
  const GetUrlAction_1 = require("../actions/GetUrlAction");
13
13
  const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
@@ -77,13 +77,13 @@ class IfConditionStep extends MablStep_1.MablStep {
77
77
  if (this.primaryAction instanceof FindAction_1.FindAction) {
78
78
  const find = this.primaryAction.toDescriptor();
79
79
  switch (find.findType) {
80
- case mablscriptFind_1.FindType.FIND_FIRST:
81
- case mablscriptFind_1.FindType.FIND_LAST:
82
- case mablscriptFind_1.FindType.FIND_ANY:
83
- case mablscriptFind_1.FindType.FIND_ALL:
80
+ case domUtil_1.FindType.FIND_FIRST:
81
+ case domUtil_1.FindType.FIND_LAST:
82
+ case domUtil_1.FindType.FIND_ANY:
83
+ case domUtil_1.FindType.FIND_ALL:
84
84
  details.selector = find.findTarget;
85
85
  break;
86
- case mablscriptFind_1.FindType.FIND_ONE:
86
+ case domUtil_1.FindType.FIND_ONE:
87
87
  details.selector = find.findTarget.selector;
88
88
  if (find.findOptions) {
89
89
  details.findOptions = find.findOptions;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReleaseStep = void 0;
4
4
  const FindAction_1 = require("../actions/FindAction");
5
5
  const MablStep_1 = require("../MablStep");
6
- const mablscriptFind_1 = require("../../mablscriptFind");
6
+ const domUtil_1 = require("../../domUtil");
7
7
  const ActionsUtils_1 = require("./ActionsUtils");
8
8
  class ReleaseStep extends MablStep_1.MablStep {
9
9
  constructor(name, args, actions) {
@@ -30,10 +30,10 @@ class ReleaseStep extends MablStep_1.MablStep {
30
30
  toStepDescriptor() {
31
31
  const find = this.findAction.toDescriptor();
32
32
  switch (find.findType) {
33
- case mablscriptFind_1.FindType.FIND_FIRST:
34
- case mablscriptFind_1.FindType.FIND_LAST:
35
- case mablscriptFind_1.FindType.FIND_ANY:
36
- case mablscriptFind_1.FindType.FIND_ONE:
33
+ case domUtil_1.FindType.FIND_FIRST:
34
+ case domUtil_1.FindType.FIND_LAST:
35
+ case domUtil_1.FindType.FIND_ANY:
36
+ case domUtil_1.FindType.FIND_ONE:
37
37
  return {
38
38
  find,
39
39
  isHtml5: this.releaseArgs.isHtml5,
@@ -55,7 +55,8 @@ class ReleaseStep extends MablStep_1.MablStep {
55
55
  return new ReleaseStep('release', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
56
56
  }
57
57
  toMablscript() {
58
- return `${this.findAction.toMablscript()}.release()`;
58
+ const args = this.convertObjectToMablscriptArgs(this.releaseArgs);
59
+ return `${this.findAction.toMablscript()}.release(${args})`;
59
60
  }
60
61
  }
61
62
  exports.ReleaseStep = ReleaseStep;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RemoveCookieStep = void 0;
4
4
  const MablStep_1 = require("../MablStep");
5
5
  const CookieUtils_1 = require("./CookieUtils");
6
+ const domUtil_1 = require("../../domUtil");
6
7
  class RemoveCookieStep extends MablStep_1.MablStep {
7
8
  constructor(name, args, actions) {
8
9
  super(name, args, actions);
@@ -20,9 +21,7 @@ class RemoveCookieStep extends MablStep_1.MablStep {
20
21
  return new RemoveCookieStep('remove_cookie', [stepArgs], []);
21
22
  }
22
23
  toMablscript() {
23
- return `remove_cookie(${this.convertObjectToMablscriptArgs({
24
- name: this.cookieName,
25
- })})`;
24
+ return `remove_cookie({ name : "${(0, domUtil_1.escapeMablscriptString)(this.cookieName)}" })`;
26
25
  }
27
26
  }
28
27
  exports.RemoveCookieStep = RemoveCookieStep;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SelectStep = void 0;
4
4
  const FindAction_1 = require("../actions/FindAction");
5
5
  const MablStep_1 = require("../MablStep");
6
- const mablscriptFind_1 = require("../../mablscriptFind");
6
+ const domUtil_1 = require("../../domUtil");
7
7
  class SelectStep extends MablStep_1.MablStep {
8
8
  constructor(name, args, actions) {
9
9
  super(name, args, actions);
@@ -26,10 +26,10 @@ class SelectStep extends MablStep_1.MablStep {
26
26
  const formatted = { ...selectOptionsCopy };
27
27
  const find = this.findAction.toDescriptor();
28
28
  switch (find.findType) {
29
- case mablscriptFind_1.FindType.FIND_FIRST:
30
- case mablscriptFind_1.FindType.FIND_LAST:
31
- case mablscriptFind_1.FindType.FIND_ANY:
32
- case mablscriptFind_1.FindType.FIND_ONE:
29
+ case domUtil_1.FindType.FIND_FIRST:
30
+ case domUtil_1.FindType.FIND_LAST:
31
+ case domUtil_1.FindType.FIND_ANY:
32
+ case domUtil_1.FindType.FIND_ONE:
33
33
  formatted.find = find;
34
34
  formatted.descriptorToActionMap = new Map().set(find, this.findAction);
35
35
  return formatted;
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VariableSource = exports.HttpResponseAssertion = exports.SendHttpRequestStep = void 0;
4
4
  const MablStep_1 = require("../MablStep");
5
- const AssertStep_1 = require("./AssertStep");
6
5
  const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
6
+ const AssertStep_1 = require("./AssertStep");
7
+ const domUtil_1 = require("../../domUtil");
7
8
  const evalAssertionType = {};
8
9
  Object.entries(AssertStep_1.assertionStepToField).forEach(([stepType, field]) => (evalAssertionType[field] = `${stepType.split('Assert')[1]}`));
9
10
  class SendHttpRequestStep extends MablStep_1.MablStep {
@@ -36,8 +37,7 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
36
37
  return new SendHttpRequestStep('send_http_request', [formatted], []);
37
38
  }
38
39
  toMablscript() {
39
- const stepAsSource = (0, MablStep_1.buildSourceRepresentationOfObject)(this.sendRequest);
40
- return `send_http_request(${stepAsSource})`;
40
+ return `send_http_request(${(0, domUtil_1.buildStepArgumentString)(this.sendRequest)})`;
41
41
  }
42
42
  }
43
43
  exports.SendHttpRequestStep = SendHttpRequestStep;
@@ -4,7 +4,7 @@ exports.SendKeyStep = void 0;
4
4
  const FindAction_1 = require("../actions/FindAction");
5
5
  const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
6
6
  const MablStep_1 = require("../MablStep");
7
- const mablscriptFind_1 = require("../../mablscriptFind");
7
+ const domUtil_1 = require("../../domUtil");
8
8
  const SendKeyStepDescriptor_1 = require("../types/SendKeyStepDescriptor");
9
9
  const STEP_NAME = 'SendKeys';
10
10
  const SEL_IDE_KEYS = {
@@ -35,7 +35,7 @@ class SendKeyStep extends MablStep_1.MablStep {
35
35
  if (this.actions.length !== 1 && !(this.actions[0] instanceof FindAction_1.FindAction)) {
36
36
  throw new Error(`${name} step should have one sub-action and it should be a find`);
37
37
  }
38
- if ((0, mablscriptFind_1.isFindElementType)(this.actions[0].getActionName())) {
38
+ if ((0, domUtil_1.isFindElementType)(this.actions[0].getActionName())) {
39
39
  this.findAction = this.actions[0];
40
40
  }
41
41
  else {
@@ -58,10 +58,10 @@ class SendKeyStep extends MablStep_1.MablStep {
58
58
  toStepDescriptor() {
59
59
  const find = this.findAction.toDescriptor();
60
60
  switch (find.findType) {
61
- case mablscriptFind_1.FindType.FIND_FIRST:
62
- case mablscriptFind_1.FindType.FIND_LAST:
63
- case mablscriptFind_1.FindType.FIND_ANY:
64
- case mablscriptFind_1.FindType.FIND_ONE:
61
+ case domUtil_1.FindType.FIND_FIRST:
62
+ case domUtil_1.FindType.FIND_LAST:
63
+ case domUtil_1.FindType.FIND_ANY:
64
+ case domUtil_1.FindType.FIND_ONE:
65
65
  return {
66
66
  find,
67
67
  keys: this.keys,
@@ -100,8 +100,8 @@ class SendKeyStep extends MablStep_1.MablStep {
100
100
  }
101
101
  toMablscript() {
102
102
  const keysToSend = this.keys
103
- .map((key) => this.convertObjectToMablscriptArgs(key))
104
- .join(', ');
103
+ .map((key) => (0, domUtil_1.buildStepArgumentString)(key))
104
+ .join();
105
105
  return `${this.findAction.toMablscript()}.send_keys(${keysToSend})`;
106
106
  }
107
107
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SetCookieStep = void 0;
4
4
  const MablStep_1 = require("../MablStep");
5
5
  const CookieUtils_1 = require("./CookieUtils");
6
+ const domUtil_1 = require("../../domUtil");
6
7
  const validValueCharacters = /^(!|[\x23-\x2B]|[\x2D-\x3A]|[\x3C-\x5B]|[\x5D-\x7E])*$/;
7
8
  class SetCookieStep extends MablStep_1.MablStep {
8
9
  constructor(name, args, actions) {
@@ -20,10 +21,7 @@ class SetCookieStep extends MablStep_1.MablStep {
20
21
  return new SetCookieStep('set_cookie', [stepArgs], []);
21
22
  }
22
23
  toMablscript() {
23
- return `set_cookie(${this.convertObjectToMablscriptArgs({
24
- name: this.cookieName,
25
- value: this.cookieValue,
26
- })})`;
24
+ return `set_cookie({ name : "${(0, domUtil_1.escapeMablscriptString)(this.cookieName)}", value : "${(0, domUtil_1.escapeMablscriptString)(this.cookieValue)}" })`;
27
25
  }
28
26
  static normalizeValue(value) {
29
27
  const trimmed = value.trim();
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SetFilesStep = void 0;
4
4
  const FindAction_1 = require("../actions/FindAction");
5
5
  const MablStep_1 = require("../MablStep");
6
- const mablscriptFind_1 = require("../../mablscriptFind");
6
+ const domUtil_1 = require("../../domUtil");
7
7
  class SetFilesStep extends MablStep_1.MablStep {
8
8
  constructor(name, args, actions) {
9
9
  super(name, args, actions);
@@ -24,10 +24,10 @@ class SetFilesStep extends MablStep_1.MablStep {
24
24
  formatted.files = this.files;
25
25
  const find = this.findAction.toDescriptor();
26
26
  switch (find.findType) {
27
- case mablscriptFind_1.FindType.FIND_FIRST:
28
- case mablscriptFind_1.FindType.FIND_LAST:
29
- case mablscriptFind_1.FindType.FIND_ANY:
30
- case mablscriptFind_1.FindType.FIND_ONE:
27
+ case domUtil_1.FindType.FIND_FIRST:
28
+ case domUtil_1.FindType.FIND_LAST:
29
+ case domUtil_1.FindType.FIND_ANY:
30
+ case domUtil_1.FindType.FIND_ONE:
31
31
  formatted.find = find;
32
32
  formatted.descriptorToActionMap = new Map().set(find, this.findAction);
33
33
  return formatted;
@@ -28,7 +28,7 @@ class SetViewportStep extends MablStep_1.MablStep {
28
28
  toMablscript() {
29
29
  let sizeArg;
30
30
  if (this.size.height && this.size.width) {
31
- sizeArg = `{ size : { width : ${this.size.width}, height: ${this.size.height} } }`;
31
+ sizeArg = `{ size : { width : ${this.size.width}, height : ${this.size.height} } }`;
32
32
  }
33
33
  else if (this.size.width) {
34
34
  sizeArg = `{ size : { width : ${this.size.width} } }`;
@@ -5,7 +5,7 @@ const FindAction_1 = require("../actions/FindAction");
5
5
  const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
6
6
  const MablStep_1 = require("../MablStep");
7
7
  const SwitchContextStepDescriptor_1 = require("../types/SwitchContextStepDescriptor");
8
- const mablscriptFind_1 = require("../../mablscriptFind");
8
+ const domUtil_1 = require("../../domUtil");
9
9
  class SwitchContextStep extends MablStep_1.MablStep {
10
10
  constructor(name, args, actions) {
11
11
  super(name, args, actions);
@@ -28,7 +28,7 @@ class SwitchContextStep extends MablStep_1.MablStep {
28
28
  this.findAction.setActionSourceIndexInStep(this.actions[0].actionSourceIndexInStep);
29
29
  }
30
30
  const findDescriptor = this.findAction.toDescriptor();
31
- if (findDescriptor.findType === mablscriptFind_1.FindType.FIND_TAB) {
31
+ if (findDescriptor.findType === domUtil_1.FindType.FIND_TAB) {
32
32
  this.switch = {
33
33
  tab: findDescriptor,
34
34
  find: findDescriptor,
@@ -37,7 +37,7 @@ class SwitchContextStep extends MablStep_1.MablStep {
37
37
  Object.freeze(this.switch);
38
38
  return;
39
39
  }
40
- if (findDescriptor.findType === mablscriptFind_1.FindType.FIND_ONE) {
40
+ if (findDescriptor.findType === domUtil_1.FindType.FIND_ONE) {
41
41
  this.switch = {
42
42
  frame: findDescriptor,
43
43
  find: findDescriptor,
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VisitUrlStep = void 0;
4
4
  const MablStep_1 = require("../MablStep");
5
5
  const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
6
+ const domUtil_1 = require("../../domUtil");
6
7
  class VisitUrlStep extends MablStep_1.MablStep {
7
8
  constructor(name, args, actions) {
8
9
  super(name, args, actions);
@@ -28,7 +29,7 @@ class VisitUrlStep extends MablStep_1.MablStep {
28
29
  return new VisitUrlStep('visit_url', [stepArgs.url], []);
29
30
  }
30
31
  toMablscript() {
31
- const resolvedUrl = this.substituteMablscriptVariable(this.url.toString());
32
+ const resolvedUrl = this.substituteMablscriptVariable((0, domUtil_1.escapeMablscriptString)(this.url.toString()));
32
33
  if (VisitUrlStep.isInProduction() && VisitUrlStep.isFileUrl(resolvedUrl)) {
33
34
  throw new Error('Access to local files is not permitted');
34
35
  }
@@ -25,15 +25,12 @@ class WaitStep extends MablStep_1.MablStep {
25
25
  return new WaitStep('wait', [stepArgs.milliseconds], []);
26
26
  }
27
27
  toMablscript() {
28
- return `wait("${this.milliseconds}")`;
28
+ return `wait(${this.milliseconds})`;
29
29
  }
30
30
  static validateWait(wait) {
31
31
  if (typeof wait !== 'number') {
32
32
  throw new Error(`Invalid wait argument [${wait}]`);
33
33
  }
34
- if (wait < 1000 || wait > 900000) {
35
- throw new Error('Wait must be between 1 and 900 seconds');
36
- }
37
34
  return wait;
38
35
  }
39
36
  }
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WaitUntilStep = void 0;
4
4
  const MablStep_1 = require("../MablStep");
5
- const mablscriptFind_1 = require("../../mablscriptFind");
5
+ const domUtil_1 = require("../../domUtil");
6
6
  class WaitUntilStep extends MablStep_1.MablStep {
7
7
  constructor(name, args, actions) {
8
8
  super(name, args, actions);
9
- if ((0, mablscriptFind_1.isFindElementType)(this.actions[0].getActionName())) {
9
+ if ((0, domUtil_1.isFindElementType)(this.actions[0].getActionName())) {
10
10
  this.findAction = this.actions[0];
11
11
  }
12
12
  else {
@@ -19,7 +19,7 @@ class WaitUntilStep extends MablStep_1.MablStep {
19
19
  toStepDescriptor() {
20
20
  const find = this.findAction.toDescriptor();
21
21
  switch (find.findType) {
22
- case mablscriptFind_1.FindType.FIND_ONE:
22
+ case domUtil_1.FindType.FIND_ONE:
23
23
  return {
24
24
  find,
25
25
  descriptorToActionMap: new Map().set(find, this.findAction),
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newGetCurrentLocationDescriptor = exports.isGetCurrentLocationDescriptor = void 0;
3
+ exports.newGetCurrentLocationDescriptor = exports.isGetCurrentLocationDescriptor = exports.GET_CURRENT_LOCATION_KIND = void 0;
4
+ exports.GET_CURRENT_LOCATION_KIND = 'Location';
4
5
  function isGetCurrentLocationDescriptor(value) {
5
- return value.kind === 'Location';
6
+ return (value.kind === exports.GET_CURRENT_LOCATION_KIND);
6
7
  }
7
8
  exports.isGetCurrentLocationDescriptor = isGetCurrentLocationDescriptor;
8
9
  function newGetCurrentLocationDescriptor() {
9
- return { kind: 'Location' };
10
+ return { kind: exports.GET_CURRENT_LOCATION_KIND };
10
11
  }
11
12
  exports.newGetCurrentLocationDescriptor = newGetCurrentLocationDescriptor;