@mablhq/mabl-cli 1.25.19 → 1.26.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.
- package/api/entities/Browser.js +1 -0
- package/api/featureSet.js +2 -2
- package/browserLauncher/browserLauncherFactory.js +3 -3
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +2 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +13 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +16 -16
- package/browserLauncher/types.js +5 -1
- package/commands/browserTypes.js +19 -8
- package/commands/constants.js +6 -5
- package/commands/tests/testsUtil.js +67 -85
- package/commands/tests/tests_cmds/run-cloud.js +2 -2
- package/commands/tests/tests_cmds/run.js +2 -0
- package/domUtil/index.js +1 -2
- package/execution/index.js +1 -1
- package/index.d.ts +2 -0
- package/mablscript/MablAction.js +31 -1
- package/mablscript/actions/ConditionAction.js +4 -0
- package/mablscript/actions/FindAction.js +3 -0
- package/mablscript/actions/GenerateRandomStringAction.js +3 -0
- package/mablscript/actions/GetVariableValue.js +3 -0
- package/mablscript/actions/JavaScriptAction.js +7 -0
- package/mablscript/importer.js +10 -3
- package/mablscript/steps/AssertStep.js +10 -0
- package/mablscript/steps/ClickAndHoldStep.js +3 -0
- package/mablscript/steps/ClickStep.js +3 -0
- package/mablscript/steps/CreateVariableStep.js +6 -0
- package/mablscript/steps/DoubleClickStep.js +3 -0
- package/mablscript/steps/DownloadStep.js +4 -0
- package/mablscript/steps/EchoStep.js +3 -0
- package/mablscript/steps/EnterTextStep.js +6 -0
- package/mablscript/steps/EvaluateJavaScriptStep.js +3 -0
- package/mablscript/steps/HoverStep.js +3 -0
- package/mablscript/steps/IfConditionStep.js +9 -0
- package/mablscript/steps/OpenEmailStep.js +3 -0
- package/mablscript/steps/ReleaseStep.js +3 -0
- package/mablscript/steps/RemoveCookieStep.js +4 -0
- package/mablscript/steps/SelectStep.js +7 -0
- package/mablscript/steps/SendHttpRequestStep.js +8 -0
- package/mablscript/steps/SendKeyStep.js +3 -0
- package/mablscript/steps/SetCookieStep.js +7 -0
- package/mablscript/steps/SetFilesStep.js +3 -0
- package/mablscript/steps/SwitchContextStep.js +4 -0
- package/mablscript/steps/VisitUrlStep.js +4 -0
- package/mablscript/steps/WaitUntilStep.js +3 -0
- package/mablscriptFind/index.js +1 -1
- package/package.json +2 -2
- package/resources/mablFind.js +1 -1
- package/browserLauncher/runnerType.js +0 -7
- package/domUtil/index.js.LICENSE.txt +0 -14
- package/mablscript/AttributesConstants.js +0 -115
package/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare module '@mablhq/mabl-cli' {
|
|
|
48
48
|
keepBrowserOpen?: boolean;
|
|
49
49
|
labelsExclude?: string[];
|
|
50
50
|
labelsInclude?: string[];
|
|
51
|
+
proxy?: string;
|
|
51
52
|
testId?: string;
|
|
52
53
|
runId?: string;
|
|
53
54
|
url?: string;
|
|
@@ -55,6 +56,7 @@ declare module '@mablhq/mabl-cli' {
|
|
|
55
56
|
workspaceId?: string;
|
|
56
57
|
runnerType?: RunnerType;
|
|
57
58
|
}
|
|
59
|
+
|
|
58
60
|
export interface MablApiClient {}
|
|
59
61
|
export class MablTestsRunner {
|
|
60
62
|
run(): Promise<TestResults>;
|
package/mablscript/MablAction.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseArgument = exports.argumentIsMablVariable = exports.MablAction = void 0;
|
|
3
|
+
exports.distinctStrings = exports.parseArgument = exports.argumentIsMablVariable = exports.MablAction = void 0;
|
|
4
|
+
const domUtil_1 = require("../domUtil");
|
|
4
5
|
const MablSymbol_1 = require("./MablSymbol");
|
|
5
6
|
class MablAction {
|
|
6
7
|
constructor(name, args) {
|
|
@@ -31,6 +32,31 @@ class MablAction {
|
|
|
31
32
|
toMablscript() {
|
|
32
33
|
return '';
|
|
33
34
|
}
|
|
35
|
+
static findUniqueVariableReferencesInValue(value) {
|
|
36
|
+
const variableReferences = [];
|
|
37
|
+
if (value instanceof MablSymbol_1.MablSymbol) {
|
|
38
|
+
return [value.name];
|
|
39
|
+
}
|
|
40
|
+
else if (typeof value === 'string') {
|
|
41
|
+
variableReferences.push(...(0, domUtil_1.findVariables)(value));
|
|
42
|
+
}
|
|
43
|
+
else if (Array.isArray(value)) {
|
|
44
|
+
variableReferences.push(...value.flatMap((v) => MablAction.findUniqueVariableReferencesInValue(v)));
|
|
45
|
+
}
|
|
46
|
+
else if (typeof value === 'object') {
|
|
47
|
+
variableReferences.push(...Object.values(value).flatMap((v) => MablAction.findUniqueVariableReferencesInValue(v)));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
return distinctStrings(variableReferences);
|
|
53
|
+
}
|
|
54
|
+
getInputVariables() {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
getOutputVariables() {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
34
60
|
}
|
|
35
61
|
exports.MablAction = MablAction;
|
|
36
62
|
function argumentIsMablVariable(argument) {
|
|
@@ -48,3 +74,7 @@ function parseArgument(arg) {
|
|
|
48
74
|
return arg;
|
|
49
75
|
}
|
|
50
76
|
exports.parseArgument = parseArgument;
|
|
77
|
+
function distinctStrings(values) {
|
|
78
|
+
return Array.from(new Set(values));
|
|
79
|
+
}
|
|
80
|
+
exports.distinctStrings = distinctStrings;
|
|
@@ -63,6 +63,10 @@ class ConditionAction extends MablAction_1.MablAction {
|
|
|
63
63
|
toMablscript() {
|
|
64
64
|
return `${this.generateEvaluateConditionMablscript()}`;
|
|
65
65
|
}
|
|
66
|
+
getInputVariables() {
|
|
67
|
+
var _a;
|
|
68
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue((_a = this.conditionValueAttribute) !== null && _a !== void 0 ? _a : '');
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
exports.ConditionAction = ConditionAction;
|
|
68
72
|
ConditionAction.mablScriptStepNames = ['evaluate_condition', 'evaluate_presence'];
|
|
@@ -239,6 +239,9 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
239
239
|
isValidDescriptor() {
|
|
240
240
|
return this.isValid;
|
|
241
241
|
}
|
|
242
|
+
getInputVariables() {
|
|
243
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.findDescriptor);
|
|
244
|
+
}
|
|
242
245
|
}
|
|
243
246
|
exports.FindAction = FindAction;
|
|
244
247
|
FindAction.mablScriptStepNames = [
|
|
@@ -11,6 +11,9 @@ class GenerateRandomStringAction extends MablAction_1.MablAction {
|
|
|
11
11
|
toMablscript() {
|
|
12
12
|
return `generate_random_string(\"${(0, domUtil_1.escapeMablscriptString)(this.generateString)}\")`;
|
|
13
13
|
}
|
|
14
|
+
getInputVariables() {
|
|
15
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.generateString);
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
exports.GenerateRandomStringAction = GenerateRandomStringAction;
|
|
16
19
|
GenerateRandomStringAction.mablScriptStepNames = ['generate_random_string'];
|
|
@@ -22,6 +22,9 @@ class GetVariableValue extends MablAction_1.MablAction {
|
|
|
22
22
|
generateFindMablscript() {
|
|
23
23
|
return `get_variable_value(${this.variable.name})`;
|
|
24
24
|
}
|
|
25
|
+
getInputVariables() {
|
|
26
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.variable);
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
exports.GetVariableValue = GetVariableValue;
|
|
27
30
|
GetVariableValue.mablScriptStepNames = ['get_variable_value'];
|
|
@@ -185,6 +185,13 @@ class JavaScriptAction extends MablAction_1.MablAction {
|
|
|
185
185
|
}
|
|
186
186
|
throw new Error(`Cannot export action to mablscript: ${JSON.stringify(this.javaScript)}`);
|
|
187
187
|
}
|
|
188
|
+
getInputVariables() {
|
|
189
|
+
if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(this.javaScript) ||
|
|
190
|
+
(0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(this.javaScript)) {
|
|
191
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.javaScript.parameterOverrides.map((override) => override.value));
|
|
192
|
+
}
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
188
195
|
}
|
|
189
196
|
exports.JavaScriptAction = JavaScriptAction;
|
|
190
197
|
JavaScriptAction.mablscriptName = MABLSCRIPT_NAME;
|
package/mablscript/importer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseMablScriptIntoSteps = exports.mablscriptTheLoadedSteps = exports.seleniumIdeTheLoadedSteps = exports.loadYamlSteps = exports.yamlifyTheLoadedSteps = exports.loadMablScriptIntoSteps = exports.parseMablScript = void 0;
|
|
3
|
+
exports.extractOutputVariables = exports.extractInputVariables = exports.parseMablScriptIntoSteps = exports.mablscriptTheLoadedSteps = exports.seleniumIdeTheLoadedSteps = exports.loadYamlSteps = exports.yamlifyTheLoadedSteps = exports.loadMablScriptIntoSteps = exports.parseMablScript = void 0;
|
|
4
4
|
const esprima_1 = require("esprima");
|
|
5
5
|
const estraverse_1 = require("estraverse");
|
|
6
6
|
const AssertStep_1 = require("./steps/AssertStep");
|
|
@@ -49,7 +49,6 @@ const JavaScriptAction_1 = require("./actions/JavaScriptAction");
|
|
|
49
49
|
const ClickAndHoldStep_1 = require("./steps/ClickAndHoldStep");
|
|
50
50
|
const ReleaseStep_1 = require("./steps/ReleaseStep");
|
|
51
51
|
const CountAction_1 = require("./actions/CountAction");
|
|
52
|
-
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
53
52
|
const AccessibilityCheck_1 = require("./steps/AccessibilityCheck");
|
|
54
53
|
const EvaluateFlowStep_1 = require("./steps/EvaluateFlowStep");
|
|
55
54
|
const ActionTypes = [
|
|
@@ -263,7 +262,7 @@ function getArgumentsFromCallExpressionArgs(expressionArguments) {
|
|
|
263
262
|
expressionArgs.push(parseObjectExpression(expressionArg));
|
|
264
263
|
break;
|
|
265
264
|
default:
|
|
266
|
-
|
|
265
|
+
throw new Error(`Unsupported argument supplied`);
|
|
267
266
|
}
|
|
268
267
|
});
|
|
269
268
|
return expressionArgs;
|
|
@@ -380,3 +379,11 @@ function parseMablScriptIntoSteps(flow) {
|
|
|
380
379
|
return loadedSteps;
|
|
381
380
|
}
|
|
382
381
|
exports.parseMablScriptIntoSteps = parseMablScriptIntoSteps;
|
|
382
|
+
function extractInputVariables(steps) {
|
|
383
|
+
return (0, MablAction_1.distinctStrings)(steps.flatMap((step) => step.getInputVariables()));
|
|
384
|
+
}
|
|
385
|
+
exports.extractInputVariables = extractInputVariables;
|
|
386
|
+
function extractOutputVariables(steps) {
|
|
387
|
+
return (0, MablAction_1.distinctStrings)(steps.flatMap((step) => step.getOutputVariables()));
|
|
388
|
+
}
|
|
389
|
+
exports.extractOutputVariables = extractOutputVariables;
|
|
@@ -5,6 +5,7 @@ const ConditionAction_1 = require("../actions/ConditionAction");
|
|
|
5
5
|
const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
|
|
6
6
|
const FindAction_1 = require("../actions/FindAction");
|
|
7
7
|
const MablStep_1 = require("../MablStep");
|
|
8
|
+
const MablAction_1 = require("../MablAction");
|
|
8
9
|
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
9
10
|
const domUtil_1 = require("../../domUtil");
|
|
10
11
|
const GetUrlAction_1 = require("../actions/GetUrlAction");
|
|
@@ -259,6 +260,15 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
259
260
|
}
|
|
260
261
|
return `${this.primaryAction.toMablscript()}.${this.conditionAction.toMablscript()}${assertAction}`;
|
|
261
262
|
}
|
|
263
|
+
getInputVariables() {
|
|
264
|
+
var _a, _b, _c, _d;
|
|
265
|
+
return (0, MablAction_1.distinctStrings)([
|
|
266
|
+
...this.primaryAction.getInputVariables(),
|
|
267
|
+
...((_b = (_a = this.countAction) === null || _a === void 0 ? void 0 : _a.getInputVariables()) !== null && _b !== void 0 ? _b : []),
|
|
268
|
+
...this.conditionAction.getInputVariables(),
|
|
269
|
+
...((_d = (_c = this.extractAction) === null || _c === void 0 ? void 0 : _c.getInputVariables()) !== null && _d !== void 0 ? _d : []),
|
|
270
|
+
]);
|
|
271
|
+
}
|
|
262
272
|
}
|
|
263
273
|
exports.AssertStep = AssertStep;
|
|
264
274
|
AssertStep.mablScriptStepNames = ['assert'];
|
|
@@ -57,6 +57,9 @@ class ClickAndHoldStep extends MablStep_1.MablStep {
|
|
|
57
57
|
toMablscript() {
|
|
58
58
|
return `${this.findAction.toMablscript()}.click_and_hold({isHtml5:${this.clickArgs.isHtml5}})`;
|
|
59
59
|
}
|
|
60
|
+
getInputVariables() {
|
|
61
|
+
return this.findAction.getInputVariables();
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
exports.ClickAndHoldStep = ClickAndHoldStep;
|
|
62
65
|
ClickAndHoldStep.mablScriptStepNames = ['click_and_hold'];
|
|
@@ -48,6 +48,9 @@ class ClickStep extends MablStep_1.MablStep {
|
|
|
48
48
|
toMablscript() {
|
|
49
49
|
return `${this.findAction.toMablscript()}.click()`;
|
|
50
50
|
}
|
|
51
|
+
getInputVariables() {
|
|
52
|
+
return this.findAction.getInputVariables();
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
exports.ClickStep = ClickStep;
|
|
53
56
|
ClickStep.mablScriptStepNames = ['click'];
|
|
@@ -227,6 +227,12 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
227
227
|
toMablscript() {
|
|
228
228
|
return `${this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '')}as("${this.variableName}")`;
|
|
229
229
|
}
|
|
230
|
+
getInputVariables() {
|
|
231
|
+
return this.actions[0].getInputVariables();
|
|
232
|
+
}
|
|
233
|
+
getOutputVariables() {
|
|
234
|
+
return [this.variableName];
|
|
235
|
+
}
|
|
230
236
|
}
|
|
231
237
|
exports.CreateVariableStep = CreateVariableStep;
|
|
232
238
|
CreateVariableStep.mablScriptStepNames = ['as'];
|
|
@@ -54,6 +54,9 @@ class DoubleClickStep extends MablStep_1.MablStep {
|
|
|
54
54
|
toMablscript() {
|
|
55
55
|
return `${this.findAction.toMablscript()}.double_click()`;
|
|
56
56
|
}
|
|
57
|
+
getInputVariables() {
|
|
58
|
+
return this.findAction.getInputVariables();
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
exports.DoubleClickStep = DoubleClickStep;
|
|
59
62
|
DoubleClickStep.mablScriptStepNames = ['double_click'];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DownloadStep = void 0;
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
5
6
|
const AwaitDownloadAction_1 = require("../actions/AwaitDownloadAction");
|
|
6
7
|
const AwaitPDFDownloadAction_1 = require("../actions/AwaitPDFDownloadAction");
|
|
7
8
|
const domUtil_1 = require("../../domUtil");
|
|
@@ -81,6 +82,9 @@ class DownloadStep extends MablStep_1.MablStep {
|
|
|
81
82
|
const mablArgs = (0, domUtil_1.buildStepArgumentString)(this.fileAttributes);
|
|
82
83
|
return `${this.awaitDownloadAction.toMablscript()}.assert_download(${mablArgs ? mablArgs : ''})`;
|
|
83
84
|
}
|
|
85
|
+
getInputVariables() {
|
|
86
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.fileAttributes);
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
89
|
exports.DownloadStep = DownloadStep;
|
|
86
90
|
DownloadStep.mablScriptStepNames = ['assert_download'];
|
|
@@ -28,6 +28,9 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
28
28
|
const stringEchoValue = `${this.echoValue}`;
|
|
29
29
|
return `echo("${(0, domUtil_1.escapeMablscriptString)(stringEchoValue)}")`;
|
|
30
30
|
}
|
|
31
|
+
getInputVariables() {
|
|
32
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.echoValue);
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
exports.EchoStep = EchoStep;
|
|
33
36
|
EchoStep.mablScriptStepNames = ['echo'];
|
|
@@ -85,6 +85,12 @@ class EnterTextStep extends MablStep_1.MablStep {
|
|
|
85
85
|
: this.substituteMablscriptVariable(this.text);
|
|
86
86
|
return `${this.findAction.toMablscript()}.enter_text(${enterText})`;
|
|
87
87
|
}
|
|
88
|
+
getInputVariables() {
|
|
89
|
+
return (0, MablAction_1.distinctStrings)([
|
|
90
|
+
...this.findAction.getInputVariables(),
|
|
91
|
+
...MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.text),
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
exports.EnterTextStep = EnterTextStep;
|
|
90
96
|
EnterTextStep.mablScriptStepNames = ['enter_text'];
|
|
@@ -30,6 +30,9 @@ class EvaluateJavaScriptStep extends MablStep_1.MablStep {
|
|
|
30
30
|
toMablscript() {
|
|
31
31
|
return this.evaluateJsAction.toMablscript();
|
|
32
32
|
}
|
|
33
|
+
getInputVariables() {
|
|
34
|
+
return this.evaluateJsAction.getInputVariables();
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
exports.EvaluateJavaScriptStep = EvaluateJavaScriptStep;
|
|
35
38
|
EvaluateJavaScriptStep.mablScriptStepNames = [JavaScriptAction_1.JavaScriptAction.mablscriptName];
|
|
@@ -53,6 +53,9 @@ class HoverStep extends MablStep_1.MablStep {
|
|
|
53
53
|
toMablscript() {
|
|
54
54
|
return `${this.findAction.toMablscript()}.hover()`;
|
|
55
55
|
}
|
|
56
|
+
getInputVariables() {
|
|
57
|
+
return this.findAction.getInputVariables();
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
exports.HoverStep = HoverStep;
|
|
58
61
|
HoverStep.mablScriptStepNames = ['hover'];
|
|
@@ -5,6 +5,7 @@ const ConditionAction_1 = require("../actions/ConditionAction");
|
|
|
5
5
|
const GetVariableValue_1 = require("../actions/GetVariableValue");
|
|
6
6
|
const AssertStep_1 = require("./AssertStep");
|
|
7
7
|
const FindAction_1 = require("../actions/FindAction");
|
|
8
|
+
const MablAction_1 = require("../MablAction");
|
|
8
9
|
const MablStep_1 = require("../MablStep");
|
|
9
10
|
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
10
11
|
const domUtil_1 = require("../../domUtil");
|
|
@@ -125,6 +126,14 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
125
126
|
toMablscript() {
|
|
126
127
|
return `${this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '')}conditional_if()`;
|
|
127
128
|
}
|
|
129
|
+
getInputVariables() {
|
|
130
|
+
var _a, _b, _c, _d;
|
|
131
|
+
return (0, MablAction_1.distinctStrings)([
|
|
132
|
+
...this.primaryAction.getInputVariables(),
|
|
133
|
+
...((_b = (_a = this.conditionAction) === null || _a === void 0 ? void 0 : _a.getInputVariables()) !== null && _b !== void 0 ? _b : []),
|
|
134
|
+
...((_d = (_c = this.extractAction) === null || _c === void 0 ? void 0 : _c.getInputVariables()) !== null && _d !== void 0 ? _d : []),
|
|
135
|
+
]);
|
|
136
|
+
}
|
|
128
137
|
}
|
|
129
138
|
exports.IfConditionStep = IfConditionStep;
|
|
130
139
|
IfConditionStep.mablScriptStepNames = ['conditional_if'];
|
|
@@ -32,6 +32,9 @@ class OpenEmailStep extends MablStep_1.MablStep {
|
|
|
32
32
|
toMablscript() {
|
|
33
33
|
return `${this.findAction.toMablscript()}.open_email("${this.tabUuid}")`;
|
|
34
34
|
}
|
|
35
|
+
getInputVariables() {
|
|
36
|
+
return this.findAction.getInputVariables();
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
exports.OpenEmailStep = OpenEmailStep;
|
|
37
40
|
OpenEmailStep.mablScriptStepNames = ['open_email'];
|
|
@@ -58,6 +58,9 @@ class ReleaseStep extends MablStep_1.MablStep {
|
|
|
58
58
|
const args = this.convertObjectToMablscriptArgs(this.releaseArgs);
|
|
59
59
|
return `${this.findAction.toMablscript()}.release(${args})`;
|
|
60
60
|
}
|
|
61
|
+
getInputVariables() {
|
|
62
|
+
return this.findAction.getInputVariables();
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
exports.ReleaseStep = ReleaseStep;
|
|
63
66
|
ReleaseStep.mablScriptStepNames = ['release'];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RemoveCookieStep = void 0;
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
5
6
|
const CookieUtils_1 = require("./CookieUtils");
|
|
6
7
|
const domUtil_1 = require("../../domUtil");
|
|
7
8
|
class RemoveCookieStep extends MablStep_1.MablStep {
|
|
@@ -23,6 +24,9 @@ class RemoveCookieStep extends MablStep_1.MablStep {
|
|
|
23
24
|
toMablscript() {
|
|
24
25
|
return `remove_cookie({ name : "${(0, domUtil_1.escapeMablscriptString)(this.cookieName)}" })`;
|
|
25
26
|
}
|
|
27
|
+
getInputVariables() {
|
|
28
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.cookieName);
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
exports.RemoveCookieStep = RemoveCookieStep;
|
|
28
32
|
RemoveCookieStep.mablScriptStepNames = ['remove_cookie'];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SelectStep = void 0;
|
|
4
4
|
const FindAction_1 = require("../actions/FindAction");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
5
6
|
const MablStep_1 = require("../MablStep");
|
|
6
7
|
const domUtil_1 = require("../../domUtil");
|
|
7
8
|
class SelectStep extends MablStep_1.MablStep {
|
|
@@ -63,6 +64,12 @@ class SelectStep extends MablStep_1.MablStep {
|
|
|
63
64
|
: '';
|
|
64
65
|
return `${this.findAction.toMablscript()}.select(${this.convertObjectToMablscriptArgs(this.selectOptions)}${selectOptionType})`;
|
|
65
66
|
}
|
|
67
|
+
getInputVariables() {
|
|
68
|
+
return (0, MablAction_1.distinctStrings)([
|
|
69
|
+
...this.findAction.getInputVariables(),
|
|
70
|
+
...MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.selectOptions),
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
66
73
|
}
|
|
67
74
|
exports.SelectStep = SelectStep;
|
|
68
75
|
SelectStep.mablScriptStepNames = ['select'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VariableSource = exports.HttpResponseAssertion = exports.SendHttpRequestStep = void 0;
|
|
4
|
+
const MablAction_1 = require("../MablAction");
|
|
4
5
|
const MablStep_1 = require("../MablStep");
|
|
5
6
|
const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
|
|
6
7
|
const AssertStep_1 = require("./AssertStep");
|
|
@@ -39,6 +40,13 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
39
40
|
toMablscript() {
|
|
40
41
|
return `send_http_request(${(0, domUtil_1.buildStepArgumentString)(this.sendRequest)})`;
|
|
41
42
|
}
|
|
43
|
+
getInputVariables() {
|
|
44
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.sendRequest);
|
|
45
|
+
}
|
|
46
|
+
getOutputVariables() {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return (_b = (_a = this.sendRequest.variables) === null || _a === void 0 ? void 0 : _a.map((variable) => variable.name)) !== null && _b !== void 0 ? _b : [];
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
exports.SendHttpRequestStep = SendHttpRequestStep;
|
|
44
52
|
SendHttpRequestStep.mablScriptStepNames = ['send_http_request'];
|
|
@@ -104,6 +104,9 @@ class SendKeyStep extends MablStep_1.MablStep {
|
|
|
104
104
|
.join();
|
|
105
105
|
return `${this.findAction.toMablscript()}.send_keys(${keysToSend})`;
|
|
106
106
|
}
|
|
107
|
+
getInputVariables() {
|
|
108
|
+
return this.findAction.getInputVariables();
|
|
109
|
+
}
|
|
107
110
|
}
|
|
108
111
|
exports.SendKeyStep = SendKeyStep;
|
|
109
112
|
SendKeyStep.mablScriptStepNames = ['send_keys'];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetCookieStep = void 0;
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
5
6
|
const CookieUtils_1 = require("./CookieUtils");
|
|
6
7
|
const domUtil_1 = require("../../domUtil");
|
|
7
8
|
const validValueCharacters = /^(!|[\x23-\x2B]|[\x2D-\x3A]|[\x3C-\x5B]|[\x5D-\x7E])*$/;
|
|
@@ -23,6 +24,12 @@ class SetCookieStep extends MablStep_1.MablStep {
|
|
|
23
24
|
toMablscript() {
|
|
24
25
|
return `set_cookie({ name : "${(0, domUtil_1.escapeMablscriptString)(this.cookieName)}", value : "${(0, domUtil_1.escapeMablscriptString)(this.cookieValue)}" })`;
|
|
25
26
|
}
|
|
27
|
+
getInputVariables() {
|
|
28
|
+
return (0, MablAction_1.distinctStrings)([
|
|
29
|
+
...MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.cookieName),
|
|
30
|
+
...MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.cookieValue),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
26
33
|
static normalizeValue(value) {
|
|
27
34
|
const trimmed = value.trim();
|
|
28
35
|
const bareValue = trimmed.startsWith('"') && trimmed.endsWith('"')
|
|
@@ -55,6 +55,9 @@ class SetFilesStep extends MablStep_1.MablStep {
|
|
|
55
55
|
.join(', ');
|
|
56
56
|
return `${this.findAction.toMablscript()}.set_files(${files})`;
|
|
57
57
|
}
|
|
58
|
+
getInputVariables() {
|
|
59
|
+
return this.findAction.getInputVariables();
|
|
60
|
+
}
|
|
58
61
|
}
|
|
59
62
|
exports.SetFilesStep = SetFilesStep;
|
|
60
63
|
SetFilesStep.mablScriptStepNames = ['set_files'];
|
|
@@ -122,6 +122,10 @@ class SwitchContextStep extends MablStep_1.MablStep {
|
|
|
122
122
|
}
|
|
123
123
|
return `${(_a = this.findAction) === null || _a === void 0 ? void 0 : _a.toMablscript()}.switch_context_to()`;
|
|
124
124
|
}
|
|
125
|
+
getInputVariables() {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
return (_b = (_a = this.findAction) === null || _a === void 0 ? void 0 : _a.getInputVariables()) !== null && _b !== void 0 ? _b : [];
|
|
128
|
+
}
|
|
125
129
|
}
|
|
126
130
|
exports.SwitchContextStep = SwitchContextStep;
|
|
127
131
|
SwitchContextStep.mablScriptStepNames = ['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 MablAction_1 = require("../MablAction");
|
|
6
7
|
const domUtil_1 = require("../../domUtil");
|
|
7
8
|
class VisitUrlStep extends MablStep_1.MablStep {
|
|
8
9
|
constructor(name, args, actions) {
|
|
@@ -35,6 +36,9 @@ class VisitUrlStep extends MablStep_1.MablStep {
|
|
|
35
36
|
}
|
|
36
37
|
return `visit_url(${resolvedUrl})`;
|
|
37
38
|
}
|
|
39
|
+
getInputVariables() {
|
|
40
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.url);
|
|
41
|
+
}
|
|
38
42
|
static normalizeUrlCloudSafe(param) {
|
|
39
43
|
return VisitUrlStep.normalizeUrl(param, true);
|
|
40
44
|
}
|
|
@@ -34,6 +34,9 @@ class WaitUntilStep extends MablStep_1.MablStep {
|
|
|
34
34
|
toMablscript() {
|
|
35
35
|
return `${this.findAction.toMablscript()}.evaluate_presence("present").assert()`;
|
|
36
36
|
}
|
|
37
|
+
getInputVariables() {
|
|
38
|
+
return this.findAction.getInputVariables();
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
exports.WaitUntilStep = WaitUntilStep;
|
|
39
42
|
WaitUntilStep.mablScriptStepNames = [];
|