@mablhq/mabl-cli 1.16.32 → 1.18.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.
- package/api/basicApiClient.js +9 -4
- package/api/featureSet.js +1 -4
- package/api/mablApiClient.js +16 -9
- package/browserLauncher/browserLauncherFactory.js +4 -4
- package/browserLauncher/elementHandle.js +2 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +8 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +11 -9
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +23 -29
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +28 -6
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +5 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +13 -9
- package/browserLauncher/runnerType.js +0 -1
- package/cli.js +12 -8
- package/commands/applications/applications_cmds/describe.js +4 -4
- package/commands/applications/applications_cmds/list.js +4 -4
- package/commands/auth/auth_cmds/activate-key.js +1 -1
- package/commands/branches/branches_cmds/create.js +4 -4
- package/commands/branches/branches_cmds/describe.js +3 -3
- package/commands/branches/branches_cmds/list.js +3 -3
- package/commands/branches/branches_cmds/merge.js +4 -4
- package/commands/commandUtil/codeInsights.js +4 -2
- package/commands/commandUtil/describe.js +1 -1
- package/commands/commandUtil/fileUtil.js +5 -1
- package/commands/commandUtil/util.js +2 -2
- package/commands/config/config_cmds/delete.js +1 -1
- package/commands/config/config_cmds/set.js +1 -1
- package/commands/constants.js +3 -1
- package/commands/credentials/credentials_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/create.js +18 -13
- package/commands/deploy/deploy_cmds/describe.js +5 -5
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +1 -1
- package/commands/deploy/deploy_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/watch.js +2 -2
- package/commands/environments/environments_cmds/create.js +7 -7
- package/commands/environments/environments_cmds/delete.js +1 -1
- package/commands/environments/environments_cmds/describe.js +4 -4
- package/commands/environments/environments_cmds/list.js +4 -4
- package/commands/environments/environments_cmds/update.js +2 -2
- package/commands/environments/environments_cmds/urls_cmds/add.js +3 -3
- package/commands/environments/environments_cmds/urls_cmds/list.js +2 -2
- package/commands/flows/flows_cmds/export.js +5 -5
- package/commands/flows/flows_cmds/list.js +2 -2
- package/commands/link-agents/link-agents_cmds/delete.js +1 -1
- package/commands/plans/plans_cmds/describe.js +4 -4
- package/commands/plans/plans_cmds/list.js +2 -2
- package/commands/test-runs/test-runs_cmds/export.js +2 -2
- package/commands/tests/executionUtil.js +5 -5
- package/commands/tests/testsUtil.js +30 -18
- package/commands/tests/tests_cmds/create.js +3 -3
- package/commands/tests/tests_cmds/edit.js +3 -3
- package/commands/tests/tests_cmds/export.js +7 -7
- package/commands/tests/tests_cmds/import.js +35 -14
- package/commands/tests/tests_cmds/list.js +3 -3
- package/commands/tests/tests_cmds/run-alpha.js +3 -3
- package/commands/tests/tests_cmds/run-cloud.js +4 -4
- package/commands/tests/tests_cmds/run-legacy.js +8 -8
- package/commands/tests/tests_cmds/run.js +13 -8
- package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
- package/commands/tests/tests_cmds/trainer_cmds/update.js +1 -1
- package/commands/tests/tests_cmds/trainer_cmds/version.js +2 -2
- package/commands/workspaces/workspace_cmds/copy.js +2 -2
- package/commands/workspaces/workspace_cmds/describe.js +4 -4
- package/commands/workspaces/workspace_cmds/list.js +2 -2
- package/configGenerators/flowConfigGenerator.js +1 -1
- package/configGenerators/selIdeGenerator.js +6 -6
- package/core/messaging/actions/runnerActions.js +2 -2
- package/core/trainer/openUtils.js +2 -2
- package/core/trainer/trainingSessions.js +26 -26
- package/domUtil/index.js +1 -1
- package/domUtil/index.js.LICENSE.txt +5 -5
- package/env/env.js +5 -1
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +7 -5
- package/index.d.ts +0 -1
- package/mablApi/index.js +1 -1
- package/mablscript/AttributesConstants.js +2 -1
- package/mablscript/MablAction.js +1 -1
- package/mablscript/MablStep.js +26 -14
- package/mablscript/actions/AwaitPDFDownloadAction.js +2 -1
- package/mablscript/actions/ConditionAction.js +12 -4
- package/mablscript/actions/ExtractAction.js +16 -7
- package/mablscript/actions/FindAction.js +105 -80
- package/mablscript/actions/GenerateRandomStringAction.js +2 -1
- package/mablscript/actions/GetUrlAction.js +2 -2
- package/mablscript/actions/GetVariableValue.js +3 -3
- package/mablscript/actions/JavaScriptAction.js +16 -16
- package/mablscript/diffing/diffingUtil.js +146 -0
- package/mablscript/importer.js +26 -8
- package/mablscript/steps/AccessibilityCheck.js +9 -7
- package/mablscript/steps/AssertStep.js +60 -46
- package/mablscript/steps/AssertStepOld.js +41 -23
- package/mablscript/steps/AwaitTabStep.js +7 -6
- package/mablscript/steps/ClickAndHoldStep.js +6 -6
- package/mablscript/steps/ClickStep.js +6 -6
- package/mablscript/steps/CreateVariableStep.js +8 -8
- package/mablscript/steps/DoubleClickStep.js +7 -7
- package/mablscript/steps/DownloadStep.js +3 -2
- package/mablscript/steps/EchoStep.js +5 -3
- package/mablscript/steps/ElseIfConditionStep.js +5 -2
- package/mablscript/steps/EnterTextStep.js +13 -10
- package/mablscript/steps/EvaluateFlowStep.js +40 -0
- package/mablscript/steps/HoverStep.js +6 -6
- package/mablscript/steps/IfConditionStep.js +8 -7
- package/mablscript/steps/NavigateStep.js +1 -1
- package/mablscript/steps/ReleaseStep.js +7 -6
- package/mablscript/steps/RemoveCookieStep.js +2 -3
- package/mablscript/steps/SelectStep.js +5 -5
- package/mablscript/steps/SendHttpRequestStep.js +3 -3
- package/mablscript/steps/SendKeyStep.js +9 -9
- package/mablscript/steps/SetCookieStep.js +2 -4
- package/mablscript/steps/SetFilesStep.js +5 -5
- package/mablscript/steps/SetViewportStep.js +2 -2
- package/mablscript/steps/SwitchContextStep.js +12 -12
- package/mablscript/steps/VisitUrlStep.js +3 -2
- package/mablscript/steps/WaitStep.js +2 -5
- package/mablscript/steps/WaitUntilStep.js +3 -3
- package/{browserLauncher/puppeteerBrowserLauncher/internals.js → mablscript/types/EvaluateFlowStepDescriptor.js} +0 -0
- package/mablscript/types/GetCurrentLocationDescriptor.js +4 -3
- package/mablscript/types/OperatingSystemDescriptor.js +5 -1
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/mablscriptFind/index.js.LICENSE.txt +5 -5
- package/observers/mockObserver.js +4 -2
- package/package.json +55 -56
- package/popupDismissal/index.js +3 -3
- package/providers/authenticationProvider.js +3 -3
- package/providers/logging/loggingProvider.js +5 -1
- package/proxy/index.js +2 -1
- package/proxy/index.js.LICENSE.txt +5 -0
- package/reporters/mochAwesome/mochAwesomeReporter.js +11 -7
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libEmbeddedPdfHandler.js +11 -2
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +1 -0
- package/util/actionabilityUtil.js +16 -35
- package/util/analytics.js +7 -3
- package/util/downloadUtil.js +6 -2
- package/util/httpUtil.js +6 -2
- package/util/markdownUtil.js +1 -1
- package/util/pureUtil.js +5 -1
- package/util/resourceUtil.js +5 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +0 -134
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +0 -45
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +0 -139
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +0 -115
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +0 -38
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +0 -27
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +0 -36
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +0 -331
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +0 -25
|
@@ -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
|
|
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 (
|
|
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
|
|
62
|
-
case
|
|
63
|
-
case
|
|
64
|
-
case
|
|
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,
|
|
@@ -81,7 +81,7 @@ class SendKeyStep extends MablStep_1.MablStep {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
produceSelIdeFormattedSteps() {
|
|
84
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('sendKeys', this);
|
|
84
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('sendKeys', this);
|
|
85
85
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
86
86
|
seleniumStep.value = this.keys
|
|
87
87
|
.map((keyPress) => {
|
|
@@ -100,8 +100,8 @@ class SendKeyStep extends MablStep_1.MablStep {
|
|
|
100
100
|
}
|
|
101
101
|
toMablscript() {
|
|
102
102
|
const keysToSend = this.keys
|
|
103
|
-
.map((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.
|
|
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
|
|
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
|
|
28
|
-
case
|
|
29
|
-
case
|
|
30
|
-
case
|
|
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;
|
|
@@ -16,7 +16,7 @@ class SetViewportStep extends MablStep_1.MablStep {
|
|
|
16
16
|
return { size: this.size };
|
|
17
17
|
}
|
|
18
18
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
19
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('setWindowSize', this);
|
|
19
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('setWindowSize', this);
|
|
20
20
|
const width = this.size.width || 1920;
|
|
21
21
|
const height = this.size.height || 1080;
|
|
22
22
|
seleniumStep.target = this.substituteSeleniumVariable(`${width}x${height}`);
|
|
@@ -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
|
|
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 ===
|
|
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 ===
|
|
40
|
+
if (findDescriptor.findType === domUtil_1.FindType.FIND_ONE) {
|
|
41
41
|
this.switch = {
|
|
42
42
|
frame: findDescriptor,
|
|
43
43
|
find: findDescriptor,
|
|
@@ -73,37 +73,37 @@ class SwitchContextStep extends MablStep_1.MablStep {
|
|
|
73
73
|
if (this.description) {
|
|
74
74
|
formatted[stepName].description = this.description;
|
|
75
75
|
}
|
|
76
|
-
if (SwitchContextStepDescriptor_1.isSwitchTab(step)) {
|
|
76
|
+
if ((0, SwitchContextStepDescriptor_1.isSwitchTab)(step)) {
|
|
77
77
|
formatted[stepName].findType = 'FindTab';
|
|
78
78
|
formatted[stepName].selector = step.tab.findTarget;
|
|
79
79
|
}
|
|
80
|
-
if (SwitchContextStepDescriptor_1.isSwitchFrame(step)) {
|
|
80
|
+
if ((0, SwitchContextStepDescriptor_1.isSwitchFrame)(step)) {
|
|
81
81
|
formatted[stepName].selector = step.frame.findTarget.selector;
|
|
82
82
|
if ((_a = step.frame.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
83
83
|
formatted[stepName].selectorAncestors =
|
|
84
84
|
step.frame.findTarget.auxiliaryDescriptors.map((descriptor) => descriptor.selector);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
if (SwitchContextStepDescriptor_1.isSwitchRoot(step) && step.frame === 'root') {
|
|
87
|
+
if ((0, SwitchContextStepDescriptor_1.isSwitchRoot)(step) && step.frame === 'root') {
|
|
88
88
|
formatted[stepName].switch = 'root';
|
|
89
89
|
}
|
|
90
90
|
return formatted;
|
|
91
91
|
}
|
|
92
92
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
93
|
-
if (SwitchContextStepDescriptor_1.isSwitchRoot(this.switch) && this.switch.frame === 'root') {
|
|
94
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('selectWindow', this);
|
|
93
|
+
if ((0, SwitchContextStepDescriptor_1.isSwitchRoot)(this.switch) && this.switch.frame === 'root') {
|
|
94
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('selectWindow', this);
|
|
95
95
|
seleniumStep.target = 'window=0';
|
|
96
96
|
return [seleniumStep];
|
|
97
97
|
}
|
|
98
|
-
else if (SwitchContextStepDescriptor_1.isSwitchTab(this.switch)) {
|
|
99
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('selectWindow', this);
|
|
98
|
+
else if ((0, SwitchContextStepDescriptor_1.isSwitchTab)(this.switch)) {
|
|
99
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('selectWindow', this);
|
|
100
100
|
seleniumStep.target =
|
|
101
101
|
this.switch.tab.findTarget === 'initial'
|
|
102
102
|
? 'tab=0'
|
|
103
103
|
: `title="${this.switch.tab.findTarget.title}"`;
|
|
104
104
|
return [seleniumStep];
|
|
105
105
|
}
|
|
106
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('selectFrame', this);
|
|
106
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('selectFrame', this);
|
|
107
107
|
if (this.findAction) {
|
|
108
108
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
109
109
|
}
|
|
@@ -117,7 +117,7 @@ class SwitchContextStep extends MablStep_1.MablStep {
|
|
|
117
117
|
}
|
|
118
118
|
toMablscript() {
|
|
119
119
|
var _a;
|
|
120
|
-
if (SwitchContextStepDescriptor_1.isSwitchRoot(this.switch) && this.switch.frame === 'root') {
|
|
120
|
+
if ((0, SwitchContextStepDescriptor_1.isSwitchRoot)(this.switch) && this.switch.frame === 'root') {
|
|
121
121
|
return 'switch_context_to("root")';
|
|
122
122
|
}
|
|
123
123
|
return `${(_a = this.findAction) === null || _a === void 0 ? void 0 : _a.toMablscript()}.switch_context_to()`;
|
|
@@ -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);
|
|
@@ -20,7 +21,7 @@ class VisitUrlStep extends MablStep_1.MablStep {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
23
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('open', this);
|
|
24
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('open', this);
|
|
24
25
|
seleniumStep.target = this.substituteSeleniumVariable(this.url);
|
|
25
26
|
return [seleniumStep];
|
|
26
27
|
}
|
|
@@ -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
|
}
|
|
@@ -17,7 +17,7 @@ class WaitStep extends MablStep_1.MablStep {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
20
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('pause', this);
|
|
20
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('pause', this);
|
|
21
21
|
seleniumStep.target = `${this.milliseconds}`;
|
|
22
22
|
return [seleniumStep];
|
|
23
23
|
}
|
|
@@ -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(
|
|
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
|
|
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 (
|
|
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
|
|
22
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
23
23
|
return {
|
|
24
24
|
find,
|
|
25
25
|
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
File without changes
|
|
@@ -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 ===
|
|
6
|
+
return (value.kind === exports.GET_CURRENT_LOCATION_KIND);
|
|
6
7
|
}
|
|
7
8
|
exports.isGetCurrentLocationDescriptor = isGetCurrentLocationDescriptor;
|
|
8
9
|
function newGetCurrentLocationDescriptor() {
|
|
9
|
-
return { kind:
|
|
10
|
+
return { kind: exports.GET_CURRENT_LOCATION_KIND };
|
|
10
11
|
}
|
|
11
12
|
exports.newGetCurrentLocationDescriptor = newGetCurrentLocationDescriptor;
|
|
@@ -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.
|
|
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];
|
|
@@ -6,7 +6,7 @@ function isVariableNamespace(value) {
|
|
|
6
6
|
return (value &&
|
|
7
7
|
typeof value === 'object' &&
|
|
8
8
|
!Array.isArray(value) &&
|
|
9
|
-
VariableDataType_1.isSimpleObject(value) &&
|
|
9
|
+
(0, VariableDataType_1.isSimpleObject)(value) &&
|
|
10
10
|
Object.keys(value).every((key) => key) &&
|
|
11
11
|
Object.values(value).every(VariableDataType_1.isVariableDataType));
|
|
12
12
|
}
|