@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,8 +4,10 @@ exports.AssertStepOld = void 0;
|
|
|
4
4
|
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
5
5
|
const MablStep_1 = require("../MablStep");
|
|
6
6
|
const FindAction_1 = require("../actions/FindAction");
|
|
7
|
-
const
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
8
8
|
const importer_1 = require("../importer");
|
|
9
|
+
const GetCurrentLocationDescriptor_1 = require("../types/GetCurrentLocationDescriptor");
|
|
10
|
+
const GetVariableDescriptor_1 = require("../types/GetVariableDescriptor");
|
|
9
11
|
const oldToNewAssertionTypes = {
|
|
10
12
|
assert_contains: 'AssertContains',
|
|
11
13
|
assert_does_not_contain: 'AssertDoesNotContain',
|
|
@@ -31,8 +33,16 @@ class AssertStepOld extends MablStep_1.MablStep {
|
|
|
31
33
|
this.validate();
|
|
32
34
|
this.setAssertAttribute();
|
|
33
35
|
this.assertionType = this.name;
|
|
34
|
-
this.
|
|
36
|
+
this.primaryAction = actions[0];
|
|
35
37
|
this.extractAction = actions[1];
|
|
38
|
+
if (args.length === 1) {
|
|
39
|
+
this.continueOnFailure = args[0].onFailure === 'continue';
|
|
40
|
+
this.observationScope = args[0].observationScope;
|
|
41
|
+
}
|
|
42
|
+
else if (args.length === 2) {
|
|
43
|
+
this.continueOnFailure = args[1].onFailure === 'continue';
|
|
44
|
+
this.observationScope = args[1].observationScope;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
validate() {
|
|
38
48
|
if (this.actions.length !== 2 &&
|
|
@@ -61,31 +71,39 @@ class AssertStepOld extends MablStep_1.MablStep {
|
|
|
61
71
|
ExtractAction_1.ExtractAction.mablscriptToYamlType[this.extractAction.extractionType];
|
|
62
72
|
formatted.attribute = this.extractAction.extractionAttribute;
|
|
63
73
|
}
|
|
64
|
-
const find = this.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
const find = this.primaryAction.toDescriptor();
|
|
75
|
+
formatted.findOptions = find.selectorFindOption;
|
|
76
|
+
if ((0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) || (0, GetVariableDescriptor_1.isGetVariableDescriptor)(find)) {
|
|
77
|
+
formatted.kind = find.kind;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
switch (find.findType) {
|
|
81
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
82
|
+
case domUtil_1.FindType.FIND_EMAIL:
|
|
83
|
+
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
84
|
+
formatted.selector = find.findTarget;
|
|
85
|
+
break;
|
|
86
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
87
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
88
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
89
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
90
|
+
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
91
|
+
formatted.selector = find.findTarget;
|
|
92
|
+
break;
|
|
93
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
94
|
+
formatted.selector = find.findTarget.selector;
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
98
|
+
}
|
|
83
99
|
}
|
|
100
|
+
formatted.continueOnFailure = this.continueOnFailure;
|
|
101
|
+
formatted.observationScope = this.observationScope;
|
|
84
102
|
return formatted;
|
|
85
103
|
}
|
|
86
104
|
getNewAssertionStep() {
|
|
87
|
-
const yamlified = importer_1.yamlifyTheLoadedSteps([this]);
|
|
88
|
-
const reloadedSteps = importer_1.loadYamlSteps(yamlified);
|
|
105
|
+
const yamlified = (0, importer_1.yamlifyTheLoadedSteps)([this]);
|
|
106
|
+
const reloadedSteps = (0, importer_1.loadYamlSteps)(yamlified);
|
|
89
107
|
const result = reloadedSteps[0];
|
|
90
108
|
if (this.stepSourceIndexInFlow !== undefined) {
|
|
91
109
|
result.setStepSourceIndexInFlow(this.stepSourceIndexInFlow);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AwaitTabStep = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
4
5
|
const MablStep_1 = require("../MablStep");
|
|
5
6
|
class AwaitTabStep extends MablStep_1.MablStep {
|
|
6
7
|
constructor(name, args, actions) {
|
|
@@ -20,14 +21,14 @@ class AwaitTabStep extends MablStep_1.MablStep {
|
|
|
20
21
|
}
|
|
21
22
|
toMablscript() {
|
|
22
23
|
const mablscriptSelectorChunks = ['selector_type: "tab"'];
|
|
23
|
-
if (this.tab.title) {
|
|
24
|
-
mablscriptSelectorChunks.push(`title: "${this.tab.title}"`);
|
|
24
|
+
if (this.tab.title !== undefined) {
|
|
25
|
+
mablscriptSelectorChunks.push(`title: "${(0, domUtil_1.escapeMablscriptString)(this.tab.title)}"`);
|
|
25
26
|
}
|
|
26
|
-
if (this.tab.url) {
|
|
27
|
-
mablscriptSelectorChunks.push(`url: "${this.tab.url}"`);
|
|
27
|
+
if (this.tab.url !== undefined) {
|
|
28
|
+
mablscriptSelectorChunks.push(`url: "${(0, domUtil_1.escapeMablscriptString)(this.tab.url)}"`);
|
|
28
29
|
}
|
|
29
|
-
if (this.tab.uuid) {
|
|
30
|
-
mablscriptSelectorChunks.push(`uuid: "${this.tab.uuid}"`);
|
|
30
|
+
if (this.tab.uuid !== undefined) {
|
|
31
|
+
mablscriptSelectorChunks.push(`uuid: "${(0, domUtil_1.escapeMablscriptString)(this.tab.uuid)}"`);
|
|
31
32
|
}
|
|
32
33
|
return `await_tab({${mablscriptSelectorChunks.join(', ')}})`;
|
|
33
34
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClickAndHoldStep = 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
|
const ActionsUtils_1 = require("./ActionsUtils");
|
|
8
8
|
class ClickAndHoldStep extends MablStep_1.MablStep {
|
|
9
9
|
constructor(name, args, actions) {
|
|
@@ -30,10 +30,10 @@ class ClickAndHoldStep extends MablStep_1.MablStep {
|
|
|
30
30
|
toStepDescriptor() {
|
|
31
31
|
const find = this.findAction.toDescriptor();
|
|
32
32
|
switch (find.findType) {
|
|
33
|
-
case
|
|
34
|
-
case
|
|
35
|
-
case
|
|
36
|
-
case
|
|
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.clickArgs.isHtml5,
|
|
@@ -55,7 +55,7 @@ class ClickAndHoldStep extends MablStep_1.MablStep {
|
|
|
55
55
|
return new ClickAndHoldStep('click_and_hold', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
56
56
|
}
|
|
57
57
|
toMablscript() {
|
|
58
|
-
return `${this.findAction.toMablscript()}.click_and_hold()`;
|
|
58
|
+
return `${this.findAction.toMablscript()}.click_and_hold({isHtml5:${this.clickArgs.isHtml5}})`;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
exports.ClickAndHoldStep = ClickAndHoldStep;
|
|
@@ -4,7 +4,7 @@ exports.ClickStep = 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 ActionsUtils_1 = require("./ActionsUtils");
|
|
9
9
|
class ClickStep extends MablStep_1.MablStep {
|
|
10
10
|
constructor(name, args, actions) {
|
|
@@ -17,10 +17,10 @@ class ClickStep extends MablStep_1.MablStep {
|
|
|
17
17
|
toStepDescriptor() {
|
|
18
18
|
const find = this.findAction.toDescriptor();
|
|
19
19
|
switch (find.findType) {
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
case
|
|
23
|
-
case
|
|
20
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
21
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
22
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
23
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
24
24
|
return {
|
|
25
25
|
find,
|
|
26
26
|
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
@@ -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
|
}
|
|
@@ -8,7 +8,7 @@ const FindAction_1 = require("../actions/FindAction");
|
|
|
8
8
|
const GenerateEmailAddressAction_1 = require("../actions/GenerateEmailAddressAction");
|
|
9
9
|
const GenerateRandomStringAction_1 = require("../actions/GenerateRandomStringAction");
|
|
10
10
|
const CreateVariableStepDescriptor_1 = require("../types/CreateVariableStepDescriptor");
|
|
11
|
-
const
|
|
11
|
+
const domUtil_1 = require("../../domUtil");
|
|
12
12
|
const JavaScriptAction_1 = require("../actions/JavaScriptAction");
|
|
13
13
|
const CountAction_1 = require("../actions/CountAction");
|
|
14
14
|
class CreateVariableStep extends MablStep_1.MablStep {
|
|
@@ -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`;
|
|
@@ -207,7 +207,7 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
207
207
|
actions.push(new ExtractAction_1.ExtractAction('extract_attribute', [generator.attribute]));
|
|
208
208
|
break;
|
|
209
209
|
case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
|
|
210
|
-
actions.push(FindAction_1.FindAction.findActionFromStepArgs(stepArgs,
|
|
210
|
+
actions.push(FindAction_1.FindAction.findActionFromStepArgs(stepArgs, domUtil_1.FindType.FIND_ALL));
|
|
211
211
|
actions.push(new CountAction_1.CountAction('count', []));
|
|
212
212
|
break;
|
|
213
213
|
case CreateVariableStepDescriptor_1.VariableGenerator.EMAIL:
|
|
@@ -4,7 +4,7 @@ exports.DoubleClickStep = void 0;
|
|
|
4
4
|
const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
|
|
5
5
|
const MablStep_1 = require("../MablStep");
|
|
6
6
|
const FindAction_1 = require("../actions/FindAction");
|
|
7
|
-
const
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
8
8
|
class DoubleClickStep extends MablStep_1.MablStep {
|
|
9
9
|
constructor(name, args, actions) {
|
|
10
10
|
super(name, args, actions);
|
|
@@ -22,11 +22,11 @@ class DoubleClickStep extends MablStep_1.MablStep {
|
|
|
22
22
|
toStepDescriptor() {
|
|
23
23
|
const find = this.findAction.toDescriptor();
|
|
24
24
|
switch (find.findType) {
|
|
25
|
-
case
|
|
26
|
-
case
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
case
|
|
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_ALL:
|
|
29
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
30
30
|
return {
|
|
31
31
|
find,
|
|
32
32
|
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
@@ -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
|
}
|
|
@@ -4,6 +4,7 @@ exports.DownloadStep = void 0;
|
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
5
|
const AwaitDownloadAction_1 = require("../actions/AwaitDownloadAction");
|
|
6
6
|
const AwaitPDFDownloadAction_1 = require("../actions/AwaitPDFDownloadAction");
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
7
8
|
class DownloadStep extends MablStep_1.MablStep {
|
|
8
9
|
constructor(name, args, actions) {
|
|
9
10
|
var _a;
|
|
@@ -77,8 +78,8 @@ class DownloadStep extends MablStep_1.MablStep {
|
|
|
77
78
|
return new DownloadStep('assert_download', [fileAttributes], [awaitDownloadAction]);
|
|
78
79
|
}
|
|
79
80
|
toMablscript() {
|
|
80
|
-
const mablArgs =
|
|
81
|
-
return `${this.awaitDownloadAction.toMablscript()}.assert_download(${mablArgs})`;
|
|
81
|
+
const mablArgs = (0, domUtil_1.buildStepArgumentString)(this.fileAttributes);
|
|
82
|
+
return `${this.awaitDownloadAction.toMablscript()}.assert_download(${mablArgs ? mablArgs : ''})`;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
exports.DownloadStep = DownloadStep;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EchoStep = void 0;
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
6
|
const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
|
|
6
7
|
const MablAction_1 = require("../MablAction");
|
|
7
8
|
class EchoStep extends MablStep_1.MablStep {
|
|
8
9
|
constructor(name, args, actions) {
|
|
9
10
|
super(name, args, actions);
|
|
10
|
-
this.echoValue = MablAction_1.parseArgument(this.getActionArgs()[0]);
|
|
11
|
+
this.echoValue = (0, MablAction_1.parseArgument)(this.getActionArgs()[0]);
|
|
11
12
|
}
|
|
12
13
|
getStepName() {
|
|
13
14
|
return 'Echo';
|
|
@@ -16,7 +17,7 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
16
17
|
return { value: this.echoValue.toString() };
|
|
17
18
|
}
|
|
18
19
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
19
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
20
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
20
21
|
seleniumStep.target = this.substituteSeleniumVariable(this.echoValue);
|
|
21
22
|
return [seleniumStep];
|
|
22
23
|
}
|
|
@@ -24,7 +25,8 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
24
25
|
return new EchoStep('echo', [stepArgs.value], []);
|
|
25
26
|
}
|
|
26
27
|
toMablscript() {
|
|
27
|
-
|
|
28
|
+
const stringEchoValue = `${this.echoValue}`;
|
|
29
|
+
return `echo("${(0, domUtil_1.escapeMablscriptString)(stringEchoValue)}")`;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
exports.EchoStep = EchoStep;
|
|
@@ -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 =
|
|
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
|
-
|
|
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
|
|
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
|
-
this.text = MablAction_1.parseArgument(arg);
|
|
13
|
+
this.text = (0, MablAction_1.parseArgument)(arg);
|
|
14
14
|
this.validate();
|
|
15
|
-
if (
|
|
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
|
|
34
|
-
case
|
|
35
|
-
case
|
|
36
|
-
case
|
|
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 ===
|
|
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 =
|
|
@@ -71,7 +71,7 @@ class EnterTextStep extends MablStep_1.MablStep {
|
|
|
71
71
|
return formatted;
|
|
72
72
|
}
|
|
73
73
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
74
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('type', this);
|
|
74
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('type', this);
|
|
75
75
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
76
76
|
seleniumStep.value = this.substituteSeleniumVariable(this.text);
|
|
77
77
|
return [seleniumStep];
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
26
|
-
case
|
|
27
|
-
case
|
|
28
|
-
case
|
|
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),
|
|
@@ -46,7 +46,7 @@ class HoverStep extends MablStep_1.MablStep {
|
|
|
46
46
|
return new HoverStep('hover', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
47
47
|
}
|
|
48
48
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
49
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('mouseOver', this);
|
|
49
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('mouseOver', this);
|
|
50
50
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
51
51
|
return [seleniumStep];
|
|
52
52
|
}
|
|
@@ -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
|
|
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");
|
|
@@ -34,7 +34,8 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
34
34
|
toStepDescriptor() {
|
|
35
35
|
var _a, _b;
|
|
36
36
|
const conditionDescriptor = this.conditionAction !== undefined
|
|
37
|
-
? (_a = this.conditionAction) === null || _a === void 0 ? void 0 : _a.conditionDescriptor
|
|
37
|
+
? (_a = this.conditionAction) === null || _a === void 0 ? void 0 : _a.conditionDescriptor
|
|
38
|
+
: { conditionType: ConditionDescriptor_1.ConditionType.Truthy };
|
|
38
39
|
const find = this.primaryAction.toDescriptor();
|
|
39
40
|
return {
|
|
40
41
|
find,
|
|
@@ -76,13 +77,13 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
76
77
|
if (this.primaryAction instanceof FindAction_1.FindAction) {
|
|
77
78
|
const find = this.primaryAction.toDescriptor();
|
|
78
79
|
switch (find.findType) {
|
|
79
|
-
case
|
|
80
|
-
case
|
|
81
|
-
case
|
|
82
|
-
case
|
|
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:
|
|
83
84
|
details.selector = find.findTarget;
|
|
84
85
|
break;
|
|
85
|
-
case
|
|
86
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
86
87
|
details.selector = find.findTarget.selector;
|
|
87
88
|
if (find.findOptions) {
|
|
88
89
|
details.findOptions = find.findOptions;
|
|
@@ -17,7 +17,7 @@ class NavigateStep extends MablStep_1.MablStep {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
20
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', this);
|
|
20
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', this);
|
|
21
21
|
seleniumStep.target = 'window.location.reload()';
|
|
22
22
|
return [seleniumStep];
|
|
23
23
|
}
|
|
@@ -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
|
|
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
|
|
34
|
-
case
|
|
35
|
-
case
|
|
36
|
-
case
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
|
30
|
-
case
|
|
31
|
-
case
|
|
32
|
-
case
|
|
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
|
-
|
|
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;
|