@mablhq/mabl-cli 1.62.1 → 2.0.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 +10 -10
- package/api/mablApiClient.js +39 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +6 -6
- package/cli.js +1 -0
- package/commands/app-files/app-files.js +5 -0
- package/commands/app-files/app-files_cmds/create.js +98 -0
- package/commands/app-files/app-files_cmds/delete.js +31 -0
- package/commands/app-files/app-files_cmds/download.js +50 -0
- package/commands/app-files/app-files_cmds/list.js +72 -0
- package/commands/config/config_cmds/install.js +92 -0
- package/commands/constants.js +9 -2
- package/commands/tests/testsUtil.js +9 -1
- package/commands/tests/tests_cmds/run-mobile.js +218 -0
- package/core/util.js +36 -2
- package/env/defaultEnv.js +2 -1
- package/env/dev.js +2 -1
- package/env/env.js +3 -1
- package/env/local.js +2 -1
- package/env/prod.js +2 -1
- package/execution/index.js +13 -1
- package/execution/runAppiumServer.js +133 -0
- package/mablApi/index.js +1 -1
- package/mablscript/MablAction.js +1 -1
- package/mablscript/MablStep.js +28 -2
- package/mablscript/MablStepV2.js +51 -0
- package/mablscript/MablSymbol.js +6 -2
- package/mablscript/actions/ExtractAction.js +11 -6
- package/mablscript/actions/FindAction.js +5 -5
- package/mablscript/actions/JavaScriptAction.js +19 -12
- package/mablscript/importer.js +97 -14
- package/mablscript/mobile/steps/CreateVariableMobileStep.js +53 -0
- package/mablscript/mobile/steps/EnterTextStep.js +41 -0
- package/mablscript/mobile/steps/NavigateBackStep.js +20 -0
- package/mablscript/mobile/steps/NavigateHomeStep.js +21 -0
- package/mablscript/mobile/steps/ScrollStep.js +37 -0
- package/mablscript/mobile/steps/SetOrientationStep.js +20 -0
- package/mablscript/mobile/steps/TapStep.js +37 -0
- package/mablscript/mobile/steps/actions/MobileFindAction.js +23 -0
- package/mablscript/mobile/steps/stepUtil.js +71 -0
- package/mablscript/mobile/tests/StepTestsUtil.js +20 -0
- package/mablscript/mobile/tests/TestMobileFindDescriptors.js +215 -0
- package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +287 -0
- package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +74 -0
- package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +167 -0
- package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +22 -0
- package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +22 -0
- package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +112 -0
- package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +27 -0
- package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +53 -0
- package/mablscript/steps/AssertStep.js +48 -38
- package/mablscript/steps/AssertStepOld.js +30 -2
- package/mablscript/steps/CreateVariableStep.js +9 -2
- package/mablscript/steps/EchoStep.js +4 -3
- package/mablscript/steps/ElseIfConditionStep.js +8 -2
- package/mablscript/steps/ElseStep.js +2 -1
- package/mablscript/steps/EndStep.js +2 -1
- package/mablscript/steps/EvaluateJavaScriptStep.js +6 -1
- package/mablscript/steps/IfConditionStep.js +17 -10
- package/mablscript/steps/SendHttpRequestStep.js +4 -3
- package/mablscript/steps/WaitStep.js +4 -3
- package/mablscript/types/GetVariableDescriptor.js +8 -3
- package/mablscript/types/mobile/CreateVariableMobileStepDescriptor.js +9 -0
- package/mablscript/types/mobile/EnterTextStepDescriptor.js +2 -0
- package/mablscript/types/mobile/NavigateBackStepDescriptor.js +2 -0
- package/mablscript/types/mobile/NavigateHomeStepDescriptor.js +2 -0
- package/mablscript/types/mobile/ScrollStepDescriptor.js +2 -0
- package/mablscript/types/mobile/SetOrientationStepDescriptor.js +8 -0
- package/mablscript/types/mobile/StepWithMobileFindDescriptor.js +2 -0
- package/mablscript/types/mobile/TapStepDescriptor.js +8 -0
- package/mablscriptFind/index.js +1 -1
- package/package.json +8 -3
- package/resources/webdriver.js +21 -0
- package/upload/index.js +5 -0
- package/util/FileCache.js +180 -0
- package/util/Lazy.js +90 -0
- package/util/MobileAppFileCache.js +102 -0
- package/util/RichPromise.js +3 -1
- package/webdriver/index.js +41 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateVariableStep = void 0;
|
|
3
|
+
exports.isCreateVariableStep = exports.CreateVariableStep = 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");
|
|
@@ -17,7 +17,7 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
17
17
|
this.generationType = this.calculateGenerationType();
|
|
18
18
|
}
|
|
19
19
|
getStepName() {
|
|
20
|
-
return
|
|
20
|
+
return CreateVariableStep.stepName;
|
|
21
21
|
}
|
|
22
22
|
calculateGenerationType() {
|
|
23
23
|
if (this.actions.length === 2 && this.actions[0] instanceof FindAction_1.FindAction) {
|
|
@@ -192,5 +192,12 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
exports.CreateVariableStep = CreateVariableStep;
|
|
195
|
+
CreateVariableStep.stepName = 'CreateVariable';
|
|
195
196
|
CreateVariableStep.mablScriptStepNames = ['as'];
|
|
196
197
|
CreateVariableStep.yamlMablScriptNames = ['CreateVariable', 'GenerateEmailAddress'];
|
|
198
|
+
function isCreateVariableStep(value) {
|
|
199
|
+
return ((value === null || value === void 0 ? void 0 : value.getStepName) &&
|
|
200
|
+
value.getStepName() === CreateVariableStep.stepName &&
|
|
201
|
+
!!value.generationType);
|
|
202
|
+
}
|
|
203
|
+
exports.isCreateVariableStep = isCreateVariableStep;
|
|
@@ -10,13 +10,13 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
10
10
|
this.echoValue = (0, MablAction_1.parseArgument)(this.getActionArgs()[0]);
|
|
11
11
|
}
|
|
12
12
|
getStepName() {
|
|
13
|
-
return
|
|
13
|
+
return EchoStep.stepName;
|
|
14
14
|
}
|
|
15
15
|
toStepDescriptor() {
|
|
16
16
|
return { value: this.echoValue.toString() };
|
|
17
17
|
}
|
|
18
18
|
static fromYaml(_stepName, stepArgs) {
|
|
19
|
-
return new EchoStep(
|
|
19
|
+
return new EchoStep(EchoStep.stepName, [stepArgs.value], []);
|
|
20
20
|
}
|
|
21
21
|
toMablscript() {
|
|
22
22
|
const stringEchoValue = `${this.echoValue}`;
|
|
@@ -27,5 +27,6 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.EchoStep = EchoStep;
|
|
30
|
+
EchoStep.stepName = 'Echo';
|
|
30
31
|
EchoStep.mablScriptStepNames = ['echo'];
|
|
31
|
-
EchoStep.yamlMablScriptNames = [
|
|
32
|
+
EchoStep.yamlMablScriptNames = [EchoStep.stepName];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ElseIfConditionStep = void 0;
|
|
3
|
+
exports.isElseIfConditionStep = exports.ElseIfConditionStep = void 0;
|
|
4
4
|
const MablAction_1 = require("../MablAction");
|
|
5
5
|
const IfConditionStep_1 = require("./IfConditionStep");
|
|
6
6
|
class ElseIfConditionStep extends IfConditionStep_1.IfConditionStep {
|
|
@@ -18,5 +18,11 @@ class ElseIfConditionStep extends IfConditionStep_1.IfConditionStep {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.ElseIfConditionStep = ElseIfConditionStep;
|
|
21
|
-
ElseIfConditionStep.
|
|
21
|
+
ElseIfConditionStep.stepName = 'conditional_else_if';
|
|
22
|
+
ElseIfConditionStep.mablScriptStepNames = [ElseIfConditionStep.stepName];
|
|
22
23
|
ElseIfConditionStep.yamlMablScriptNames = ['ElseIf'];
|
|
24
|
+
function isElseIfConditionStep(value) {
|
|
25
|
+
return ((value === null || value === void 0 ? void 0 : value.getStepName) &&
|
|
26
|
+
(value === null || value === void 0 ? void 0 : value.getStepName()) === ElseIfConditionStep.yamlMablScriptNames[0]);
|
|
27
|
+
}
|
|
28
|
+
exports.isElseIfConditionStep = isElseIfConditionStep;
|
|
@@ -20,5 +20,6 @@ class ElseStep extends MablStep_1.MablStep {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.ElseStep = ElseStep;
|
|
23
|
-
ElseStep.
|
|
23
|
+
ElseStep.stepName = 'conditional_else';
|
|
24
|
+
ElseStep.mablScriptStepNames = [ElseStep.stepName];
|
|
24
25
|
ElseStep.yamlMablScriptNames = ['Else'];
|
|
@@ -20,5 +20,6 @@ class EndStep extends MablStep_1.MablStep {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.EndStep = EndStep;
|
|
23
|
-
EndStep.
|
|
23
|
+
EndStep.stepName = 'conditional_end';
|
|
24
|
+
EndStep.mablScriptStepNames = [EndStep.stepName];
|
|
24
25
|
EndStep.yamlMablScriptNames = ['End'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EvaluateJavaScriptStep = void 0;
|
|
3
|
+
exports.isEvaluateJavaScriptStep = exports.EvaluateJavaScriptStep = void 0;
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
5
|
const JavaScriptAction_1 = require("../actions/JavaScriptAction");
|
|
6
6
|
const STEP_NAME = 'EvaluateJavaScript';
|
|
@@ -35,5 +35,10 @@ class EvaluateJavaScriptStep extends MablStep_1.MablStep {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
exports.EvaluateJavaScriptStep = EvaluateJavaScriptStep;
|
|
38
|
+
EvaluateJavaScriptStep.stepName = STEP_NAME;
|
|
38
39
|
EvaluateJavaScriptStep.mablScriptStepNames = [JavaScriptAction_1.JavaScriptAction.mablscriptName];
|
|
39
40
|
EvaluateJavaScriptStep.yamlMablScriptNames = [STEP_NAME];
|
|
41
|
+
function isEvaluateJavaScriptStep(value) {
|
|
42
|
+
return (value === null || value === void 0 ? void 0 : value.getStepName) && (value === null || value === void 0 ? void 0 : value.getStepName()) === STEP_NAME;
|
|
43
|
+
}
|
|
44
|
+
exports.isEvaluateJavaScriptStep = isEvaluateJavaScriptStep;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IfConditionStep = void 0;
|
|
3
|
+
exports.isIfConditionStep = exports.IfConditionStep = void 0;
|
|
4
4
|
const ConditionAction_1 = require("../actions/ConditionAction");
|
|
5
5
|
const GetVariableValue_1 = require("../actions/GetVariableValue");
|
|
6
6
|
const AssertStep_1 = require("./AssertStep");
|
|
@@ -56,7 +56,7 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
56
56
|
if (this.conditionAction) {
|
|
57
57
|
details.condition =
|
|
58
58
|
AssertStep_1.fieldToAssertionStep[this.conditionAction.conditionAttribute];
|
|
59
|
-
if (this.conditionAction.conditionValueAttribute) {
|
|
59
|
+
if (this.conditionAction.conditionValueAttribute !== undefined) {
|
|
60
60
|
details.conditionValue = this.conditionAction.conditionValueAttribute;
|
|
61
61
|
}
|
|
62
62
|
if (this.conditionAction.options !== undefined) {
|
|
@@ -67,12 +67,13 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
67
67
|
details.variableName = this.substituteMablscriptVariable(this.primaryAction.variable);
|
|
68
68
|
}
|
|
69
69
|
if (this.primaryAction instanceof JavaScriptAction_1.JavaScriptAction) {
|
|
70
|
-
const jsYaml = this.primaryAction.
|
|
71
|
-
if (jsYaml.
|
|
72
|
-
details.
|
|
70
|
+
const jsYaml = JavaScriptAction_1.JavaScriptAction.toYamlFromJavaScriptDescriptor(this.primaryAction.javaScript);
|
|
71
|
+
if (jsYaml.snippet) {
|
|
72
|
+
details.snippet = jsYaml.snippet;
|
|
73
|
+
details.snippet.parameterOverrides = jsYaml.parameterOverrides;
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
details.
|
|
75
|
+
else {
|
|
76
|
+
details.snippet = jsYaml;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
if (this.extractAction) {
|
|
@@ -114,8 +115,8 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
114
115
|
`{{@${stepArgs.variableName}}}`,
|
|
115
116
|
]));
|
|
116
117
|
}
|
|
117
|
-
if (stepArgs.
|
|
118
|
-
actions.push(JavaScriptAction_1.JavaScriptAction.fromYaml(stepArgs));
|
|
118
|
+
if (stepArgs.snippet) {
|
|
119
|
+
actions.push(JavaScriptAction_1.JavaScriptAction.fromYaml(stepArgs.snippet));
|
|
119
120
|
}
|
|
120
121
|
if (stepArgs.condition) {
|
|
121
122
|
const conditionType = AssertStep_1.assertionStepToField[stepArgs.condition];
|
|
@@ -146,5 +147,11 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
exports.IfConditionStep = IfConditionStep;
|
|
149
|
-
IfConditionStep.
|
|
150
|
+
IfConditionStep.stepName = 'conditional_if';
|
|
151
|
+
IfConditionStep.mablScriptStepNames = [IfConditionStep.stepName];
|
|
150
152
|
IfConditionStep.yamlMablScriptNames = ['If'];
|
|
153
|
+
function isIfConditionStep(value) {
|
|
154
|
+
return ((value === null || value === void 0 ? void 0 : value.getStepName) &&
|
|
155
|
+
(value === null || value === void 0 ? void 0 : value.getStepName()) === IfConditionStep.yamlMablScriptNames[0]);
|
|
156
|
+
}
|
|
157
|
+
exports.isIfConditionStep = isIfConditionStep;
|
|
@@ -14,7 +14,7 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
14
14
|
this.sendRequest = this.getActionArgs()[0];
|
|
15
15
|
}
|
|
16
16
|
getStepName() {
|
|
17
|
-
return
|
|
17
|
+
return SendHttpRequestStep.stepName;
|
|
18
18
|
}
|
|
19
19
|
toStepDescriptor() {
|
|
20
20
|
const formatted = JSON.parse(JSON.stringify(this.sendRequest));
|
|
@@ -35,7 +35,7 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
35
35
|
assertion: AssertStep_1.assertionStepToField[`Assert${assertion.assertion}`],
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
|
-
return new SendHttpRequestStep(
|
|
38
|
+
return new SendHttpRequestStep(SendHttpRequestStep.stepName, [formatted], []);
|
|
39
39
|
}
|
|
40
40
|
toMablscript() {
|
|
41
41
|
return `send_http_request(${(0, domUtil_1.buildStepArgumentString)({
|
|
@@ -52,8 +52,9 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.SendHttpRequestStep = SendHttpRequestStep;
|
|
55
|
+
SendHttpRequestStep.stepName = 'SendHttpRequest';
|
|
55
56
|
SendHttpRequestStep.mablScriptStepNames = ['send_http_request'];
|
|
56
|
-
SendHttpRequestStep.yamlMablScriptNames = [
|
|
57
|
+
SendHttpRequestStep.yamlMablScriptNames = [SendHttpRequestStep.stepName];
|
|
57
58
|
var HttpResponseAssertion;
|
|
58
59
|
(function (HttpResponseAssertion) {
|
|
59
60
|
function toComparisonDescriptor(assertion) {
|
|
@@ -8,7 +8,7 @@ class WaitStep extends MablStep_1.MablStep {
|
|
|
8
8
|
this.milliseconds = WaitStep.validateWait(this.getActionArgs()[0]);
|
|
9
9
|
}
|
|
10
10
|
getStepName() {
|
|
11
|
-
return
|
|
11
|
+
return WaitStep.stepName;
|
|
12
12
|
}
|
|
13
13
|
toStepDescriptor() {
|
|
14
14
|
return {
|
|
@@ -16,7 +16,7 @@ class WaitStep extends MablStep_1.MablStep {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
static fromYaml(_stepName, stepArgs) {
|
|
19
|
-
return new WaitStep(
|
|
19
|
+
return new WaitStep(WaitStep.stepName, [stepArgs.milliseconds], []);
|
|
20
20
|
}
|
|
21
21
|
toMablscript() {
|
|
22
22
|
return `wait(${this.milliseconds})`;
|
|
@@ -29,5 +29,6 @@ class WaitStep extends MablStep_1.MablStep {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.WaitStep = WaitStep;
|
|
32
|
+
WaitStep.stepName = 'Wait';
|
|
32
33
|
WaitStep.mablScriptStepNames = ['wait'];
|
|
33
|
-
WaitStep.yamlMablScriptNames = [
|
|
34
|
+
WaitStep.yamlMablScriptNames = [WaitStep.stepName];
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newGetVariableDescriptor = exports.isGetVariableDescriptor = void 0;
|
|
3
|
+
exports.convertGetVariableDescriptorToYaml = exports.newGetVariableDescriptor = exports.isGetVariableDescriptor = exports.GET_VARIABLE_VALUE = void 0;
|
|
4
|
+
exports.GET_VARIABLE_VALUE = 'GetVariable';
|
|
4
5
|
function isGetVariableDescriptor(value) {
|
|
5
|
-
return value.kind ===
|
|
6
|
+
return value.kind === exports.GET_VARIABLE_VALUE;
|
|
6
7
|
}
|
|
7
8
|
exports.isGetVariableDescriptor = isGetVariableDescriptor;
|
|
8
9
|
function newGetVariableDescriptor(variable) {
|
|
9
|
-
return { kind:
|
|
10
|
+
return { kind: exports.GET_VARIABLE_VALUE, variable };
|
|
10
11
|
}
|
|
11
12
|
exports.newGetVariableDescriptor = newGetVariableDescriptor;
|
|
13
|
+
function convertGetVariableDescriptorToYaml(descriptor) {
|
|
14
|
+
return { ...descriptor, variable: descriptor.variable.toString() };
|
|
15
|
+
}
|
|
16
|
+
exports.convertGetVariableDescriptorToYaml = convertGetVariableDescriptorToYaml;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCreateVariableMobileFindStepDescriptor = void 0;
|
|
4
|
+
function isCreateVariableMobileFindStepDescriptor(value) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6
|
+
return !!(((_c = (_b = (_a = value.find) === null || _a === void 0 ? void 0 : _a.findTarget) === null || _b === void 0 ? void 0 : _b.selector) === null || _c === void 0 ? void 0 : _c.iOS) ||
|
|
7
|
+
((_f = (_e = (_d = value.find) === null || _d === void 0 ? void 0 : _d.findTarget) === null || _e === void 0 ? void 0 : _e.selector) === null || _f === void 0 ? void 0 : _f.android));
|
|
8
|
+
}
|
|
9
|
+
exports.isCreateVariableMobileFindStepDescriptor = isCreateVariableMobileFindStepDescriptor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Orientation = void 0;
|
|
4
|
+
var Orientation;
|
|
5
|
+
(function (Orientation) {
|
|
6
|
+
Orientation["Landscape"] = "LANDSCAPE";
|
|
7
|
+
Orientation["Portrait"] = "PORTRAIT";
|
|
8
|
+
})(Orientation = exports.Orientation || (exports.Orientation = {}));
|