@mablhq/mabl-cli 1.16.32 → 1.17.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/basicApiClient.js +9 -4
- package/api/mablApiClient.js +14 -7
- package/browserLauncher/browserLauncherFactory.js +2 -1
- package/browserLauncher/elementHandle.js +2 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +5 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +22 -18
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +10 -6
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +5 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +13 -9
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +10 -10
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +6 -6
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +12 -11
- package/cli.js +12 -8
- package/commands/applications/applications_cmds/describe.js +4 -4
- package/commands/applications/applications_cmds/list.js +4 -4
- package/commands/auth/auth_cmds/activate-key.js +1 -1
- package/commands/branches/branches_cmds/create.js +4 -4
- package/commands/branches/branches_cmds/describe.js +3 -3
- package/commands/branches/branches_cmds/list.js +3 -3
- package/commands/branches/branches_cmds/merge.js +4 -4
- package/commands/commandUtil/codeInsights.js +4 -2
- package/commands/commandUtil/describe.js +1 -1
- package/commands/commandUtil/fileUtil.js +5 -1
- package/commands/commandUtil/util.js +2 -2
- package/commands/config/config_cmds/delete.js +1 -1
- package/commands/config/config_cmds/set.js +1 -1
- package/commands/constants.js +2 -1
- package/commands/credentials/credentials_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/create.js +18 -13
- package/commands/deploy/deploy_cmds/describe.js +5 -5
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +1 -1
- package/commands/deploy/deploy_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/watch.js +2 -2
- package/commands/environments/environments_cmds/create.js +7 -7
- package/commands/environments/environments_cmds/delete.js +1 -1
- package/commands/environments/environments_cmds/describe.js +4 -4
- package/commands/environments/environments_cmds/list.js +4 -4
- package/commands/environments/environments_cmds/update.js +2 -2
- package/commands/environments/environments_cmds/urls_cmds/add.js +3 -3
- package/commands/environments/environments_cmds/urls_cmds/list.js +2 -2
- package/commands/flows/flows_cmds/export.js +5 -5
- package/commands/flows/flows_cmds/list.js +2 -2
- package/commands/link-agents/link-agents_cmds/delete.js +1 -1
- package/commands/plans/plans_cmds/describe.js +4 -4
- package/commands/plans/plans_cmds/list.js +2 -2
- package/commands/test-runs/test-runs_cmds/export.js +2 -2
- package/commands/tests/executionUtil.js +5 -5
- package/commands/tests/testsUtil.js +19 -12
- package/commands/tests/tests_cmds/create.js +3 -3
- package/commands/tests/tests_cmds/edit.js +3 -3
- package/commands/tests/tests_cmds/export.js +7 -7
- package/commands/tests/tests_cmds/import.js +35 -14
- package/commands/tests/tests_cmds/list.js +3 -3
- package/commands/tests/tests_cmds/run-alpha.js +3 -3
- package/commands/tests/tests_cmds/run-cloud.js +4 -4
- package/commands/tests/tests_cmds/run-legacy.js +8 -8
- package/commands/tests/tests_cmds/run.js +8 -8
- package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
- package/commands/tests/tests_cmds/trainer_cmds/update.js +1 -1
- package/commands/tests/tests_cmds/trainer_cmds/version.js +2 -2
- package/commands/workspaces/workspace_cmds/copy.js +2 -2
- package/commands/workspaces/workspace_cmds/describe.js +4 -4
- package/commands/workspaces/workspace_cmds/list.js +2 -2
- package/configGenerators/flowConfigGenerator.js +1 -1
- package/configGenerators/selIdeGenerator.js +6 -6
- package/core/messaging/actions/runnerActions.js +2 -2
- package/core/trainer/openUtils.js +2 -2
- package/core/trainer/trainingSessions.js +26 -26
- package/domUtil/index.js +1 -1
- package/env/env.js +5 -1
- package/execution/index.js +1 -1
- package/mablApi/index.js +1 -1
- package/mablscript/AttributesConstants.js +2 -1
- package/mablscript/MablStep.js +6 -12
- package/mablscript/actions/ConditionAction.js +1 -1
- package/mablscript/actions/FindAction.js +25 -32
- package/mablscript/actions/GetUrlAction.js +1 -1
- package/mablscript/actions/GetVariableValue.js +1 -1
- package/mablscript/actions/JavaScriptAction.js +16 -16
- package/mablscript/importer.js +7 -7
- package/mablscript/steps/AccessibilityCheck.js +4 -2
- package/mablscript/steps/AssertStep.js +16 -16
- package/mablscript/steps/AssertStepOld.js +2 -2
- package/mablscript/steps/ClickStep.js +1 -1
- package/mablscript/steps/CreateVariableStep.js +6 -6
- package/mablscript/steps/DoubleClickStep.js +1 -1
- package/mablscript/steps/EchoStep.js +2 -2
- package/mablscript/steps/EnterTextStep.js +3 -3
- package/mablscript/steps/HoverStep.js +1 -1
- package/mablscript/steps/IfConditionStep.js +2 -1
- package/mablscript/steps/NavigateStep.js +1 -1
- package/mablscript/steps/SendHttpRequestStep.js +1 -1
- package/mablscript/steps/SendKeyStep.js +2 -2
- package/mablscript/steps/SetViewportStep.js +1 -1
- package/mablscript/steps/SwitchContextStep.js +9 -9
- package/mablscript/steps/VisitUrlStep.js +1 -1
- package/mablscript/steps/WaitStep.js +1 -1
- package/mablscript/steps/WaitUntilStep.js +1 -1
- package/mablscript/types/OperatingSystemDescriptor.js +5 -1
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/observers/mockObserver.js +4 -2
- package/package.json +55 -56
- package/popupDismissal/index.js +3 -3
- package/providers/authenticationProvider.js +3 -3
- package/providers/logging/loggingProvider.js +5 -1
- package/proxy/index.js +2 -1
- package/proxy/index.js.LICENSE.txt +5 -0
- package/reporters/mochAwesome/mochAwesomeReporter.js +11 -7
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +1 -0
- package/util/actionabilityUtil.js +18 -14
- package/util/analytics.js +7 -3
- package/util/downloadUtil.js +6 -2
- package/util/httpUtil.js +6 -2
- package/util/markdownUtil.js +1 -1
- package/util/pureUtil.js +5 -1
- package/util/resourceUtil.js +5 -1
|
@@ -107,7 +107,8 @@ exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS = [
|
|
|
107
107
|
'username',
|
|
108
108
|
];
|
|
109
109
|
const ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET = new Set(exports.ALLOWED_ASSERTABLE_URL_ATTRS_PROPS);
|
|
110
|
-
|
|
110
|
+
const isAllowedAssertableUrlAttrProps = (x) => ALLOWED_ASSERTABLE_URL_ATTRS_PROPS_SET.has(x);
|
|
111
|
+
exports.isAllowedAssertableUrlAttrProps = isAllowedAssertableUrlAttrProps;
|
|
111
112
|
exports.ALLOWED_ASSERTABLE_EMAIL_ATTRS_PROPS = [
|
|
112
113
|
'from',
|
|
113
114
|
'subject',
|
package/mablscript/MablStep.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.buildObjectString = exports.buildSourceRepresentationOfObject = exports.
|
|
|
4
4
|
const MablAction_1 = require("./MablAction");
|
|
5
5
|
const SeleniumIdeStep_1 = require("./steps/SeleniumIdeStep");
|
|
6
6
|
const MablSymbol_1 = require("./MablSymbol");
|
|
7
|
+
const domUtil_1 = require("../domUtil");
|
|
7
8
|
class MablStep extends MablAction_1.MablAction {
|
|
8
9
|
constructor(name, args, actions) {
|
|
9
10
|
super(name, args);
|
|
@@ -37,7 +38,7 @@ class MablStep extends MablAction_1.MablAction {
|
|
|
37
38
|
if (argument instanceof MablSymbol_1.MablSymbol) {
|
|
38
39
|
return argument.name;
|
|
39
40
|
}
|
|
40
|
-
if (MablAction_1.argumentIsMablVariable(argument)) {
|
|
41
|
+
if ((0, MablAction_1.argumentIsMablVariable)(argument)) {
|
|
41
42
|
const matches = argument.match(MablSymbol_1.SINGLE_VARIABLE_PATTERN_REGEX);
|
|
42
43
|
if (matches) {
|
|
43
44
|
return matches[1];
|
|
@@ -83,7 +84,7 @@ class MablStep extends MablAction_1.MablAction {
|
|
|
83
84
|
return formatted;
|
|
84
85
|
}
|
|
85
86
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
86
|
-
const selIdeEcho = SeleniumIdeStep_1.buildSeleniumIdeStep('echo');
|
|
87
|
+
const selIdeEcho = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo');
|
|
87
88
|
const unSupportedStepMessage = `[${this.getStepName()}] Step is not supported for Selenium IDE export`;
|
|
88
89
|
selIdeEcho.comment = unSupportedStepMessage;
|
|
89
90
|
selIdeEcho.target = unSupportedStepMessage;
|
|
@@ -124,7 +125,7 @@ function buildSourceRepresentationOfObject(object) {
|
|
|
124
125
|
if (typeof value === 'number') {
|
|
125
126
|
return `${key}: ${value}`;
|
|
126
127
|
}
|
|
127
|
-
return `${key}: "${escapeMablscriptString(value)}"`;
|
|
128
|
+
return `${key}: "${(0, domUtil_1.escapeMablscriptString)(value)}"`;
|
|
128
129
|
}
|
|
129
130
|
return `${key}: ${buildSourceRepresentationOfObject(value)}`;
|
|
130
131
|
});
|
|
@@ -140,14 +141,14 @@ function buildObjectString(objectString) {
|
|
|
140
141
|
return final;
|
|
141
142
|
}
|
|
142
143
|
if (typeof objectString[key] === 'string') {
|
|
143
|
-
return final.push(`${key}: "${escapeMablscriptString(objectString[key])}"`);
|
|
144
|
+
return final.push(`${key}: "${(0, domUtil_1.escapeMablscriptString)(objectString[key])}"`);
|
|
144
145
|
}
|
|
145
146
|
else if (typeof objectString[key] === 'number') {
|
|
146
147
|
return final.push(`${key}: ${objectString[key]}`);
|
|
147
148
|
}
|
|
148
149
|
else if (Array.isArray(objectString[key])) {
|
|
149
150
|
return final.push(`"${key}": [${objectString[key]
|
|
150
|
-
.map((arrayVal) => `"${escapeMablscriptString(arrayVal)}"`)
|
|
151
|
+
.map((arrayVal) => `"${(0, domUtil_1.escapeMablscriptString)(arrayVal)}"`)
|
|
151
152
|
.join(', ')}]`);
|
|
152
153
|
}
|
|
153
154
|
return final.push(`${key}: {${buildObjectString(objectString[key])}}`);
|
|
@@ -155,10 +156,3 @@ function buildObjectString(objectString) {
|
|
|
155
156
|
return final;
|
|
156
157
|
}
|
|
157
158
|
exports.buildObjectString = buildObjectString;
|
|
158
|
-
function escapeMablscriptString(unescapedString) {
|
|
159
|
-
return unescapedString
|
|
160
|
-
.replace(/\\/g, '\\\\')
|
|
161
|
-
.replace(/\n/g, '\\n')
|
|
162
|
-
.replace(/"/g, '\\"')
|
|
163
|
-
.replace(/\r/g, '');
|
|
164
|
-
}
|
|
@@ -35,7 +35,7 @@ class ConditionAction extends MablAction_1.MablAction {
|
|
|
35
35
|
return {
|
|
36
36
|
conditionType: ConditionDescriptor_1.ConditionType.Comparison,
|
|
37
37
|
comparisonType: ConditionDescriptor_1.ComparisonType.fromString(this.conditionAttribute),
|
|
38
|
-
comparatorValue: MablAction_1.parseArgument(this.conditionValueAttribute),
|
|
38
|
+
comparatorValue: (0, MablAction_1.parseArgument)(this.conditionValueAttribute),
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
getEvaluatePresence() {
|
|
@@ -19,7 +19,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
19
19
|
constructor(name, args) {
|
|
20
20
|
super(name, args);
|
|
21
21
|
const actionName = this.getActionName();
|
|
22
|
-
if (!mablscriptFind_1.isFindType(actionName)) {
|
|
22
|
+
if (!(0, mablscriptFind_1.isFindType)(actionName)) {
|
|
23
23
|
throw new Error(`Unknown find type for action: ${actionName}`);
|
|
24
24
|
}
|
|
25
25
|
const findType = mablscriptFind_1.FindType.fromString(actionName);
|
|
@@ -41,7 +41,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
41
41
|
findType,
|
|
42
42
|
findTarget,
|
|
43
43
|
};
|
|
44
|
-
if (mablscriptFind_1.isFindOptions(options)) {
|
|
44
|
+
if ((0, mablscriptFind_1.isFindOptions)(options)) {
|
|
45
45
|
this.findDescriptor.findOptions = options;
|
|
46
46
|
}
|
|
47
47
|
break;
|
|
@@ -49,7 +49,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
49
49
|
case mablscriptFind_1.FindType.FIND_LAST:
|
|
50
50
|
case mablscriptFind_1.FindType.FIND_ANY:
|
|
51
51
|
case mablscriptFind_1.FindType.FIND_ALL:
|
|
52
|
-
if (!mablscriptFind_1.isCssSelector(selectors) && !mablscriptFind_1.isXPathSelector(selectors)) {
|
|
52
|
+
if (!(0, mablscriptFind_1.isCssSelector)(selectors) && !(0, mablscriptFind_1.isXPathSelector)(selectors)) {
|
|
53
53
|
this.isValid = false;
|
|
54
54
|
}
|
|
55
55
|
this.findDescriptor = {
|
|
@@ -58,7 +58,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
58
58
|
};
|
|
59
59
|
break;
|
|
60
60
|
case mablscriptFind_1.FindType.FIND_COOKIE:
|
|
61
|
-
if (!mablscriptFind_1.isCookieSelector(selectors)) {
|
|
61
|
+
if (!(0, mablscriptFind_1.isCookieSelector)(selectors)) {
|
|
62
62
|
this.isValid = false;
|
|
63
63
|
}
|
|
64
64
|
this.findDescriptor = {
|
|
@@ -67,7 +67,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
67
67
|
};
|
|
68
68
|
break;
|
|
69
69
|
case mablscriptFind_1.FindType.FIND_EMAIL:
|
|
70
|
-
if (!mablscriptFind_1.isEmailSelector(selectors)) {
|
|
70
|
+
if (!(0, mablscriptFind_1.isEmailSelector)(selectors)) {
|
|
71
71
|
this.isValid = false;
|
|
72
72
|
}
|
|
73
73
|
this.findDescriptor = {
|
|
@@ -76,7 +76,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
76
76
|
};
|
|
77
77
|
break;
|
|
78
78
|
case mablscriptFind_1.FindType.FIND_TAB:
|
|
79
|
-
if (selectors !== 'initial' && !mablscriptFind_1.isTabSelector(selectors)) {
|
|
79
|
+
if (selectors !== 'initial' && !(0, mablscriptFind_1.isTabSelector)(selectors)) {
|
|
80
80
|
this.isValid = false;
|
|
81
81
|
}
|
|
82
82
|
this.findDescriptor = {
|
|
@@ -143,7 +143,7 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
143
143
|
case mablscriptFind_1.FindType.FIND_LAST:
|
|
144
144
|
case mablscriptFind_1.FindType.FIND_ANY:
|
|
145
145
|
case mablscriptFind_1.FindType.FIND_ALL:
|
|
146
|
-
if (mablscriptFind_1.isCssSelector(this.findDescriptor.findTarget)) {
|
|
146
|
+
if ((0, mablscriptFind_1.isCssSelector)(this.findDescriptor.findTarget)) {
|
|
147
147
|
return `css=${this.findDescriptor.findTarget.css_query}`;
|
|
148
148
|
}
|
|
149
149
|
return `xpath=${this.findDescriptor.findTarget.xpath}`;
|
|
@@ -162,15 +162,16 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
162
162
|
case mablscriptFind_1.FindType.FIND_ONE: {
|
|
163
163
|
const find = this.findDescriptor;
|
|
164
164
|
const action = find.findType;
|
|
165
|
-
const selectors = ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length)
|
|
166
|
-
[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
165
|
+
const selectors = ((_a = find.findTarget.auxiliaryDescriptors) === null || _a === void 0 ? void 0 : _a.length)
|
|
166
|
+
? '[' +
|
|
167
|
+
[
|
|
168
|
+
find.findTarget.selector,
|
|
169
|
+
...find.findTarget.auxiliaryDescriptors.map((descriptor) => descriptor.selector),
|
|
170
|
+
]
|
|
171
|
+
.map(mablscriptFind_1.buildElementSelectorString)
|
|
172
|
+
.join(', ') +
|
|
173
|
+
']'
|
|
174
|
+
: (0, mablscriptFind_1.buildElementSelectorString)(find.findTarget.selector);
|
|
174
175
|
const options = buildFindOptionsString(find.findOptions);
|
|
175
176
|
const args = [selectors, options].filter((str) => str).join(', ');
|
|
176
177
|
return `${action}(${args})`;
|
|
@@ -183,14 +184,14 @@ class FindAction extends MablAction_1.MablAction {
|
|
|
183
184
|
case mablscriptFind_1.FindType.FIND_EMAIL: {
|
|
184
185
|
const find = this.findDescriptor;
|
|
185
186
|
const action = find.findType;
|
|
186
|
-
const args = buildElementSelectorString(find.findTarget);
|
|
187
|
+
const args = (0, mablscriptFind_1.buildElementSelectorString)(find.findTarget);
|
|
187
188
|
return `${action}(${args})`;
|
|
188
189
|
}
|
|
189
190
|
case mablscriptFind_1.FindType.FIND_TAB:
|
|
190
191
|
if (this.findDescriptor.findTarget === 'initial') {
|
|
191
192
|
return `${this.findDescriptor.findType}("${this.findDescriptor.findTarget}")`;
|
|
192
193
|
}
|
|
193
|
-
return `${this.findDescriptor.findType}(${buildElementSelectorString(this.findDescriptor.findTarget)})`;
|
|
194
|
+
return `${this.findDescriptor.findType}(${(0, mablscriptFind_1.buildElementSelectorString)(this.findDescriptor.findTarget)})`;
|
|
194
195
|
default:
|
|
195
196
|
throw new Error(`Error generating mablscript: Unexpected find type in ${JSON.stringify(this.findDescriptor)}`);
|
|
196
197
|
}
|
|
@@ -226,35 +227,27 @@ function buildFindOptionsString(findOptions) {
|
|
|
226
227
|
}
|
|
227
228
|
let findOptionsFinal = '{';
|
|
228
229
|
if (findOptions.hints) {
|
|
229
|
-
findOptionsFinal += `hints: {${MablStep_1.buildObjectString(findOptions.hints).join(', ')}}`;
|
|
230
|
+
findOptionsFinal += `hints: {${(0, MablStep_1.buildObjectString)(findOptions.hints).join(', ')}}`;
|
|
230
231
|
}
|
|
231
232
|
if (findOptions.waitUntil) {
|
|
232
|
-
findOptionsFinal += `waitUntil: {${MablStep_1.buildObjectString(findOptions.waitUntil)}}`;
|
|
233
|
+
findOptionsFinal += `waitUntil: {${(0, MablStep_1.buildObjectString)(findOptions.waitUntil)}}`;
|
|
233
234
|
}
|
|
234
235
|
findOptionsFinal += '}';
|
|
235
236
|
return findOptionsFinal;
|
|
236
237
|
}
|
|
237
|
-
function buildElementSelectorString(selectorObject) {
|
|
238
|
-
const findInfoList = MablStep_1.buildObjectString(selectorObject);
|
|
239
|
-
if (!findInfoList.find((info) => info.includes('selector_type'))) {
|
|
240
|
-
findInfoList.push('selector_type: "element"');
|
|
241
|
-
}
|
|
242
|
-
findInfoList.sort();
|
|
243
|
-
return `{${findInfoList.join(', ')}}`;
|
|
244
|
-
}
|
|
245
238
|
function isElementSelector(maybeSelectors) {
|
|
246
239
|
const [target, ancestor] = Array.isArray(maybeSelectors)
|
|
247
240
|
? [...maybeSelectors]
|
|
248
241
|
: [maybeSelectors];
|
|
249
|
-
const validTarget = mablscriptFind_1.isStandardSelector(target) || mablscriptFind_1.isNormalizedFindDescriptor(target);
|
|
242
|
+
const validTarget = (0, mablscriptFind_1.isStandardSelector)(target) || (0, mablscriptFind_1.isNormalizedFindDescriptor)(target);
|
|
250
243
|
const validAncestor = !ancestor ||
|
|
251
|
-
mablscriptFind_1.isStandardSelector(ancestor) ||
|
|
252
|
-
mablscriptFind_1.isNormalizedFindDescriptor(ancestor);
|
|
244
|
+
(0, mablscriptFind_1.isStandardSelector)(ancestor) ||
|
|
245
|
+
(0, mablscriptFind_1.isNormalizedFindDescriptor)(ancestor);
|
|
253
246
|
return !!(validTarget && validAncestor);
|
|
254
247
|
}
|
|
255
248
|
exports.isElementSelector = isElementSelector;
|
|
256
249
|
function normalize(maybeFindDescriptor) {
|
|
257
|
-
if (mablscriptFind_1.isNormalizedFindDescriptor(maybeFindDescriptor)) {
|
|
250
|
+
if ((0, mablscriptFind_1.isNormalizedFindDescriptor)(maybeFindDescriptor)) {
|
|
258
251
|
return { ...maybeFindDescriptor };
|
|
259
252
|
}
|
|
260
253
|
return { selector: maybeFindDescriptor };
|
|
@@ -11,7 +11,7 @@ class GetUrlAction extends MablAction_1.MablAction {
|
|
|
11
11
|
return `get_current_location()`;
|
|
12
12
|
}
|
|
13
13
|
toDescriptor() {
|
|
14
|
-
return GetCurrentLocationDescriptor_1.newGetCurrentLocationDescriptor();
|
|
14
|
+
return (0, GetCurrentLocationDescriptor_1.newGetCurrentLocationDescriptor)();
|
|
15
15
|
}
|
|
16
16
|
generateMablscriptFindOne() {
|
|
17
17
|
return 'get_current_location()';
|
|
@@ -17,7 +17,7 @@ class GetVariableValue extends MablAction_1.MablAction {
|
|
|
17
17
|
return `get_variable_value(${this.subVariable(this.variable.toString())})`;
|
|
18
18
|
}
|
|
19
19
|
toDescriptor() {
|
|
20
|
-
return GetVariableDescriptor_1.newGetVariableDescriptor(this.variable);
|
|
20
|
+
return (0, GetVariableDescriptor_1.newGetVariableDescriptor)(this.variable);
|
|
21
21
|
}
|
|
22
22
|
generateMablscriptFindOne() {
|
|
23
23
|
return `get_variable_value(${this.variable.name})`;
|
|
@@ -75,7 +75,7 @@ class JavaScriptAction extends MablAction_1.MablAction {
|
|
|
75
75
|
}
|
|
76
76
|
static fromDescriptor(descriptor) {
|
|
77
77
|
const { javaScript } = descriptor;
|
|
78
|
-
if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(javaScript)) {
|
|
78
|
+
if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(javaScript)) {
|
|
79
79
|
return new JavaScriptAction(JavaScriptAction.mablscriptName, [
|
|
80
80
|
{
|
|
81
81
|
id: javaScript.snippetId,
|
|
@@ -84,20 +84,20 @@ class JavaScriptAction extends MablAction_1.MablAction {
|
|
|
84
84
|
{ parameter_overrides: javaScript.parameterOverrides },
|
|
85
85
|
]);
|
|
86
86
|
}
|
|
87
|
-
else if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(javaScript)) {
|
|
87
|
+
else if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(javaScript)) {
|
|
88
88
|
return new JavaScriptAction(JavaScriptAction.mablscriptName, [
|
|
89
89
|
javaScript.inlineSnippet,
|
|
90
90
|
{ parameter_overrides: javaScript.parameterOverrides },
|
|
91
91
|
]);
|
|
92
92
|
}
|
|
93
|
-
else if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(javaScript)) {
|
|
93
|
+
else if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(javaScript)) {
|
|
94
94
|
return new JavaScriptAction(JavaScriptAction.mablscriptName, [
|
|
95
95
|
{
|
|
96
96
|
id: javaScript.snippetInvariantId,
|
|
97
97
|
},
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
else if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(javaScript)) {
|
|
100
|
+
else if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(javaScript)) {
|
|
101
101
|
return new JavaScriptAction(JavaScriptAction.mablscriptName, [
|
|
102
102
|
javaScript.encodedJS,
|
|
103
103
|
]);
|
|
@@ -106,19 +106,19 @@ class JavaScriptAction extends MablAction_1.MablAction {
|
|
|
106
106
|
}
|
|
107
107
|
toYaml() {
|
|
108
108
|
const actionYaml = {};
|
|
109
|
-
if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(this.javaScript)) {
|
|
109
|
+
if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(this.javaScript)) {
|
|
110
110
|
actionYaml.snippetId = this.javaScript.snippetId;
|
|
111
111
|
actionYaml.snippetInvariantId = this.javaScript.snippetInvariantId;
|
|
112
112
|
actionYaml.parameterOverrides = this.javaScript.parameterOverrides;
|
|
113
113
|
}
|
|
114
|
-
else if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(this.javaScript)) {
|
|
114
|
+
else if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(this.javaScript)) {
|
|
115
115
|
actionYaml.snippet = this.javaScript.inlineSnippet;
|
|
116
116
|
actionYaml.parameterOverrides = this.javaScript.parameterOverrides;
|
|
117
117
|
}
|
|
118
|
-
else if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(this.javaScript)) {
|
|
118
|
+
else if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(this.javaScript)) {
|
|
119
119
|
actionYaml.snippetId = this.javaScript.snippetInvariantId;
|
|
120
120
|
}
|
|
121
|
-
else if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(this.javaScript)) {
|
|
121
|
+
else if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(this.javaScript)) {
|
|
122
122
|
actionYaml.code = this.javaScript.encodedJS;
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
@@ -160,27 +160,27 @@ class JavaScriptAction extends MablAction_1.MablAction {
|
|
|
160
160
|
return new JavaScriptAction(MABLSCRIPT_NAME, args);
|
|
161
161
|
}
|
|
162
162
|
toMablscript() {
|
|
163
|
-
if (JavaScriptDescriptor_1.isReusableSnippetDescriptor(this.javaScript)) {
|
|
164
|
-
const snippetReference = domUtil_1.buildStepArgumentString({
|
|
163
|
+
if ((0, JavaScriptDescriptor_1.isReusableSnippetDescriptor)(this.javaScript)) {
|
|
164
|
+
const snippetReference = (0, domUtil_1.buildStepArgumentString)({
|
|
165
165
|
id: this.javaScript.snippetId,
|
|
166
166
|
invariant_id: this.javaScript.snippetInvariantId,
|
|
167
167
|
snippet_type: 'javascript',
|
|
168
168
|
});
|
|
169
|
-
const snippetOptions = `, {parameter_overrides: ${domUtil_1.buildStepArgumentString(this.javaScript.parameterOverrides)}}`;
|
|
169
|
+
const snippetOptions = `, {parameter_overrides: ${(0, domUtil_1.buildStepArgumentString)(this.javaScript.parameterOverrides)}}`;
|
|
170
170
|
return `evaluate_js(${snippetReference}${snippetOptions})`;
|
|
171
171
|
}
|
|
172
|
-
if (JavaScriptDescriptor_1.isInlineSnippetDescriptor(this.javaScript)) {
|
|
173
|
-
const snippetReference = domUtil_1.buildStepArgumentString({
|
|
172
|
+
if ((0, JavaScriptDescriptor_1.isInlineSnippetDescriptor)(this.javaScript)) {
|
|
173
|
+
const snippetReference = (0, domUtil_1.buildStepArgumentString)({
|
|
174
174
|
...this.javaScript.inlineSnippet,
|
|
175
175
|
snippet_type: 'javascript',
|
|
176
176
|
});
|
|
177
|
-
const snippetOptions = `, {parameter_overrides: ${domUtil_1.buildStepArgumentString(this.javaScript.parameterOverrides)}}`;
|
|
177
|
+
const snippetOptions = `, {parameter_overrides: ${(0, domUtil_1.buildStepArgumentString)(this.javaScript.parameterOverrides)}}`;
|
|
178
178
|
return `evaluate_js(${snippetReference}${snippetOptions})`;
|
|
179
179
|
}
|
|
180
|
-
if (JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor(this.javaScript)) {
|
|
180
|
+
if ((0, JavaScriptDescriptor_1.isLegacyReusableSnippetDescriptor)(this.javaScript)) {
|
|
181
181
|
return `evaluate_js({id: "${this.javaScript.snippetInvariantId}", snippet_type: "javascript"})`;
|
|
182
182
|
}
|
|
183
|
-
if (JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor(this.javaScript)) {
|
|
183
|
+
if ((0, JavaScriptDescriptor_1.isLegacyInlineJavaScriptDescriptor)(this.javaScript)) {
|
|
184
184
|
return `evaluate_js("${this.javaScript.encodedJS}")`;
|
|
185
185
|
}
|
|
186
186
|
throw new Error(`Cannot export action to mablscript: ${JSON.stringify(this.javaScript)}`);
|
package/mablscript/importer.js
CHANGED
|
@@ -99,10 +99,10 @@ const StepTypes = [
|
|
|
99
99
|
WaitStep_1.WaitStep,
|
|
100
100
|
];
|
|
101
101
|
function parseMablScript(mablscript) {
|
|
102
|
-
const ast = esprima_1.parseScript(mablscript, { loc: true });
|
|
102
|
+
const ast = (0, esprima_1.parseScript)(mablscript, { loc: true });
|
|
103
103
|
const stepStack = {};
|
|
104
104
|
let stepLine = 0;
|
|
105
|
-
estraverse_1.traverse(ast, {
|
|
105
|
+
(0, estraverse_1.traverse)(ast, {
|
|
106
106
|
enter(node) {
|
|
107
107
|
switch (node.type) {
|
|
108
108
|
case 'ExpressionStatement':
|
|
@@ -161,7 +161,7 @@ function loadMablScriptIntoSteps(parsedMablscript) {
|
|
|
161
161
|
exports.loadMablScriptIntoSteps = loadMablScriptIntoSteps;
|
|
162
162
|
function yamlifyTheLoadedSteps(translatedSteps, fullLocatorsOn = true) {
|
|
163
163
|
const steps = translatedSteps.map((step) => step.getFormattedStep(fullLocatorsOn));
|
|
164
|
-
return js_yaml_1.dump(steps);
|
|
164
|
+
return (0, js_yaml_1.dump)(steps);
|
|
165
165
|
}
|
|
166
166
|
exports.yamlifyTheLoadedSteps = yamlifyTheLoadedSteps;
|
|
167
167
|
const yamlMablscriptToObjectsStepMap = {};
|
|
@@ -169,7 +169,7 @@ StepTypes.forEach((step) => {
|
|
|
169
169
|
step.yamlMablScriptNames.forEach((name) => (yamlMablscriptToObjectsStepMap[name] = step.fromYaml));
|
|
170
170
|
});
|
|
171
171
|
function loadYamlSteps(yamlSteps) {
|
|
172
|
-
const loadedStepData = js_yaml_1.safeLoad(yamlSteps);
|
|
172
|
+
const loadedStepData = (0, js_yaml_1.safeLoad)(yamlSteps);
|
|
173
173
|
return loadedStepData.map((stepObject) => {
|
|
174
174
|
const stepName = Object.keys(stepObject)[0];
|
|
175
175
|
const stepArgs = stepObject[stepName];
|
|
@@ -239,19 +239,19 @@ function getArgumentsFromCallExpressionArgs(expressionArguments) {
|
|
|
239
239
|
break;
|
|
240
240
|
case 'Identifier':
|
|
241
241
|
const singleIdentifier = expressionArg;
|
|
242
|
-
expressionArgs.push(MablSymbol_1.formatSymbol(singleIdentifier.name));
|
|
242
|
+
expressionArgs.push((0, MablSymbol_1.formatSymbol)(singleIdentifier.name));
|
|
243
243
|
break;
|
|
244
244
|
case 'MemberExpression':
|
|
245
245
|
const memberExpression = expressionArg;
|
|
246
246
|
if (expressionArg.object.type === 'MemberExpression') {
|
|
247
247
|
const chainedVariableExpression = memberExpressionChainBuilder(memberExpression);
|
|
248
248
|
const property = memberExpression.property;
|
|
249
|
-
expressionArgs.push(MablSymbol_1.formatSymbol(`${chainedVariableExpression}.${property.name}`));
|
|
249
|
+
expressionArgs.push((0, MablSymbol_1.formatSymbol)(`${chainedVariableExpression}.${property.name}`));
|
|
250
250
|
}
|
|
251
251
|
else {
|
|
252
252
|
const identifier = memberExpression.object;
|
|
253
253
|
const property = memberExpression.property;
|
|
254
|
-
expressionArgs.push(MablSymbol_1.formatSymbol(`${identifier.name}.${property.name}`));
|
|
254
|
+
expressionArgs.push((0, MablSymbol_1.formatSymbol)(`${identifier.name}.${property.name}`));
|
|
255
255
|
}
|
|
256
256
|
break;
|
|
257
257
|
case 'ObjectExpression':
|
|
@@ -85,8 +85,10 @@ class AccessibilityCheckStep extends MablStep_1.MablStep {
|
|
|
85
85
|
toMablscript() {
|
|
86
86
|
var _a, _b, _c;
|
|
87
87
|
let argString = '';
|
|
88
|
-
if (((_a = this.checkConfig) === null || _a === void 0 ? void 0 : _a.tags) ||
|
|
89
|
-
|
|
88
|
+
if (((_a = this.checkConfig) === null || _a === void 0 ? void 0 : _a.tags) ||
|
|
89
|
+
((_b = this.checkConfig) === null || _b === void 0 ? void 0 : _b.disabledRules) ||
|
|
90
|
+
((_c = this.checkConfig) === null || _c === void 0 ? void 0 : _c.rules)) {
|
|
91
|
+
argString = `{${(0, MablStep_1.buildObjectString)(this.checkConfig)}}`;
|
|
90
92
|
}
|
|
91
93
|
let findAction = '';
|
|
92
94
|
if (this.findAction) {
|
|
@@ -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 (mablscriptFind_1.isFindElementDescriptor(find)) {
|
|
81
|
+
if ((0, mablscriptFind_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
|
}
|
|
@@ -129,7 +129,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
129
129
|
formatted.assertionValue = this.assertionValue;
|
|
130
130
|
}
|
|
131
131
|
const find = this.primaryAction.toDescriptor();
|
|
132
|
-
if (GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) || GetVariableDescriptor_1.isGetVariableDescriptor(find)) {
|
|
132
|
+
if ((0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) || (0, GetVariableDescriptor_1.isGetVariableDescriptor)(find)) {
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
switch (find.findType) {
|
|
@@ -185,8 +185,8 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
185
185
|
}
|
|
186
186
|
produceSelIdeFormattedSteps(stepIndex) {
|
|
187
187
|
const find = this.primaryAction.toDescriptor();
|
|
188
|
-
if (!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) &&
|
|
189
|
-
!GetVariableDescriptor_1.isGetVariableDescriptor(find) &&
|
|
188
|
+
if (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
|
|
189
|
+
!(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
|
|
190
190
|
(find.findType === mablscriptFind_1.FindType.FIND_EMAIL ||
|
|
191
191
|
find.findType === mablscriptFind_1.FindType.FIND_COOKIE)) {
|
|
192
192
|
return [this.unsupportedSelIdeExportStep()];
|
|
@@ -198,7 +198,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
198
198
|
if (this.primaryAction instanceof GetVariableValue_1.GetVariableValue) {
|
|
199
199
|
throw new Error('Invalid state. You cannot assert presence against variable properties.');
|
|
200
200
|
}
|
|
201
|
-
const assertPresentStep = SeleniumIdeStep_1.buildSeleniumIdeStep('assertElementPresent', this);
|
|
201
|
+
const assertPresentStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('assertElementPresent', this);
|
|
202
202
|
assertPresentStep.target = this.primaryAction.getSelIdeTarget();
|
|
203
203
|
return [assertPresentStep];
|
|
204
204
|
}
|
|
@@ -209,21 +209,21 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
209
209
|
if (this.primaryAction instanceof GetVariableValue_1.GetVariableValue) {
|
|
210
210
|
throw new Error('Invalid state. You cannot assert presence against variable properties.');
|
|
211
211
|
}
|
|
212
|
-
const assertNotPresentStep = SeleniumIdeStep_1.buildSeleniumIdeStep('assertElementNotPresent', this);
|
|
212
|
+
const assertNotPresentStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('assertElementNotPresent', this);
|
|
213
213
|
assertNotPresentStep.target = this.primaryAction.getSelIdeTarget();
|
|
214
214
|
return [assertNotPresentStep];
|
|
215
215
|
}
|
|
216
|
-
return buildSeleniumIdeJsAssertion(stepIndex, (!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(find) &&
|
|
217
|
-
!GetVariableDescriptor_1.isGetVariableDescriptor(find) &&
|
|
216
|
+
return buildSeleniumIdeJsAssertion(stepIndex, (!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) &&
|
|
217
|
+
!(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) &&
|
|
218
218
|
find.findType === mablscriptFind_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
|
}
|
|
222
222
|
unsupportedSelIdeExportStep() {
|
|
223
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
223
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
224
224
|
const findDescriptor = this.primaryAction.toDescriptor();
|
|
225
|
-
seleniumStep.value = `[${this.getStepName()}] step with find type [${FindAction_1.findTypesToFormattedType[(!GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor(findDescriptor) &&
|
|
226
|
-
!GetVariableDescriptor_1.isGetVariableDescriptor(findDescriptor) &&
|
|
225
|
+
seleniumStep.value = `[${this.getStepName()}] step with find type [${FindAction_1.findTypesToFormattedType[(!(0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(findDescriptor) &&
|
|
226
|
+
!(0, GetVariableDescriptor_1.isGetVariableDescriptor)(findDescriptor) &&
|
|
227
227
|
findDescriptor.findType) ||
|
|
228
228
|
'unknown']} is not supported for Selenium IDE export`;
|
|
229
229
|
return seleniumStep;
|
|
@@ -253,11 +253,11 @@ function buildSeleniumIdeJsAssertion(stepIndex, xpath, assertionAttribute, asser
|
|
|
253
253
|
const variableName = `assertVariable-${stepIndex}`;
|
|
254
254
|
let storeAttribute;
|
|
255
255
|
if (assertionAttribute !== 'innerText') {
|
|
256
|
-
storeAttribute = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', step);
|
|
256
|
+
storeAttribute = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', step);
|
|
257
257
|
storeAttribute.target = `return document.evaluate('${xpath}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue['${assertionAttribute}']`;
|
|
258
258
|
}
|
|
259
259
|
else {
|
|
260
|
-
storeAttribute = SeleniumIdeStep_1.buildSeleniumIdeStep('storeText', step);
|
|
260
|
+
storeAttribute = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeText', step);
|
|
261
261
|
storeAttribute.target = `xpath=${xpath}`;
|
|
262
262
|
}
|
|
263
263
|
storeAttribute.value = variableName;
|
|
@@ -300,10 +300,10 @@ function buildSeleniumIdeJsAssertion(stepIndex, xpath, assertionAttribute, asser
|
|
|
300
300
|
condition = `!\${${variableName}} <= '${assertAgainst}'`;
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
|
-
const ifStep = SeleniumIdeStep_1.buildSeleniumIdeStep('if', step);
|
|
303
|
+
const ifStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('if', step);
|
|
304
304
|
ifStep.target = condition;
|
|
305
|
-
const throwError = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', step);
|
|
305
|
+
const throwError = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', step);
|
|
306
306
|
throwError.target = `throw new Error('${exports.fieldToAssertionStep[assertionType]} step failure')`;
|
|
307
|
-
const endStep = SeleniumIdeStep_1.buildSeleniumIdeStep('end', step);
|
|
307
|
+
const endStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('end', step);
|
|
308
308
|
return [storeAttribute, ifStep, throwError, endStep];
|
|
309
309
|
}
|
|
@@ -84,8 +84,8 @@ class AssertStepOld extends MablStep_1.MablStep {
|
|
|
84
84
|
return formatted;
|
|
85
85
|
}
|
|
86
86
|
getNewAssertionStep() {
|
|
87
|
-
const yamlified = importer_1.yamlifyTheLoadedSteps([this]);
|
|
88
|
-
const reloadedSteps = importer_1.loadYamlSteps(yamlified);
|
|
87
|
+
const yamlified = (0, importer_1.yamlifyTheLoadedSteps)([this]);
|
|
88
|
+
const reloadedSteps = (0, importer_1.loadYamlSteps)(yamlified);
|
|
89
89
|
const result = reloadedSteps[0];
|
|
90
90
|
if (this.stepSourceIndexInFlow !== undefined) {
|
|
91
91
|
result.setStepSourceIndexInFlow(this.stepSourceIndexInFlow);
|
|
@@ -38,7 +38,7 @@ class ClickStep extends MablStep_1.MablStep {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
41
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('click', this);
|
|
41
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('click', this);
|
|
42
42
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
43
43
|
return [seleniumStep];
|
|
44
44
|
}
|
|
@@ -156,10 +156,10 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
156
156
|
switch (this.generationType) {
|
|
157
157
|
case CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE:
|
|
158
158
|
if (this.actions[1].extractionAttribute === 'innerText') {
|
|
159
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('storeText', this);
|
|
159
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeText', this);
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('storeAttribute', this);
|
|
162
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('storeAttribute', this);
|
|
163
163
|
}
|
|
164
164
|
seleniumStep.target = this.actions[0].getSelIdeTarget();
|
|
165
165
|
seleniumStep.value = this.variableName;
|
|
@@ -176,20 +176,20 @@ class CreateVariableStep extends MablStep_1.MablStep {
|
|
|
176
176
|
return `\${Math.round((Math.pow(36, ${length} + 1) - Math.random() * Math.pow(36, ${length}))).toString(36).slice(1)}`;
|
|
177
177
|
});
|
|
178
178
|
const executeScript = 'return ' + '`' + translated + '`';
|
|
179
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('executeScript', this);
|
|
179
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('executeScript', this);
|
|
180
180
|
seleniumStep.target = executeScript;
|
|
181
181
|
seleniumStep.value = this.variableName;
|
|
182
182
|
return [seleniumStep];
|
|
183
183
|
case CreateVariableStepDescriptor_1.VariableGenerator.EMAIL:
|
|
184
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
184
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
185
185
|
seleniumStep.value = `Generate email address for variable name '${this.variableName} is not supported for Selenium IDE export`;
|
|
186
186
|
return [seleniumStep];
|
|
187
187
|
case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
|
|
188
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
188
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
189
189
|
seleniumStep.value = `Find and store count of elements for variable name '${this.variableName} is not supported for Selenium IDE export`;
|
|
190
190
|
return [seleniumStep];
|
|
191
191
|
case CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT:
|
|
192
|
-
seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
192
|
+
seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
193
193
|
seleniumStep.value = `[${this.getStepName()}${this.actions[0].javaScript
|
|
194
194
|
? ' from JavaScript'
|
|
195
195
|
: ''}] step for variable name '${this.variableName} is not supported for Selenium IDE export`;
|
|
@@ -47,7 +47,7 @@ class DoubleClickStep extends MablStep_1.MablStep {
|
|
|
47
47
|
return new DoubleClickStep('double_click', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
48
48
|
}
|
|
49
49
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
50
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('doubleClick', this);
|
|
50
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('doubleClick', this);
|
|
51
51
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
52
52
|
return [seleniumStep];
|
|
53
53
|
}
|
|
@@ -7,7 +7,7 @@ const MablAction_1 = require("../MablAction");
|
|
|
7
7
|
class EchoStep extends MablStep_1.MablStep {
|
|
8
8
|
constructor(name, args, actions) {
|
|
9
9
|
super(name, args, actions);
|
|
10
|
-
this.echoValue = MablAction_1.parseArgument(this.getActionArgs()[0]);
|
|
10
|
+
this.echoValue = (0, MablAction_1.parseArgument)(this.getActionArgs()[0]);
|
|
11
11
|
}
|
|
12
12
|
getStepName() {
|
|
13
13
|
return 'Echo';
|
|
@@ -16,7 +16,7 @@ class EchoStep extends MablStep_1.MablStep {
|
|
|
16
16
|
return { value: this.echoValue.toString() };
|
|
17
17
|
}
|
|
18
18
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
19
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('echo', this);
|
|
19
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('echo', this);
|
|
20
20
|
seleniumStep.target = this.substituteSeleniumVariable(this.echoValue);
|
|
21
21
|
return [seleniumStep];
|
|
22
22
|
}
|
|
@@ -10,9 +10,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
|
-
this.text = MablAction_1.parseArgument(arg);
|
|
13
|
+
this.text = (0, MablAction_1.parseArgument)(arg);
|
|
14
14
|
this.validate();
|
|
15
|
-
if (mablscriptFind_1.isFindElementType(this.actions[0].getActionName())) {
|
|
15
|
+
if ((0, mablscriptFind_1.isFindElementType)(this.actions[0].getActionName())) {
|
|
16
16
|
this.findAction = this.actions[0];
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
@@ -71,7 +71,7 @@ class EnterTextStep extends MablStep_1.MablStep {
|
|
|
71
71
|
return formatted;
|
|
72
72
|
}
|
|
73
73
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
74
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('type', this);
|
|
74
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('type', this);
|
|
75
75
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
76
76
|
seleniumStep.value = this.substituteSeleniumVariable(this.text);
|
|
77
77
|
return [seleniumStep];
|
|
@@ -46,7 +46,7 @@ class HoverStep extends MablStep_1.MablStep {
|
|
|
46
46
|
return new HoverStep('hover', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
47
47
|
}
|
|
48
48
|
produceSelIdeFormattedSteps(_stepIndex) {
|
|
49
|
-
const seleniumStep = SeleniumIdeStep_1.buildSeleniumIdeStep('mouseOver', this);
|
|
49
|
+
const seleniumStep = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('mouseOver', this);
|
|
50
50
|
seleniumStep.target = this.findAction.getSelIdeTarget();
|
|
51
51
|
return [seleniumStep];
|
|
52
52
|
}
|
|
@@ -34,7 +34,8 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
34
34
|
toStepDescriptor() {
|
|
35
35
|
var _a, _b;
|
|
36
36
|
const conditionDescriptor = this.conditionAction !== undefined
|
|
37
|
-
? (_a = this.conditionAction) === null || _a === void 0 ? void 0 : _a.conditionDescriptor
|
|
37
|
+
? (_a = this.conditionAction) === null || _a === void 0 ? void 0 : _a.conditionDescriptor
|
|
38
|
+
: { conditionType: ConditionDescriptor_1.ConditionType.Truthy };
|
|
38
39
|
const find = this.primaryAction.toDescriptor();
|
|
39
40
|
return {
|
|
40
41
|
find,
|