@mablhq/mabl-cli 2.0.3 → 2.1.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/commands/tests/tests_cmds/run-mobile.js +1 -1
- package/commands/tests/tests_cmds/run.js +1 -1
- package/execution/index.js +5 -5
- package/http/MablHttpAgent.js +1 -4
- package/http/RequestFilteringHttpAgent.js +3 -3
- package/http/axiosProxyConfig.js +10 -7
- package/http/httpUtil.js +10 -6
- package/index.js +3 -2
- package/mablscript/MablAction.js +5 -1
- package/mablscript/MablStep.js +13 -3
- package/mablscript/MablStepV2.js +10 -4
- package/mablscript/actions/AwaitDownloadAction.js +1 -1
- package/mablscript/actions/ConditionAction.js +1 -1
- package/mablscript/actions/CountAction.js +1 -1
- package/mablscript/actions/ExtractAction.js +1 -1
- package/mablscript/actions/FindAction.js +1 -1
- package/mablscript/actions/GenerateEmailAddressAction.js +1 -1
- package/mablscript/actions/GenerateRandomStringAction.js +1 -1
- package/mablscript/actions/GetUrlAction.js +1 -1
- package/mablscript/actions/GetVariableValue.js +1 -1
- package/mablscript/actions/JavaScriptAction.js +6 -2
- package/mablscript/importer.js +3 -3
- package/mablscript/mobile/steps/CreateVariableMobileStep.js +1 -1
- package/mablscript/mobile/steps/EnterTextStep.js +2 -2
- package/mablscript/mobile/steps/NavigateBackStep.js +1 -1
- package/mablscript/mobile/steps/NavigateHomeStep.js +1 -1
- package/mablscript/mobile/steps/ScrollStep.js +1 -1
- package/mablscript/mobile/steps/SetOrientationStep.js +1 -1
- package/mablscript/mobile/steps/TapStep.js +2 -2
- package/mablscript/mobile/steps/actions/MobileFindAction.js +1 -1
- package/mablscript/mobile/steps/stepUtil.js +20 -17
- package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +13 -2
- package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +5 -0
- package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +7 -2
- package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +7 -2
- package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +9 -0
- package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +5 -0
- package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +4 -0
- package/mablscript/steps/AccessibilityCheck.js +20 -9
- package/mablscript/steps/AssertStep.js +6 -1
- package/mablscript/steps/AssertStepOld.js +5 -2
- package/mablscript/steps/AwaitTabStep.js +5 -2
- package/mablscript/steps/AwaitUploadsStep.js +6 -4
- package/mablscript/steps/ClearCookiesStep.js +6 -4
- package/mablscript/steps/ClickAndHoldStep.js +10 -3
- package/mablscript/steps/ClickStep.js +10 -3
- package/mablscript/steps/CreateVariableStep.js +16 -6
- package/mablscript/steps/DoubleClickStep.js +10 -3
- package/mablscript/steps/DownloadStep.js +4 -2
- package/mablscript/steps/EchoStep.js +5 -3
- package/mablscript/steps/ElseIfConditionStep.js +6 -2
- package/mablscript/steps/ElseStep.js +6 -4
- package/mablscript/steps/EndStep.js +6 -4
- package/mablscript/steps/EnterAuthCodeStep.js +10 -3
- package/mablscript/steps/EnterTextStep.js +8 -2
- package/mablscript/steps/EvaluateFlowStep.js +5 -2
- package/mablscript/steps/EvaluateJavaScriptStep.js +9 -3
- package/mablscript/steps/HoverStep.js +10 -3
- package/mablscript/steps/IfConditionStep.js +8 -2
- package/mablscript/steps/NavigateStep.js +5 -2
- package/mablscript/steps/OpenEmailStep.js +5 -2
- package/mablscript/steps/ReleaseStep.js +10 -3
- package/mablscript/steps/RemoveCookieStep.js +5 -2
- package/mablscript/steps/RightClickStep.js +10 -3
- package/mablscript/steps/SelectStep.js +9 -3
- package/mablscript/steps/SendHttpRequestStep.js +5 -2
- package/mablscript/steps/SendKeyStep.js +10 -3
- package/mablscript/steps/SetCookieStep.js +5 -2
- package/mablscript/steps/SetFilesStep.js +9 -3
- package/mablscript/steps/SetViewportStep.js +5 -3
- package/mablscript/steps/SwitchContextStep.js +14 -3
- package/mablscript/steps/SyntheticStep.js +1 -1
- package/mablscript/steps/VisitUrlStep.js +5 -2
- package/mablscript/steps/WaitStep.js +5 -2
- package/mablscript/steps/WaitUntilStep.js +6 -3
- package/observers/ObserverBase.js +9 -0
- package/observers/mockObserver.js +3 -3
- package/package.json +4 -4
- package/util/javaScriptStepMigration.js +1 -0
|
@@ -5,7 +5,7 @@ const MablStep_1 = require("../MablStep");
|
|
|
5
5
|
exports.DEFAULT_STEP_SOURCE_INDEX_IN_FLOW = -1;
|
|
6
6
|
class SyntheticStep extends MablStep_1.MablStep {
|
|
7
7
|
constructor(name, args = [], actions = [], stepSourceIndexInFlow = exports.DEFAULT_STEP_SOURCE_INDEX_IN_FLOW) {
|
|
8
|
-
super(name, args, actions);
|
|
8
|
+
super(name, args, actions, name);
|
|
9
9
|
this.stepSourceIndexInFlow = stepSourceIndexInFlow;
|
|
10
10
|
this.actionSourceIndexInStep = 0;
|
|
11
11
|
}
|
|
@@ -6,7 +6,7 @@ const MablAction_1 = require("../MablAction");
|
|
|
6
6
|
const domUtil_1 = require("../../domUtil");
|
|
7
7
|
class VisitUrlStep extends MablStep_1.MablStep {
|
|
8
8
|
constructor(name, args, actions) {
|
|
9
|
-
super(name, args, actions);
|
|
9
|
+
super(name, args, actions, 'visit_url');
|
|
10
10
|
const arg = this.getActionArgs()[0];
|
|
11
11
|
this.url = VisitUrlStep.normalizeUrl(arg);
|
|
12
12
|
}
|
|
@@ -16,10 +16,13 @@ class VisitUrlStep extends MablStep_1.MablStep {
|
|
|
16
16
|
toStepDescriptor() {
|
|
17
17
|
return {
|
|
18
18
|
url: this.url,
|
|
19
|
+
actionCode: this.actionCode,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
static fromYaml(_stepName, stepArgs) {
|
|
22
|
-
|
|
23
|
+
const step = new VisitUrlStep('visit_url', [stepArgs.url], []);
|
|
24
|
+
step.setStepId(stepArgs.id);
|
|
25
|
+
return step;
|
|
23
26
|
}
|
|
24
27
|
toMablscript() {
|
|
25
28
|
const resolvedUrl = this.substituteMablscriptVariable((0, domUtil_1.escapeMablscriptString)(this.url.toString()));
|
|
@@ -4,7 +4,7 @@ exports.WaitStep = void 0;
|
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
5
|
class WaitStep extends MablStep_1.MablStep {
|
|
6
6
|
constructor(name, args, actions) {
|
|
7
|
-
super(name, args, actions);
|
|
7
|
+
super(name, args, actions, 'wait');
|
|
8
8
|
this.milliseconds = WaitStep.validateWait(this.getActionArgs()[0]);
|
|
9
9
|
}
|
|
10
10
|
getStepName() {
|
|
@@ -13,10 +13,13 @@ class WaitStep extends MablStep_1.MablStep {
|
|
|
13
13
|
toStepDescriptor() {
|
|
14
14
|
return {
|
|
15
15
|
milliseconds: this.milliseconds,
|
|
16
|
+
actionCode: this.actionCode,
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
static fromYaml(_stepName, stepArgs) {
|
|
19
|
-
|
|
20
|
+
const step = new WaitStep(WaitStep.stepName, [stepArgs.milliseconds], []);
|
|
21
|
+
step.setStepId(stepArgs.id);
|
|
22
|
+
return step;
|
|
20
23
|
}
|
|
21
24
|
toMablscript() {
|
|
22
25
|
return `wait(${this.milliseconds})`;
|
|
@@ -5,7 +5,7 @@ const MablStep_1 = require("../MablStep");
|
|
|
5
5
|
const domUtil_1 = require("../../domUtil");
|
|
6
6
|
class WaitUntilStep extends MablStep_1.MablStep {
|
|
7
7
|
constructor(name, args, actions) {
|
|
8
|
-
super(name, args, actions);
|
|
8
|
+
super(name, args, actions, 'wait_until');
|
|
9
9
|
if ((0, domUtil_1.isFindElementType)(this.actions[0].getActionName())) {
|
|
10
10
|
this.findAction = this.actions[0];
|
|
11
11
|
}
|
|
@@ -23,13 +23,16 @@ class WaitUntilStep extends MablStep_1.MablStep {
|
|
|
23
23
|
return {
|
|
24
24
|
find,
|
|
25
25
|
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
26
|
+
actionCode: this.actionCode,
|
|
26
27
|
};
|
|
27
28
|
default:
|
|
28
29
|
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType} is not supported`);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
static fromYaml(_stepName,
|
|
32
|
-
|
|
32
|
+
static fromYaml(_stepName, stepArgs) {
|
|
33
|
+
const step = new WaitUntilStep('wait', [], []);
|
|
34
|
+
step.setStepId(stepArgs.id);
|
|
35
|
+
return step;
|
|
33
36
|
}
|
|
34
37
|
toMablscript() {
|
|
35
38
|
return `${this.findAction.toMablscript()}.evaluate_presence("present").assert()`;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildObserverBaseOptions = exports.OBSERVER_TIMEOUT_MILLIS = void 0;
|
|
4
|
+
exports.OBSERVER_TIMEOUT_MILLIS = 300000;
|
|
5
|
+
function buildObserverBaseOptions(executionContext) {
|
|
6
|
+
return {
|
|
7
|
+
executionContext,
|
|
8
|
+
executionIndex: executionContext.executionIndexTracker.getExecutionIndex(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.buildObserverBaseOptions = buildObserverBaseOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FakeBrowserObserver = exports.noopPageLifecycleCallback = exports.noopObserveAfterFunction = exports.noopObserveDeferredFunction = void 0;
|
|
4
4
|
const noopObserveDeferredFunction = () => Promise.resolve();
|
|
5
5
|
exports.noopObserveDeferredFunction = noopObserveDeferredFunction;
|
|
6
6
|
const noopObserveAfterFunction = () => Promise.resolve();
|
|
@@ -9,7 +9,7 @@ exports.noopPageLifecycleCallback = {
|
|
|
9
9
|
onPageCreated: () => { },
|
|
10
10
|
onPageDestroyed: () => { },
|
|
11
11
|
};
|
|
12
|
-
class
|
|
12
|
+
class FakeBrowserObserver {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.observationType = 'test';
|
|
15
15
|
this._hitCount = 0;
|
|
@@ -44,4 +44,4 @@ class FakeObserver {
|
|
|
44
44
|
this._sendObservationMessageHitCount += 1;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.
|
|
47
|
+
exports.FakeBrowserObserver = FakeBrowserObserver;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mablhq/mabl-cli",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "The official mabl command line interface tool",
|
|
6
6
|
"main": "index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/serve-handler": "6.1.0",
|
|
29
29
|
"@types/tmp": "0.2.0",
|
|
30
30
|
"@types/tough-cookie": "4.0.2",
|
|
31
|
-
"agent-base": "
|
|
31
|
+
"agent-base": "6.0.2",
|
|
32
32
|
"analytics-node": "3.5.0",
|
|
33
33
|
"appium": "2.1.2",
|
|
34
34
|
"async-mutex": "0.3.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"glob": "7.1.6",
|
|
59
59
|
"hpagent": "1.0.0",
|
|
60
60
|
"http-mitm-proxy": "1.0.0",
|
|
61
|
-
"https-proxy-agent": "
|
|
61
|
+
"https-proxy-agent": "5.0.0",
|
|
62
62
|
"humanize-duration": "3.23.0",
|
|
63
63
|
"inquirer": "8.2.5",
|
|
64
64
|
"js-yaml": "4.1.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"serve-handler": "6.1.5",
|
|
89
89
|
"set-cookie-parser": "2.5.1",
|
|
90
90
|
"simple-update-notifier": "1.1.0",
|
|
91
|
-
"socks-proxy-agent": "
|
|
91
|
+
"socks-proxy-agent": "6.1.1",
|
|
92
92
|
"stoppable": "1.1.0",
|
|
93
93
|
"strip-ansi": "6.0.0",
|
|
94
94
|
"tldts": "6.0.12",
|