@mablhq/mabl-cli 1.17.0 → 1.17.6
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/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +11 -9
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +2 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +3 -0
- package/commands/constants.js +3 -2
- package/commands/tests/testsUtil.js +11 -6
- package/commands/tests/tests_cmds/run.js +5 -0
- package/domUtil/index.js +1 -1
- package/domUtil/index.js.LICENSE.txt +5 -5
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +5 -5
- package/mablscript/actions/FindAction.js +40 -39
- package/mablscript/steps/AccessibilityCheck.js +5 -5
- package/mablscript/steps/AssertStep.js +12 -12
- package/mablscript/steps/AssertStepOld.js +8 -8
- package/mablscript/steps/ClickAndHoldStep.js +5 -5
- package/mablscript/steps/ClickStep.js +5 -5
- package/mablscript/steps/CreateVariableStep.js +2 -2
- package/mablscript/steps/DoubleClickStep.js +6 -6
- package/mablscript/steps/EnterTextStep.js +7 -7
- package/mablscript/steps/HoverStep.js +5 -5
- package/mablscript/steps/IfConditionStep.js +6 -6
- package/mablscript/steps/ReleaseStep.js +5 -5
- package/mablscript/steps/SelectStep.js +5 -5
- package/mablscript/steps/SendKeyStep.js +6 -6
- package/mablscript/steps/SetFilesStep.js +5 -5
- package/mablscript/steps/SwitchContextStep.js +3 -3
- package/mablscript/steps/WaitUntilStep.js +3 -3
- package/mablscriptFind/index.js +1 -1
- package/mablscriptFind/index.js.LICENSE.txt +5 -5
- package/package.json +1 -1
- package/resources/mablFind.js +1 -1
|
@@ -180,9 +180,9 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
180
180
|
*/
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
|
-
* @license Complex.js v2.0.12
|
|
183
|
+
* @license Complex.js v2.0.15 12/05/2020
|
|
184
184
|
*
|
|
185
|
-
* Copyright (c)
|
|
185
|
+
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
|
|
186
186
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
187
187
|
**/
|
|
188
188
|
|
|
@@ -199,10 +199,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
199
199
|
*/
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
* @license Fraction.js v4.
|
|
203
|
-
*
|
|
202
|
+
* @license Fraction.js v4.1.3 23/05/2021
|
|
203
|
+
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
204
204
|
*
|
|
205
|
-
* Copyright (c)
|
|
205
|
+
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
|
|
206
206
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
207
207
|
**/
|
|
208
208
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalize = exports.isElementSelector = exports.FindAction = exports.findTypesToFormattedType = void 0;
|
|
4
|
-
const
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
5
|
const MablAction_1 = require("../MablAction");
|
|
6
|
+
const mablscriptFind_1 = require("../../mablscriptFind");
|
|
6
7
|
const MablStep_1 = require("../MablStep");
|
|
7
8
|
exports.findTypesToFormattedType = {
|
|
8
9
|
find_all: 'FindAll',
|
|
@@ -19,14 +20,14 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
19
20
|
constructor(name, args) {
|
|
20
21
|
super(name, args);
|
|
21
22
|
const actionName = this.getActionName();
|
|
22
|
-
if (!(0,
|
|
23
|
+
if (!(0, domUtil_1.isFindType)(actionName)) {
|
|
23
24
|
throw new Error(`Unknown find type for action: ${actionName}`);
|
|
24
25
|
}
|
|
25
|
-
const findType =
|
|
26
|
+
const findType = domUtil_1.FindType.fromString(actionName);
|
|
26
27
|
const [selectors, options] = this.getActionArgs();
|
|
27
28
|
this.isValid = true;
|
|
28
29
|
switch (findType) {
|
|
29
|
-
case
|
|
30
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
30
31
|
if (!isElementSelector(selectors)) {
|
|
31
32
|
this.isValid = false;
|
|
32
33
|
}
|
|
@@ -41,15 +42,15 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
41
42
|
findType,
|
|
42
43
|
findTarget,
|
|
43
44
|
};
|
|
44
|
-
if ((0,
|
|
45
|
+
if ((0, domUtil_1.isFindOptions)(options)) {
|
|
45
46
|
this.findDescriptor.findOptions = options;
|
|
46
47
|
}
|
|
47
48
|
break;
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
51
|
-
case
|
|
52
|
-
if (!(0,
|
|
49
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
50
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
51
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
52
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
53
|
+
if (!(0, domUtil_1.isCssSelector)(selectors) && !(0, domUtil_1.isXPathSelector)(selectors)) {
|
|
53
54
|
this.isValid = false;
|
|
54
55
|
}
|
|
55
56
|
this.findDescriptor = {
|
|
@@ -57,8 +58,8 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
57
58
|
findTarget: selectors,
|
|
58
59
|
};
|
|
59
60
|
break;
|
|
60
|
-
case
|
|
61
|
-
if (!(0,
|
|
61
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
62
|
+
if (!(0, domUtil_1.isCookieSelector)(selectors)) {
|
|
62
63
|
this.isValid = false;
|
|
63
64
|
}
|
|
64
65
|
this.findDescriptor = {
|
|
@@ -66,8 +67,8 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
66
67
|
findTarget: selectors,
|
|
67
68
|
};
|
|
68
69
|
break;
|
|
69
|
-
case
|
|
70
|
-
if (!(0,
|
|
70
|
+
case domUtil_1.FindType.FIND_EMAIL:
|
|
71
|
+
if (!(0, domUtil_1.isEmailSelector)(selectors)) {
|
|
71
72
|
this.isValid = false;
|
|
72
73
|
}
|
|
73
74
|
this.findDescriptor = {
|
|
@@ -75,8 +76,8 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
75
76
|
findTarget: selectors,
|
|
76
77
|
};
|
|
77
78
|
break;
|
|
78
|
-
case
|
|
79
|
-
if (selectors !== 'initial' && !(0,
|
|
79
|
+
case domUtil_1.FindType.FIND_TAB:
|
|
80
|
+
if (selectors !== 'initial' && !(0, domUtil_1.isTabSelector)(selectors)) {
|
|
80
81
|
this.isValid = false;
|
|
81
82
|
}
|
|
82
83
|
this.findDescriptor = {
|
|
@@ -119,14 +120,14 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
119
120
|
const result = {};
|
|
120
121
|
const find = this.toDescriptor();
|
|
121
122
|
switch (find.findType) {
|
|
122
|
-
case
|
|
123
|
-
case
|
|
124
|
-
case
|
|
125
|
-
case
|
|
123
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
124
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
125
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
126
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
126
127
|
result.find_type = find.findType;
|
|
127
128
|
result.selector = find.findTarget;
|
|
128
129
|
break;
|
|
129
|
-
case
|
|
130
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
130
131
|
result.selector = find.findTarget.selector;
|
|
131
132
|
if ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
132
133
|
result.selectorAncestors = find.findTarget.auxiliaryDescriptors.map((descriptor) => descriptor.selector);
|
|
@@ -139,15 +140,15 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
139
140
|
}
|
|
140
141
|
getSelIdeTarget() {
|
|
141
142
|
switch (this.findDescriptor.findType) {
|
|
142
|
-
case
|
|
143
|
-
case
|
|
144
|
-
case
|
|
145
|
-
case
|
|
146
|
-
if ((0,
|
|
143
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
144
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
145
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
146
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
147
|
+
if ((0, domUtil_1.isCssSelector)(this.findDescriptor.findTarget)) {
|
|
147
148
|
return `css=${this.findDescriptor.findTarget.css_query}`;
|
|
148
149
|
}
|
|
149
150
|
return `xpath=${this.findDescriptor.findTarget.xpath}`;
|
|
150
|
-
case
|
|
151
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
151
152
|
return `xpath=${this.findDescriptor.findTarget.selector.xpath}`;
|
|
152
153
|
default:
|
|
153
154
|
throw new Error(`Error generating SeleniumIDE target for ${this.getActionName()}: Unimplemented find type ${this.findDescriptor.findType}`);
|
|
@@ -159,7 +160,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
159
160
|
generateMablscriptFindOne() {
|
|
160
161
|
var _a;
|
|
161
162
|
switch (this.findDescriptor.findType) {
|
|
162
|
-
case
|
|
163
|
+
case domUtil_1.FindType.FIND_ONE: {
|
|
163
164
|
const find = this.findDescriptor;
|
|
164
165
|
const action = find.findType;
|
|
165
166
|
const selectors = ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length)
|
|
@@ -176,18 +177,18 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
176
177
|
const args = [selectors, options].filter((str) => str).join(', ');
|
|
177
178
|
return `${action}(${args})`;
|
|
178
179
|
}
|
|
179
|
-
case
|
|
180
|
-
case
|
|
181
|
-
case
|
|
182
|
-
case
|
|
183
|
-
case
|
|
184
|
-
case
|
|
180
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
181
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
182
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
183
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
184
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
185
|
+
case domUtil_1.FindType.FIND_EMAIL: {
|
|
185
186
|
const find = this.findDescriptor;
|
|
186
187
|
const action = find.findType;
|
|
187
188
|
const args = (0, mablscriptFind_1.buildElementSelectorString)(find.findTarget);
|
|
188
189
|
return `${action}(${args})`;
|
|
189
190
|
}
|
|
190
|
-
case
|
|
191
|
+
case domUtil_1.FindType.FIND_TAB:
|
|
191
192
|
if (this.findDescriptor.findTarget === 'initial') {
|
|
192
193
|
return `${this.findDescriptor.findType}("${this.findDescriptor.findTarget}")`;
|
|
193
194
|
}
|
|
@@ -239,15 +240,15 @@ function isElementSelector(maybeSelectors) {
|
|
|
239
240
|
const [target, ancestor] = Array.isArray(maybeSelectors)
|
|
240
241
|
? [...maybeSelectors]
|
|
241
242
|
: [maybeSelectors];
|
|
242
|
-
const validTarget = (0,
|
|
243
|
+
const validTarget = (0, domUtil_1.isStandardSelector)(target) || (0, domUtil_1.isNormalizedFindDescriptor)(target);
|
|
243
244
|
const validAncestor = !ancestor ||
|
|
244
|
-
(0,
|
|
245
|
-
(0,
|
|
245
|
+
(0, domUtil_1.isStandardSelector)(ancestor) ||
|
|
246
|
+
(0, domUtil_1.isNormalizedFindDescriptor)(ancestor);
|
|
246
247
|
return !!(validTarget && validAncestor);
|
|
247
248
|
}
|
|
248
249
|
exports.isElementSelector = isElementSelector;
|
|
249
250
|
function normalize(maybeFindDescriptor) {
|
|
250
|
-
if ((0,
|
|
251
|
+
if ((0, domUtil_1.isNormalizedFindDescriptor)(maybeFindDescriptor)) {
|
|
251
252
|
return { ...maybeFindDescriptor };
|
|
252
253
|
}
|
|
253
254
|
return { selector: maybeFindDescriptor };
|
|
@@ -4,7 +4,7 @@ exports.AccessibilityCheckStep = exports.AccessibilityCheckSeverity = void 0;
|
|
|
4
4
|
const MablStep_1 = require("../MablStep");
|
|
5
5
|
const FindAction_1 = require("../actions/FindAction");
|
|
6
6
|
const ActionsUtils_1 = require("./ActionsUtils");
|
|
7
|
-
const
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
8
8
|
var AccessibilityCheckSeverity;
|
|
9
9
|
(function (AccessibilityCheckSeverity) {
|
|
10
10
|
AccessibilityCheckSeverity["Critical"] = "critical";
|
|
@@ -32,10 +32,10 @@ class AccessibilityCheckStep extends MablStep_1.MablStep {
|
|
|
32
32
|
if (this.findAction) {
|
|
33
33
|
const find = this.findAction.toDescriptor();
|
|
34
34
|
switch (find.findType) {
|
|
35
|
-
case
|
|
36
|
-
case
|
|
37
|
-
case
|
|
38
|
-
case
|
|
35
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
36
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
37
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
38
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
39
39
|
return {
|
|
40
40
|
...this.checkConfig,
|
|
41
41
|
find,
|
|
@@ -6,7 +6,7 @@ const SeleniumIdeStep_1 = require("./SeleniumIdeStep");
|
|
|
6
6
|
const FindAction_1 = require("../actions/FindAction");
|
|
7
7
|
const MablStep_1 = require("../MablStep");
|
|
8
8
|
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
9
|
-
const
|
|
9
|
+
const domUtil_1 = require("../../domUtil");
|
|
10
10
|
const GetUrlAction_1 = require("../actions/GetUrlAction");
|
|
11
11
|
const GetCurrentLocationDescriptor_1 = require("../types/GetCurrentLocationDescriptor");
|
|
12
12
|
const GetVariableValue_1 = require("../actions/GetVariableValue");
|
|
@@ -78,7 +78,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
78
78
|
determineIfWaitUntilStep() {
|
|
79
79
|
var _a, _b;
|
|
80
80
|
const find = this.primaryAction.toDescriptor();
|
|
81
|
-
if ((0,
|
|
81
|
+
if ((0, domUtil_1.isFindElementDescriptor)(find)) {
|
|
82
82
|
if ((_b = (_a = find.findOptions) === null || _a === void 0 ? void 0 : _a.waitUntil) === null || _b === void 0 ? void 0 : _b.timeoutSeconds) {
|
|
83
83
|
return true;
|
|
84
84
|
}
|
|
@@ -133,19 +133,19 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
switch (find.findType) {
|
|
136
|
-
case
|
|
137
|
-
case
|
|
136
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
137
|
+
case domUtil_1.FindType.FIND_EMAIL:
|
|
138
138
|
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
139
139
|
formatted.selector = find.findTarget;
|
|
140
140
|
break;
|
|
141
|
-
case
|
|
142
|
-
case
|
|
143
|
-
case
|
|
144
|
-
case
|
|
141
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
142
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
143
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
144
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
145
145
|
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
146
146
|
formatted.selector = find.findTarget;
|
|
147
147
|
break;
|
|
148
|
-
case
|
|
148
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
149
149
|
formatted.selector = find.findTarget.selector;
|
|
150
150
|
if (find.findOptions) {
|
|
151
151
|
formatted.findOptions = find.findOptions;
|
|
@@ -187,8 +187,8 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
187
187
|
const find = this.primaryAction.toDescriptor();
|
|
188
188
|
if (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
|
|
189
189
|
!(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
|
|
190
|
-
(find.findType ===
|
|
191
|
-
find.findType ===
|
|
190
|
+
(find.findType === domUtil_1.FindType.FIND_EMAIL ||
|
|
191
|
+
find.findType === domUtil_1.FindType.FIND_COOKIE)) {
|
|
192
192
|
return [this.unsupportedSelIdeExportStep()];
|
|
193
193
|
}
|
|
194
194
|
if (this.assertionType === 'present') {
|
|
@@ -215,7 +215,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
215
215
|
}
|
|
216
216
|
return buildSeleniumIdeJsAssertion(stepIndex, (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
|
|
217
217
|
!(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
|
|
218
|
-
find.findType ===
|
|
218
|
+
find.findType === domUtil_1.FindType.FIND_ONE &&
|
|
219
219
|
find.findTarget.selector.xpath) ||
|
|
220
220
|
'', this.extractAction ? this.extractAction.extractionAttribute : '', this.substituteSeleniumVariable(this.conditionAction.conditionValueAttribute || ''), this.assertionType, this);
|
|
221
221
|
}
|
|
@@ -4,7 +4,7 @@ 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
9
|
const oldToNewAssertionTypes = {
|
|
10
10
|
assert_contains: 'AssertContains',
|
|
@@ -63,19 +63,19 @@ class AssertStepOld extends MablStep_1.MablStep {
|
|
|
63
63
|
}
|
|
64
64
|
const find = this.findAction.toDescriptor();
|
|
65
65
|
switch (find.findType) {
|
|
66
|
-
case
|
|
67
|
-
case
|
|
66
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
67
|
+
case domUtil_1.FindType.FIND_EMAIL:
|
|
68
68
|
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
69
69
|
formatted.selector = find.findTarget;
|
|
70
70
|
break;
|
|
71
|
-
case
|
|
72
|
-
case
|
|
73
|
-
case
|
|
74
|
-
case
|
|
71
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
72
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
73
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
74
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
75
75
|
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
76
76
|
formatted.selector = find.findTarget;
|
|
77
77
|
break;
|
|
78
|
-
case
|
|
78
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
79
79
|
formatted.selector = find.findTarget.selector;
|
|
80
80
|
break;
|
|
81
81
|
default:
|
|
@@ -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,
|
|
@@ -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),
|
|
@@ -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 {
|
|
@@ -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),
|
|
@@ -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
13
|
this.text = (0, MablAction_1.parseArgument)(arg);
|
|
14
14
|
this.validate();
|
|
15
|
-
if ((0,
|
|
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 =
|
|
@@ -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),
|
|
@@ -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");
|
|
@@ -77,13 +77,13 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
77
77
|
if (this.primaryAction instanceof FindAction_1.FindAction) {
|
|
78
78
|
const find = this.primaryAction.toDescriptor();
|
|
79
79
|
switch (find.findType) {
|
|
80
|
-
case
|
|
81
|
-
case
|
|
82
|
-
case
|
|
83
|
-
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:
|
|
84
84
|
details.selector = find.findTarget;
|
|
85
85
|
break;
|
|
86
|
-
case
|
|
86
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
87
87
|
details.selector = find.findTarget.selector;
|
|
88
88
|
if (find.findOptions) {
|
|
89
89
|
details.findOptions = find.findOptions;
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -4,7 +4,7 @@ exports.SendKeyStep = 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 SendKeyStepDescriptor_1 = require("../types/SendKeyStepDescriptor");
|
|
9
9
|
const STEP_NAME = 'SendKeys';
|
|
10
10
|
const SEL_IDE_KEYS = {
|
|
@@ -35,7 +35,7 @@ class SendKeyStep extends MablStep_1.MablStep {
|
|
|
35
35
|
if (this.actions.length !== 1 && !(this.actions[0] instanceof FindAction_1.FindAction)) {
|
|
36
36
|
throw new Error(`${name} step should have one sub-action and it should be a find`);
|
|
37
37
|
}
|
|
38
|
-
if ((0,
|
|
38
|
+
if ((0, domUtil_1.isFindElementType)(this.actions[0].getActionName())) {
|
|
39
39
|
this.findAction = this.actions[0];
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
@@ -58,10 +58,10 @@ class SendKeyStep extends MablStep_1.MablStep {
|
|
|
58
58
|
toStepDescriptor() {
|
|
59
59
|
const find = this.findAction.toDescriptor();
|
|
60
60
|
switch (find.findType) {
|
|
61
|
-
case
|
|
62
|
-
case
|
|
63
|
-
case
|
|
64
|
-
case
|
|
61
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
62
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
63
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
64
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
65
65
|
return {
|
|
66
66
|
find,
|
|
67
67
|
keys: this.keys,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SetFilesStep = 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 SetFilesStep extends MablStep_1.MablStep {
|
|
8
8
|
constructor(name, args, actions) {
|
|
9
9
|
super(name, args, actions);
|
|
@@ -24,10 +24,10 @@ class SetFilesStep extends MablStep_1.MablStep {
|
|
|
24
24
|
formatted.files = this.files;
|
|
25
25
|
const find = this.findAction.toDescriptor();
|
|
26
26
|
switch (find.findType) {
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
case
|
|
30
|
-
case
|
|
27
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
28
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
29
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
30
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
31
31
|
formatted.find = find;
|
|
32
32
|
formatted.descriptorToActionMap = new Map().set(find, this.findAction);
|
|
33
33
|
return formatted;
|