@mablhq/mabl-cli 2.22.7 → 2.23.4
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/config/config_cmds/install.js +1 -1
- package/domUtil/index.js +1 -1
- package/execution/index.js +2 -2
- package/mablApi/index.js +1 -1
- package/mablscript/importer.js +2 -0
- package/mablscript/mobile/tests/TestMobileFindDescriptors.js +2 -6
- package/mablscript/steps/AbstractAssertionsAndVariablesStep.js +35 -0
- package/mablscript/steps/AssertStep.js +12 -26
- package/mablscript/steps/AssertStepOld.js +1 -1
- package/mablscript/steps/DatabaseCallStep.js +24 -0
- package/mablscript/steps/IfConditionStep.js +3 -3
- package/mablscript/steps/SendHttpRequestStep.js +25 -57
- package/mablscript/types/AssertionsAndVariablesStepDescriptor.js +2 -0
- package/mablscript/types/ConditionDescriptor.js +25 -1
- package/mablscriptFind/index.js +1 -1
- package/package.json +1 -1
- package/resources/mablFind.js +1 -1
- package/upload/index.js +1 -1
package/mablscript/importer.js
CHANGED
|
@@ -68,6 +68,7 @@ const InstallAppStep_1 = require("./mobile/steps/InstallAppStep");
|
|
|
68
68
|
const UninstallAppStep_1 = require("./mobile/steps/UninstallAppStep");
|
|
69
69
|
const PrepareSessionStep_1 = require("./mobile/steps/PrepareSessionStep");
|
|
70
70
|
const OpenLinkStep_1 = require("./mobile/steps/OpenLinkStep");
|
|
71
|
+
const DatabaseCallStep_1 = require("./steps/DatabaseCallStep");
|
|
71
72
|
const ActionTypes = [
|
|
72
73
|
AwaitDownloadAction_1.AwaitDownloadAction,
|
|
73
74
|
AwaitPDFDownloadAction_1.AwaitPDFDownloadAction,
|
|
@@ -91,6 +92,7 @@ const StepTypes = [
|
|
|
91
92
|
ClickStep_1.ClickStep,
|
|
92
93
|
ClickAndHoldStep_1.ClickAndHoldStep,
|
|
93
94
|
CreateVariableStep_1.CreateVariableStep,
|
|
95
|
+
DatabaseCallStep_1.DatabaseCallStep,
|
|
94
96
|
DoubleClickStep_1.DoubleClickStep,
|
|
95
97
|
DownloadStep_1.DownloadStep,
|
|
96
98
|
EchoStep_1.EchoStep,
|
|
@@ -7,7 +7,6 @@ exports.iOSWebViewTextFieldMobileFindDescriptor = {
|
|
|
7
7
|
findTarget: {
|
|
8
8
|
selector: {
|
|
9
9
|
iOS: {
|
|
10
|
-
accessible: false,
|
|
11
10
|
rect: {
|
|
12
11
|
width: 390,
|
|
13
12
|
x: 0,
|
|
@@ -59,10 +58,10 @@ exports.AndroidWebViewTextFieldMobileFindDescriptor = {
|
|
|
59
58
|
displayed: true,
|
|
60
59
|
checkable: false,
|
|
61
60
|
clickable: false,
|
|
62
|
-
index: 0,
|
|
63
61
|
focusable: false,
|
|
64
62
|
alternateXPaths: [],
|
|
65
63
|
enabled: true,
|
|
64
|
+
index: 0,
|
|
66
65
|
longClickable: false,
|
|
67
66
|
rect: {
|
|
68
67
|
width: 1440,
|
|
@@ -115,7 +114,6 @@ exports.iOSTestLabWebViewClickCounterMobileFindDescriptor = {
|
|
|
115
114
|
findTarget: {
|
|
116
115
|
selector: {
|
|
117
116
|
iOS: {
|
|
118
|
-
accessible: false,
|
|
119
117
|
rect: {
|
|
120
118
|
width: 390,
|
|
121
119
|
x: 0,
|
|
@@ -164,10 +162,10 @@ exports.AndroidTestLabWebViewClickCounterMobileFindDescriptor = {
|
|
|
164
162
|
displayed: true,
|
|
165
163
|
checkable: false,
|
|
166
164
|
clickable: false,
|
|
167
|
-
index: 0,
|
|
168
165
|
focusable: false,
|
|
169
166
|
alternateXPaths: [],
|
|
170
167
|
enabled: true,
|
|
168
|
+
index: 0,
|
|
171
169
|
longClickable: false,
|
|
172
170
|
rect: {
|
|
173
171
|
width: 1000,
|
|
@@ -219,7 +217,6 @@ exports.iOSVerticalGridContainerMobileFindDescriptor = {
|
|
|
219
217
|
iOS: {
|
|
220
218
|
type: 'XCUIElementTypeOther',
|
|
221
219
|
enabled: true,
|
|
222
|
-
accessible: false,
|
|
223
220
|
rect: {
|
|
224
221
|
x: 0,
|
|
225
222
|
y: 143,
|
|
@@ -269,7 +266,6 @@ exports.iOSTwoHorizontalScrollGrid2MobileFindDescriptor = {
|
|
|
269
266
|
type: 'XCUIElementTypeOther',
|
|
270
267
|
name: 'grid-2',
|
|
271
268
|
enabled: true,
|
|
272
|
-
accessible: false,
|
|
273
269
|
rect: {
|
|
274
270
|
x: 0,
|
|
275
271
|
y: 517,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractAssertionsAndVariablesStep = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
6
|
+
const MablStep_1 = require("../MablStep");
|
|
7
|
+
class AbstractAssertionsAndVariablesStep extends MablStep_1.MablStep {
|
|
8
|
+
constructor(name, args, actions, mablScriptName, stepName, descriptor) {
|
|
9
|
+
super(name, args, actions, mablScriptName);
|
|
10
|
+
this.stepName = stepName;
|
|
11
|
+
this.descriptor = descriptor;
|
|
12
|
+
}
|
|
13
|
+
getStepName() {
|
|
14
|
+
return this.stepName;
|
|
15
|
+
}
|
|
16
|
+
toStepDescriptor() {
|
|
17
|
+
const formatted = JSON.parse(JSON.stringify(this.descriptor));
|
|
18
|
+
formatted.actionCode = this.actionCode;
|
|
19
|
+
return formatted;
|
|
20
|
+
}
|
|
21
|
+
toMablscript() {
|
|
22
|
+
return `${this.getActionCode()}(${(0, domUtil_1.buildStepArgumentString)({
|
|
23
|
+
params: { ...this.descriptor },
|
|
24
|
+
legacy: true,
|
|
25
|
+
})})`;
|
|
26
|
+
}
|
|
27
|
+
getInputVariables() {
|
|
28
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.descriptor);
|
|
29
|
+
}
|
|
30
|
+
getOutputVariables() {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return (_b = (_a = this.descriptor.variables) === null || _a === void 0 ? void 0 : _a.map((variable) => variable.name)) !== null && _b !== void 0 ? _b : [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.AbstractAssertionsAndVariablesStep = AbstractAssertionsAndVariablesStep;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AssertStep = exports.
|
|
3
|
+
exports.AssertStep = exports.assertStepYamlMablscriptNames = exports.OnFailure = void 0;
|
|
4
4
|
const ConditionAction_1 = require("../actions/ConditionAction");
|
|
5
5
|
const FindAction_1 = require("../actions/FindAction");
|
|
6
6
|
const MablStep_1 = require("../MablStep");
|
|
7
7
|
const MablAction_1 = require("../MablAction");
|
|
8
8
|
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
9
9
|
const domUtil_1 = require("../../domUtil");
|
|
10
|
+
const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
|
|
10
11
|
const GetUrlAction_1 = require("../actions/GetUrlAction");
|
|
11
12
|
const GetCurrentLocationDescriptor_1 = require("../types/GetCurrentLocationDescriptor");
|
|
12
13
|
const GetVariableValue_1 = require("../actions/GetVariableValue");
|
|
@@ -19,29 +20,12 @@ var OnFailure;
|
|
|
19
20
|
OnFailure["FailImmediately"] = "terminate";
|
|
20
21
|
OnFailure["FailTestAtEnd"] = "failAtEnd";
|
|
21
22
|
})(OnFailure = exports.OnFailure || (exports.OnFailure = {}));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
AssertPresent: 'present',
|
|
25
|
-
AssertNotPresent: 'not_present',
|
|
26
|
-
AssertDoesNotEqual: 'does_not_equal',
|
|
27
|
-
AssertContains: 'contains',
|
|
28
|
-
AssertDoesNotContain: 'does_not_contain',
|
|
29
|
-
AssertStartsWith: 'starts_with',
|
|
30
|
-
AssertStartsWithout: 'starts_without',
|
|
31
|
-
AssertEndsWith: 'ends_with',
|
|
32
|
-
AssertEndsWithout: 'ends_without',
|
|
33
|
-
AssertGreaterThan: 'greater_than',
|
|
34
|
-
AssertLessThan: 'less_than',
|
|
35
|
-
AssertGreaterThanOrEquals: 'greater_than_or_equals',
|
|
36
|
-
AssertLessThanOrEquals: 'less_than_or_equals',
|
|
37
|
-
};
|
|
38
|
-
const yamlMablScriptNames = () => {
|
|
39
|
-
const assertionNames = Object.keys(exports.assertionStepToField);
|
|
23
|
+
const assertStepYamlMablscriptNames = () => {
|
|
24
|
+
const assertionNames = Object.keys(ConditionDescriptor_1.AssertionStepNameToField);
|
|
40
25
|
assertionNames.push('WaitUntil');
|
|
41
26
|
return assertionNames;
|
|
42
27
|
};
|
|
43
|
-
exports.
|
|
44
|
-
Object.entries(exports.assertionStepToField).forEach(([stepType, field]) => (exports.fieldToAssertionStep[field] = stepType));
|
|
28
|
+
exports.assertStepYamlMablscriptNames = assertStepYamlMablscriptNames;
|
|
45
29
|
class AssertStep extends MablStep_1.MablStep {
|
|
46
30
|
constructor(name, args, actions) {
|
|
47
31
|
var _a, _b;
|
|
@@ -68,7 +52,8 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
68
52
|
else {
|
|
69
53
|
this.conditionAction = actions[1];
|
|
70
54
|
}
|
|
71
|
-
this.assertionType = this.conditionAction
|
|
55
|
+
this.assertionType = this.conditionAction
|
|
56
|
+
.conditionAttribute;
|
|
72
57
|
this.assertionValue = this.conditionAction.conditionValueAttribute;
|
|
73
58
|
this.isWaitUntilStep = this.determineIfWaitUntilStep();
|
|
74
59
|
this.assertArguments =
|
|
@@ -96,7 +81,8 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
96
81
|
determineIfWaitUntilStep() {
|
|
97
82
|
var _a, _b;
|
|
98
83
|
const find = this.primaryAction.toDescriptor();
|
|
99
|
-
if (
|
|
84
|
+
if (ConditionDescriptor_1.AssertionConditionFieldToStepName[this.assertionType] ===
|
|
85
|
+
'AssertPresent' &&
|
|
100
86
|
(0, domUtil_1.isFindElementDescriptor)(find)) {
|
|
101
87
|
if ((_b = (_a = find.findOptions) === null || _a === void 0 ? void 0 : _a.waitUntil) === null || _b === void 0 ? void 0 : _b.timeoutSeconds) {
|
|
102
88
|
return true;
|
|
@@ -108,7 +94,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
108
94
|
if (this.isWaitUntilStep) {
|
|
109
95
|
return 'WaitUntil';
|
|
110
96
|
}
|
|
111
|
-
return
|
|
97
|
+
return ConditionDescriptor_1.AssertionConditionFieldToStepName[this.assertionType];
|
|
112
98
|
}
|
|
113
99
|
toStepDescriptor() {
|
|
114
100
|
var _a, _b;
|
|
@@ -173,7 +159,7 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
173
159
|
static fromYaml(stepName, stepArgs) {
|
|
174
160
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
175
161
|
const actions = [];
|
|
176
|
-
const assertionType =
|
|
162
|
+
const assertionType = ConditionDescriptor_1.AssertionStepNameToField[stepName];
|
|
177
163
|
const assertionValue = stepArgs.assertionValue;
|
|
178
164
|
const conditionOptions = stepArgs.conditionOptions;
|
|
179
165
|
let primaryAction;
|
|
@@ -269,4 +255,4 @@ class AssertStep extends MablStep_1.MablStep {
|
|
|
269
255
|
}
|
|
270
256
|
exports.AssertStep = AssertStep;
|
|
271
257
|
AssertStep.mablScriptStepNames = ['assert'];
|
|
272
|
-
AssertStep.yamlMablScriptNames =
|
|
258
|
+
AssertStep.yamlMablScriptNames = (0, exports.assertStepYamlMablscriptNames)();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseCallVariableSource = exports.DatabaseCallStep = void 0;
|
|
4
|
+
const AbstractAssertionsAndVariablesStep_1 = require("./AbstractAssertionsAndVariablesStep");
|
|
5
|
+
class DatabaseCallStep extends AbstractAssertionsAndVariablesStep_1.AbstractAssertionsAndVariablesStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, DatabaseCallStep.mablScriptStepNames[0], DatabaseCallStep.stepName, args[0]);
|
|
8
|
+
}
|
|
9
|
+
static fromYaml(_stepName, stepArgs) {
|
|
10
|
+
const formatted = stepArgs;
|
|
11
|
+
const step = new DatabaseCallStep(DatabaseCallStep.stepName, [formatted], []);
|
|
12
|
+
step.setStepId(stepArgs.id);
|
|
13
|
+
return step;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.DatabaseCallStep = DatabaseCallStep;
|
|
17
|
+
DatabaseCallStep.stepName = 'DatabaseCall';
|
|
18
|
+
DatabaseCallStep.mablScriptStepNames = ['database_call'];
|
|
19
|
+
DatabaseCallStep.yamlMablScriptNames = [DatabaseCallStep.stepName];
|
|
20
|
+
var DatabaseCallVariableSource;
|
|
21
|
+
(function (DatabaseCallVariableSource) {
|
|
22
|
+
DatabaseCallVariableSource["Metadata"] = "metadata";
|
|
23
|
+
DatabaseCallVariableSource["Result"] = "result";
|
|
24
|
+
})(DatabaseCallVariableSource = exports.DatabaseCallVariableSource || (exports.DatabaseCallVariableSource = {}));
|
|
@@ -61,7 +61,7 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
61
61
|
};
|
|
62
62
|
if (this.conditionAction) {
|
|
63
63
|
details.condition =
|
|
64
|
-
|
|
64
|
+
ConditionDescriptor_1.AssertionConditionFieldToStepName[this.conditionAction.conditionAttribute];
|
|
65
65
|
if (this.conditionAction.conditionValueAttribute !== undefined) {
|
|
66
66
|
details.conditionValue = this.conditionAction.conditionValueAttribute;
|
|
67
67
|
}
|
|
@@ -125,11 +125,11 @@ class IfConditionStep extends MablStep_1.MablStep {
|
|
|
125
125
|
actions.push(JavaScriptAction_1.JavaScriptAction.fromYaml(stepArgs.snippet));
|
|
126
126
|
}
|
|
127
127
|
if (stepArgs.condition) {
|
|
128
|
-
const conditionType =
|
|
128
|
+
const conditionType = ConditionDescriptor_1.AssertionStepNameToField[stepArgs.condition];
|
|
129
129
|
actions.push(new ConditionAction_1.ConditionAction(conditionType === 'present' || conditionType === 'not_present'
|
|
130
130
|
? 'evaluate_presence'
|
|
131
131
|
: 'evaluate_condition', [
|
|
132
|
-
|
|
132
|
+
ConditionDescriptor_1.AssertionStepNameToField[stepArgs.condition],
|
|
133
133
|
stepArgs.conditionValue,
|
|
134
134
|
stepArgs.conditionOptions,
|
|
135
135
|
]));
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const MablStep_1 = require("../MablStep");
|
|
3
|
+
exports.SendHttpRequestVariableSource = exports.SendHttpRequestStep = void 0;
|
|
4
|
+
const AbstractAssertionsAndVariablesStep_1 = require("./AbstractAssertionsAndVariablesStep");
|
|
6
5
|
const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
|
|
7
|
-
|
|
8
|
-
const domUtil_1 = require("../../domUtil");
|
|
9
|
-
const evalAssertionType = {};
|
|
10
|
-
Object.entries(AssertStep_1.assertionStepToField).forEach(([stepType, field]) => (evalAssertionType[field] = `${stepType.split('Assert')[1]}`));
|
|
11
|
-
class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
6
|
+
class SendHttpRequestStep extends AbstractAssertionsAndVariablesStep_1.AbstractAssertionsAndVariablesStep {
|
|
12
7
|
constructor(name, args, actions) {
|
|
13
|
-
super(name, args, actions, 'send_http_request');
|
|
14
|
-
this.sendRequest = this.getActionArgs()[0];
|
|
15
|
-
}
|
|
16
|
-
getStepName() {
|
|
17
|
-
return SendHttpRequestStep.stepName;
|
|
18
|
-
}
|
|
19
|
-
toStepDescriptor() {
|
|
20
|
-
const formatted = JSON.parse(JSON.stringify(this.sendRequest));
|
|
21
|
-
if (formatted.assertions) {
|
|
22
|
-
formatted.assertions = formatted.assertions.map((assertion) => ({
|
|
23
|
-
...assertion,
|
|
24
|
-
assertion: evalAssertionType[assertion.assertion],
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
formatted.actionCode = this.actionCode;
|
|
28
|
-
return formatted;
|
|
8
|
+
super(name, args, actions, 'send_http_request', SendHttpRequestStep.stepName, args[0]);
|
|
29
9
|
}
|
|
30
10
|
static fromYaml(_stepName, stepArgs) {
|
|
31
11
|
var _a;
|
|
@@ -35,7 +15,7 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
35
15
|
var _a;
|
|
36
16
|
return ({
|
|
37
17
|
...assertion,
|
|
38
|
-
assertion: (_a =
|
|
18
|
+
assertion: (_a = ConditionDescriptor_1.AssertionStepNameToField[`Assert${assertion.assertion}`]) !== null && _a !== void 0 ? _a : assertion.assertion,
|
|
39
19
|
});
|
|
40
20
|
});
|
|
41
21
|
}
|
|
@@ -43,41 +23,29 @@ class SendHttpRequestStep extends MablStep_1.MablStep {
|
|
|
43
23
|
step.setStepId(stepArgs.id);
|
|
44
24
|
return step;
|
|
45
25
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
26
|
+
toStepDescriptor() {
|
|
27
|
+
const internalDescriptor = this
|
|
28
|
+
.descriptor;
|
|
29
|
+
const formatted = JSON.parse(JSON.stringify(internalDescriptor));
|
|
30
|
+
if (internalDescriptor.assertions) {
|
|
31
|
+
formatted.assertions = internalDescriptor.assertions.map((assertion) => ({
|
|
32
|
+
...assertion,
|
|
33
|
+
assertion: ConditionDescriptor_1.AssertionConditionFieldToCondition[assertion.assertion],
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
formatted.actionCode = this.actionCode;
|
|
37
|
+
return formatted;
|
|
58
38
|
}
|
|
59
39
|
}
|
|
60
40
|
exports.SendHttpRequestStep = SendHttpRequestStep;
|
|
61
41
|
SendHttpRequestStep.stepName = 'SendHttpRequest';
|
|
62
42
|
SendHttpRequestStep.mablScriptStepNames = ['send_http_request'];
|
|
63
43
|
SendHttpRequestStep.yamlMablScriptNames = [SendHttpRequestStep.stepName];
|
|
64
|
-
var
|
|
65
|
-
(function (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
HttpResponseAssertion.toComparisonDescriptor = toComparisonDescriptor;
|
|
75
|
-
})(HttpResponseAssertion = exports.HttpResponseAssertion || (exports.HttpResponseAssertion = {}));
|
|
76
|
-
var VariableSource;
|
|
77
|
-
(function (VariableSource) {
|
|
78
|
-
VariableSource["Body"] = "body";
|
|
79
|
-
VariableSource["Header"] = "header";
|
|
80
|
-
VariableSource["Json"] = "json";
|
|
81
|
-
VariableSource["Response"] = "response";
|
|
82
|
-
VariableSource["Status"] = "status";
|
|
83
|
-
})(VariableSource = exports.VariableSource || (exports.VariableSource = {}));
|
|
44
|
+
var SendHttpRequestVariableSource;
|
|
45
|
+
(function (SendHttpRequestVariableSource) {
|
|
46
|
+
SendHttpRequestVariableSource["Body"] = "body";
|
|
47
|
+
SendHttpRequestVariableSource["Header"] = "header";
|
|
48
|
+
SendHttpRequestVariableSource["Json"] = "json";
|
|
49
|
+
SendHttpRequestVariableSource["Response"] = "response";
|
|
50
|
+
SendHttpRequestVariableSource["Status"] = "status";
|
|
51
|
+
})(SendHttpRequestVariableSource = exports.SendHttpRequestVariableSource || (exports.SendHttpRequestVariableSource = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PresenceEvaluationType = exports.isAbsenceExpected = exports.isPresenceCondition = exports.ComparisonType = exports.ConditionType = void 0;
|
|
3
|
+
exports.AssertionConditionFieldToStepName = exports.AssertionConditionFieldToCondition = exports.AssertionStepNameToField = exports.PresenceEvaluationType = exports.isAbsenceExpected = exports.isPresenceCondition = exports.ComparisonType = exports.ConditionType = void 0;
|
|
4
4
|
var ConditionType;
|
|
5
5
|
(function (ConditionType) {
|
|
6
6
|
ConditionType["Comparison"] = "comparison";
|
|
@@ -56,3 +56,27 @@ var PresenceEvaluationType;
|
|
|
56
56
|
}
|
|
57
57
|
PresenceEvaluationType.fromString = fromString;
|
|
58
58
|
})(PresenceEvaluationType = exports.PresenceEvaluationType || (exports.PresenceEvaluationType = {}));
|
|
59
|
+
exports.AssertionStepNameToField = {
|
|
60
|
+
AssertEquals: 'equals',
|
|
61
|
+
AssertPresent: 'present',
|
|
62
|
+
AssertNotPresent: 'not_present',
|
|
63
|
+
AssertDoesNotEqual: 'does_not_equal',
|
|
64
|
+
AssertContains: 'contains',
|
|
65
|
+
AssertDoesNotContain: 'does_not_contain',
|
|
66
|
+
AssertStartsWith: 'starts_with',
|
|
67
|
+
AssertStartsWithout: 'starts_without',
|
|
68
|
+
AssertEndsWith: 'ends_with',
|
|
69
|
+
AssertEndsWithout: 'ends_without',
|
|
70
|
+
AssertGreaterThan: 'greater_than',
|
|
71
|
+
AssertLessThan: 'less_than',
|
|
72
|
+
AssertGreaterThanOrEquals: 'greater_than_or_equals',
|
|
73
|
+
AssertLessThanOrEquals: 'less_than_or_equals',
|
|
74
|
+
};
|
|
75
|
+
exports.AssertionConditionFieldToCondition = Object.fromEntries(Object.entries(exports.AssertionStepNameToField).map(([stepType, field]) => [
|
|
76
|
+
field,
|
|
77
|
+
`${stepType.split('Assert')[1]}`,
|
|
78
|
+
]));
|
|
79
|
+
exports.AssertionConditionFieldToStepName = Object.fromEntries(Object.entries(exports.AssertionStepNameToField).map(([stepType, field]) => [
|
|
80
|
+
field,
|
|
81
|
+
stepType,
|
|
82
|
+
]));
|