@mablhq/mabl-cli 1.25.5 → 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/Globals.js +20 -0
- package/api/entities/Browser.js +1 -0
- package/api/featureSet.js +6 -2
- package/api/mablApiClient.js +10 -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 +18 -0
- package/browserLauncher/types.js +5 -1
- package/commands/browserTypes.js +19 -8
- package/commands/constants.js +6 -5
- package/commands/environments/environments_cmds/create.js +3 -0
- package/commands/tests/testsUtil.js +68 -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/execution/index.js.LICENSE.txt +6 -0
- package/index.d.ts +2 -0
- package/mablApi/index.js +1 -1
- 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/diffing/diffingUtil.js +81 -16
- 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/EvaluateFlowStep.js +8 -3
- 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 +8 -7
- package/reporters/__tests__/resources/sampleData.js +5 -0
- package/resources/mablFind.js +1 -1
- package/util/asyncUtil.js +7 -6
- package/browserLauncher/runnerType.js +0 -7
- package/domUtil/index.js.LICENSE.txt +0 -14
- package/mablscript/AttributesConstants.js +0 -115
package/util/asyncUtil.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.filterAsync = exports.mapAsync = exports.TimeoutError = exports.promiseWithTimeout = void 0;
|
|
4
4
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
5
|
-
async function promiseWithTimeout(promise, timeoutMillis, description) {
|
|
5
|
+
async function promiseWithTimeout(promise, timeoutMillis, description, timeoutType = 'mabl promise timeout') {
|
|
6
6
|
const startTimeMillis = new Date().getTime();
|
|
7
|
-
const { timer, cancelTimer } = startTimer(timeoutMillis, description);
|
|
7
|
+
const { timer, cancelTimer } = startTimer(timeoutMillis, description, timeoutType);
|
|
8
8
|
try {
|
|
9
9
|
const result = await Promise.race([timer, promise]);
|
|
10
10
|
if (loggingProvider_1.logger.isDebugEnabled()) {
|
|
@@ -24,18 +24,19 @@ async function promiseWithTimeout(promise, timeoutMillis, description) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.promiseWithTimeout = promiseWithTimeout;
|
|
26
26
|
class TimeoutError extends Error {
|
|
27
|
-
constructor(timeoutMillis, description) {
|
|
28
|
-
super(`[
|
|
27
|
+
constructor(timeoutMillis, description, timeoutType) {
|
|
28
|
+
super(`[${timeoutType}] "${description}" timed out after ${timeoutMillis}ms`);
|
|
29
29
|
this.timeoutMillis = timeoutMillis;
|
|
30
30
|
this.description = description;
|
|
31
|
+
this.timeoutType = timeoutType;
|
|
31
32
|
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
exports.TimeoutError = TimeoutError;
|
|
35
|
-
const startTimer = (timeoutMillis, description) => {
|
|
36
|
+
const startTimer = (timeoutMillis, description, timeoutType) => {
|
|
36
37
|
let timeout;
|
|
37
38
|
const promise = new Promise((_resolve, reject) => {
|
|
38
|
-
timeout = global.setTimeout(() => reject(new TimeoutError(timeoutMillis, description)), timeoutMillis);
|
|
39
|
+
timeout = global.setTimeout(() => reject(new TimeoutError(timeoutMillis, description, timeoutType)), timeoutMillis);
|
|
39
40
|
timeout.unref();
|
|
40
41
|
});
|
|
41
42
|
return {
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Complex.js v2.1.1 12/05/2020
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
|
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
6
|
-
**/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @license Fraction.js v4.2.0 05/03/2022
|
|
10
|
-
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
|
|
13
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
14
|
-
**/
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALLOWED_ASSERTABLE_EMAIL_ATTRS_PROPS = exports.isAllowedAssertableUrlAttrProps = exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS = exports.ALLOWED_ASSERTABLE_COOKIES_ATTRS_PROPS = exports.ALLOWED_ASSERTABLE_ATTRS_PROPS = void 0;
|
|
4
|
-
exports.ALLOWED_ASSERTABLE_ATTRS_PROPS = [
|
|
5
|
-
'accessKey',
|
|
6
|
-
'accessKeyLabel',
|
|
7
|
-
'align',
|
|
8
|
-
'alt',
|
|
9
|
-
'aria-checked',
|
|
10
|
-
'aria-label',
|
|
11
|
-
'aria-labelledby',
|
|
12
|
-
'aria-disabled',
|
|
13
|
-
'autofocus',
|
|
14
|
-
'border',
|
|
15
|
-
'checked',
|
|
16
|
-
'class',
|
|
17
|
-
'className',
|
|
18
|
-
'clientHeight',
|
|
19
|
-
'clientLeft',
|
|
20
|
-
'clientTop',
|
|
21
|
-
'clientWidth',
|
|
22
|
-
'complete',
|
|
23
|
-
'computedName',
|
|
24
|
-
'computedRole',
|
|
25
|
-
'contentEditable',
|
|
26
|
-
'contextMenu',
|
|
27
|
-
'crossOrigin',
|
|
28
|
-
'currentSrc',
|
|
29
|
-
'dataset',
|
|
30
|
-
'defaultChecked',
|
|
31
|
-
'defaultValue',
|
|
32
|
-
'dir',
|
|
33
|
-
'disabled',
|
|
34
|
-
'draggable',
|
|
35
|
-
'formEncType',
|
|
36
|
-
'formMethod',
|
|
37
|
-
'formNoValidate',
|
|
38
|
-
'formTarget',
|
|
39
|
-
'height',
|
|
40
|
-
'hidden',
|
|
41
|
-
'href',
|
|
42
|
-
'hspace',
|
|
43
|
-
'id',
|
|
44
|
-
'indeterminate',
|
|
45
|
-
'inert',
|
|
46
|
-
'innerText',
|
|
47
|
-
'isContentEditable',
|
|
48
|
-
'isMap',
|
|
49
|
-
'itemId',
|
|
50
|
-
'itemScope',
|
|
51
|
-
'lang',
|
|
52
|
-
'length',
|
|
53
|
-
'localName',
|
|
54
|
-
'longDesc',
|
|
55
|
-
'lowSrc',
|
|
56
|
-
'maxLength',
|
|
57
|
-
'multiple',
|
|
58
|
-
'name',
|
|
59
|
-
'namespaceURI',
|
|
60
|
-
'naturalHeight',
|
|
61
|
-
'naturalWidth',
|
|
62
|
-
'noModule',
|
|
63
|
-
'offsetHeight',
|
|
64
|
-
'offsetLeft',
|
|
65
|
-
'offsetTop',
|
|
66
|
-
'offsetWidth',
|
|
67
|
-
'prefix',
|
|
68
|
-
'referrerPolicy',
|
|
69
|
-
'required',
|
|
70
|
-
'selectedIndex',
|
|
71
|
-
'size',
|
|
72
|
-
'sizes',
|
|
73
|
-
'slot',
|
|
74
|
-
'src',
|
|
75
|
-
'srcset',
|
|
76
|
-
'tabIndex',
|
|
77
|
-
'tagName',
|
|
78
|
-
'title',
|
|
79
|
-
'translate',
|
|
80
|
-
'type',
|
|
81
|
-
'validationMessage',
|
|
82
|
-
'validity',
|
|
83
|
-
'value',
|
|
84
|
-
'vspace',
|
|
85
|
-
'width',
|
|
86
|
-
'willValidate',
|
|
87
|
-
];
|
|
88
|
-
exports.ALLOWED_ASSERTABLE_COOKIES_ATTRS_PROPS = [
|
|
89
|
-
'domain',
|
|
90
|
-
'http_only',
|
|
91
|
-
'name',
|
|
92
|
-
'path',
|
|
93
|
-
'expires',
|
|
94
|
-
'secure',
|
|
95
|
-
'value',
|
|
96
|
-
];
|
|
97
|
-
exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS = [
|
|
98
|
-
'hash',
|
|
99
|
-
'host',
|
|
100
|
-
'hostname',
|
|
101
|
-
'href',
|
|
102
|
-
'password',
|
|
103
|
-
'pathname',
|
|
104
|
-
'port',
|
|
105
|
-
'protocol',
|
|
106
|
-
'search',
|
|
107
|
-
'username',
|
|
108
|
-
];
|
|
109
|
-
const ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET = new Set(exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS);
|
|
110
|
-
const isAllowedAssertableUrlAttrProps = (x) => ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET.has(x);
|
|
111
|
-
exports.isAllowedAssertableUrlAttrProps = isAllowedAssertableUrlAttrProps;
|
|
112
|
-
exports.ALLOWED_ASSERTABLE_EMAIL_ATTRS_PROPS = [
|
|
113
|
-
'from',
|
|
114
|
-
'subject',
|
|
115
|
-
];
|