@servicenow/sdk-build-plugins 2.0.1
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/dist/AttachmentPlugin.d.ts +253 -0
- package/dist/AttachmentPlugin.js +216 -0
- package/dist/AttachmentPlugin.js.map +1 -0
- package/dist/BusinessRulePlugin.d.ts +56 -0
- package/dist/BusinessRulePlugin.js +171 -0
- package/dist/BusinessRulePlugin.js.map +1 -0
- package/dist/CrossScopePrivilegePlugin.d.ts +22 -0
- package/dist/CrossScopePrivilegePlugin.js +42 -0
- package/dist/CrossScopePrivilegePlugin.js.map +1 -0
- package/dist/DefaultPlugin.d.ts +71 -0
- package/dist/DefaultPlugin.js +238 -0
- package/dist/DefaultPlugin.js.map +1 -0
- package/dist/IdPlugin.d.ts +17 -0
- package/dist/IdPlugin.js +45 -0
- package/dist/IdPlugin.js.map +1 -0
- package/dist/ListPlugin.d.ts +91 -0
- package/dist/ListPlugin.js +398 -0
- package/dist/ListPlugin.js.map +1 -0
- package/dist/PropertyPlugin.d.ts +122 -0
- package/dist/PropertyPlugin.js +165 -0
- package/dist/PropertyPlugin.js.map +1 -0
- package/dist/ScriptTemplatePlugin.d.ts +31 -0
- package/dist/ScriptTemplatePlugin.js +208 -0
- package/dist/ScriptTemplatePlugin.js.map +1 -0
- package/dist/UserPreferencePlugin.d.ts +16 -0
- package/dist/UserPreferencePlugin.js +30 -0
- package/dist/UserPreferencePlugin.js.map +1 -0
- package/dist/aclAndRole/AclPlugin.d.ts +117 -0
- package/dist/aclAndRole/AclPlugin.js +285 -0
- package/dist/aclAndRole/AclPlugin.js.map +1 -0
- package/dist/aclAndRole/RolePlugin.d.ts +58 -0
- package/dist/aclAndRole/RolePlugin.js +152 -0
- package/dist/aclAndRole/RolePlugin.js.map +1 -0
- package/dist/aclAndRole/Util.d.ts +3 -0
- package/dist/aclAndRole/Util.js +106 -0
- package/dist/aclAndRole/Util.js.map +1 -0
- package/dist/app/ApplicationMenuPlugin.d.ts +32 -0
- package/dist/app/ApplicationMenuPlugin.js +106 -0
- package/dist/app/ApplicationMenuPlugin.js.map +1 -0
- package/dist/atf/ATFComposer.d.ts +492 -0
- package/dist/atf/ATFComposer.js +2717 -0
- package/dist/atf/ATFComposer.js.map +1 -0
- package/dist/atf/TestPlugin.d.ts +31 -0
- package/dist/atf/TestPlugin.js +95 -0
- package/dist/atf/TestPlugin.js.map +1 -0
- package/dist/atf/index.d.ts +1 -0
- package/dist/atf/index.js +9 -0
- package/dist/atf/index.js.map +1 -0
- package/dist/db/ColumnPlugins.d.ts +278 -0
- package/dist/db/ColumnPlugins.js +112 -0
- package/dist/db/ColumnPlugins.js.map +1 -0
- package/dist/db/RecordPlugin.d.ts +208 -0
- package/dist/db/RecordPlugin.js +287 -0
- package/dist/db/RecordPlugin.js.map +1 -0
- package/dist/db/TablePlugin.d.ts +742 -0
- package/dist/db/TablePlugin.js +1249 -0
- package/dist/db/TablePlugin.js.map +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +27 -0
- package/dist/db/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +12 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +371 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +15 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js +177 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +144 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js +318 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js.map +1 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +190 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js +53 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestUtils.d.ts +75 -0
- package/dist/scriptedRESTAPI/RestUtils.js +469 -0
- package/dist/scriptedRESTAPI/RestUtils.js.map +1 -0
- package/dist/scripts/ClientScriptPlugin.d.ts +43 -0
- package/dist/scripts/ClientScriptPlugin.js +190 -0
- package/dist/scripts/ClientScriptPlugin.js.map +1 -0
- package/dist/scripts/scriptUtils.d.ts +15 -0
- package/dist/scripts/scriptUtils.js +83 -0
- package/dist/scripts/scriptUtils.js.map +1 -0
- package/dist/uxf/ExperiencePlugin.d.ts +22 -0
- package/dist/uxf/ExperiencePlugin.js +55 -0
- package/dist/uxf/ExperiencePlugin.js.map +1 -0
- package/dist/uxf/RoutesPlugin.d.ts +22 -0
- package/dist/uxf/RoutesPlugin.js +176 -0
- package/dist/uxf/RoutesPlugin.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +4 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js +65 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +189 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js +158 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +13 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +604 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +12 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +31 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +64 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/index.d.ts +3 -0
- package/dist/uxf/UxfFormulaParser/index.js +11 -0
- package/dist/uxf/UxfFormulaParser/index.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/parser.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/parser.js +87 -0
- package/dist/uxf/UxfFormulaParser/parser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +17 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +1 -0
- package/dist/uxf/constants.d.ts +2 -0
- package/dist/uxf/constants.js +8 -0
- package/dist/uxf/constants.js.map +1 -0
- package/dist/uxf/index.d.ts +2 -0
- package/dist/uxf/index.js +11 -0
- package/dist/uxf/index.js.map +1 -0
- package/dist/uxf/tectonicIdGenerator.d.ts +12 -0
- package/dist/uxf/tectonicIdGenerator.js +102 -0
- package/dist/uxf/tectonicIdGenerator.js.map +1 -0
- package/license +9 -0
- package/package.json +42 -0
- package/src/AttachmentPlugin.ts +262 -0
- package/src/BusinessRulePlugin.ts +251 -0
- package/src/CrossScopePrivilegePlugin.ts +54 -0
- package/src/DefaultPlugin.ts +272 -0
- package/src/IdPlugin.ts +47 -0
- package/src/ListPlugin.ts +497 -0
- package/src/PropertyPlugin.ts +218 -0
- package/src/ScriptTemplatePlugin.ts +223 -0
- package/src/UserPreferencePlugin.ts +36 -0
- package/src/aclAndRole/AclPlugin.ts +410 -0
- package/src/aclAndRole/RolePlugin.ts +225 -0
- package/src/aclAndRole/Util.ts +104 -0
- package/src/app/ApplicationMenuPlugin.ts +158 -0
- package/src/atf/ATFComposer.ts +3356 -0
- package/src/atf/TestPlugin.ts +119 -0
- package/src/atf/index.ts +1 -0
- package/src/db/ColumnPlugins.ts +117 -0
- package/src/db/RecordPlugin.ts +391 -0
- package/src/db/TablePlugin.ts +1581 -0
- package/src/db/index.ts +3 -0
- package/src/index.ts +16 -0
- package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +410 -0
- package/src/scriptedRESTAPI/RESTSerializationUtils.ts +227 -0
- package/src/scriptedRESTAPI/RestApiPlugin.ts +438 -0
- package/src/scriptedRESTAPI/RestSchemaUtils.ts +72 -0
- package/src/scriptedRESTAPI/RestUtils.ts +507 -0
- package/src/scripts/ClientScriptPlugin.ts +251 -0
- package/src/scripts/scriptUtils.ts +81 -0
- package/src/uxf/ExperiencePlugin.ts +64 -0
- package/src/uxf/RoutesPlugin.ts +215 -0
- package/src/uxf/UxfFormulaParser/cleanUxValue.ts +73 -0
- package/src/uxf/UxfFormulaParser/grammerParser/api.js +166 -0
- package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +606 -0
- package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +65 -0
- package/src/uxf/UxfFormulaParser/index.ts +4 -0
- package/src/uxf/UxfFormulaParser/parser.ts +64 -0
- package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +13 -0
- package/src/uxf/constants.ts +4 -0
- package/src/uxf/index.ts +2 -0
- package/src/uxf/tectonicIdGenerator.ts +81 -0
|
@@ -0,0 +1,2717 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ATF = void 0;
|
|
27
|
+
exports.getRecordIdIfRecord = getRecordIdIfRecord;
|
|
28
|
+
exports.getRoleId = getRoleId;
|
|
29
|
+
exports.getRecordId = getRecordId;
|
|
30
|
+
exports.isRecord = isRecord;
|
|
31
|
+
exports.isRole = isRole;
|
|
32
|
+
const db_1 = require("@servicenow/sdk-core/runtime/db");
|
|
33
|
+
const tables_1 = require("@servicenow/sdk-core/runtime/tables");
|
|
34
|
+
const atf = __importStar(require("@servicenow/sdk-core/runtime/atf"));
|
|
35
|
+
function getRecordIdIfRecord(value, context) {
|
|
36
|
+
if (isRecord(value)) {
|
|
37
|
+
return getRecordId(value, context);
|
|
38
|
+
}
|
|
39
|
+
else if (isRole(value)) {
|
|
40
|
+
return getRoleId(value, context);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function getRoleId(record, context) {
|
|
45
|
+
return context.keys.registerExplicitId('sys_user_role', record.$id);
|
|
46
|
+
}
|
|
47
|
+
function getRecordId(record, context) {
|
|
48
|
+
if ('sys_id' in record.data && record.data['sys_id']) {
|
|
49
|
+
return record.data['sys_id'];
|
|
50
|
+
}
|
|
51
|
+
return context.keys.registerExplicitId(record.table, typeof record.$id === 'object' ? record.$id.id : record.$id);
|
|
52
|
+
}
|
|
53
|
+
function isRecord(value) {
|
|
54
|
+
return typeof value === 'object' && '$id' in value && 'table' in value;
|
|
55
|
+
}
|
|
56
|
+
function isRole(value) {
|
|
57
|
+
return typeof value === 'object' && '$id' in value && 'name' in value;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* These functions will return record lists instead of the return type property specified in the interface. Hence the explicit any return
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
class ATF {
|
|
64
|
+
test;
|
|
65
|
+
/**
|
|
66
|
+
* Do not modify directly. Let TestPlugin handle incrementing the value
|
|
67
|
+
*/
|
|
68
|
+
order;
|
|
69
|
+
/**
|
|
70
|
+
* Do not manipulate directly in step functions. Instead create helper creation functions that increment this value
|
|
71
|
+
*
|
|
72
|
+
* Modified in the following locations:
|
|
73
|
+
* ```typescript
|
|
74
|
+
* function createStepRecord
|
|
75
|
+
* function _createGemRecords
|
|
76
|
+
* function _createVariableValueRecord
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
_records;
|
|
80
|
+
/**
|
|
81
|
+
* Used to access previously created steps based on index. Do not manipulate directly unless you are sure of what you are doing
|
|
82
|
+
*
|
|
83
|
+
* Modified in the following locations:
|
|
84
|
+
* ```typescript
|
|
85
|
+
* createStepRecord
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
stepRecords;
|
|
89
|
+
context;
|
|
90
|
+
constructor(inputObject, context) {
|
|
91
|
+
this.context = context;
|
|
92
|
+
this.test = (0, db_1.Record)({
|
|
93
|
+
$id: inputObject.$id,
|
|
94
|
+
table: 'sys_atf_test',
|
|
95
|
+
data: {
|
|
96
|
+
name: inputObject.name,
|
|
97
|
+
active: inputObject.active,
|
|
98
|
+
description: inputObject.description,
|
|
99
|
+
fail_on_server_error: inputObject.failOnServerError,
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
this._records = {};
|
|
103
|
+
this.order = 1;
|
|
104
|
+
this.stepRecords = [];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* DO NOT CALL DIRECTLY
|
|
108
|
+
* Unless you know what you are doing do not handle setting the order number. It is handled by TestPlugin
|
|
109
|
+
*/
|
|
110
|
+
incrementOrder() {
|
|
111
|
+
this.order++;
|
|
112
|
+
}
|
|
113
|
+
parseValue(value) {
|
|
114
|
+
// Simple object types should be trivial to parse
|
|
115
|
+
if (typeof value !== 'object') {
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
// Dont iterate on entities, assume whatever extractor they are using is doing its job
|
|
119
|
+
if (typeof value?.asRecord !== 'undefined') {
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
// If the value is a gem value we should replace the gem object with a string in place
|
|
123
|
+
if (this.isGem(value)) {
|
|
124
|
+
const refRecord = this.stepRecords[value.__references];
|
|
125
|
+
if (!refRecord) {
|
|
126
|
+
throw new Error('Cannot find referenced record');
|
|
127
|
+
}
|
|
128
|
+
const stepID = getRecordId(refRecord, this.context);
|
|
129
|
+
value = `{{step['${stepID}'].${value.__value}}}`;
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
// Template strings can contain gem values so iterate over them to replace gem values, records, etc, if necessary, but most entries should be string
|
|
133
|
+
if (this.isTemplateStr(value)) {
|
|
134
|
+
return `${value.__template.map((entry) => this.parseValue(entry)).join('')}`;
|
|
135
|
+
}
|
|
136
|
+
// If the value is a record turn it into a sys_id
|
|
137
|
+
if (isRecord(value) || isRole(value)) {
|
|
138
|
+
return this.extractSysIdIfRecord(value);
|
|
139
|
+
}
|
|
140
|
+
// Recurse into object and see if any of its descendents need to be parsed
|
|
141
|
+
const keys = Object.keys(value);
|
|
142
|
+
for (const key of keys) {
|
|
143
|
+
const val = value[key];
|
|
144
|
+
value[key] = this.parseValue(val);
|
|
145
|
+
}
|
|
146
|
+
// Return parsed object
|
|
147
|
+
return value;
|
|
148
|
+
}
|
|
149
|
+
isTemplateStr(value) {
|
|
150
|
+
return typeof value === 'object' && typeof value.__template !== 'undefined';
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Determines if gem is used at all in this value or down the nested object. If gem is used it is required to use sys_element_mapping in addition to sys_variable_value
|
|
154
|
+
*/
|
|
155
|
+
containsGem(value) {
|
|
156
|
+
if (typeof value !== 'object') {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
// Don't recurse on entities we are not interested in their keys or children
|
|
160
|
+
if (typeof value?.asRecord !== 'undefined') {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (this.isGem(value)) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
const results = [];
|
|
167
|
+
const keys = Object.keys(value);
|
|
168
|
+
for (const key of keys) {
|
|
169
|
+
const val = value[key];
|
|
170
|
+
results.push(this.containsGem(val));
|
|
171
|
+
}
|
|
172
|
+
return results.includes(true);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
*
|
|
176
|
+
* @param value Any value
|
|
177
|
+
* @returns whether the value is a gem mapping from an output variable
|
|
178
|
+
*/
|
|
179
|
+
isGem(value) {
|
|
180
|
+
if (typeof value != 'object') {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return typeof value.__references !== 'undefined' && typeof value.__value !== 'undefined';
|
|
184
|
+
}
|
|
185
|
+
createStepRecord(props) {
|
|
186
|
+
const { stepConfig, name, description = 'A step created by fluent', tableName = '' } = props;
|
|
187
|
+
const stepRecord = (0, db_1.Record)({
|
|
188
|
+
$id: `sys_atf_step_${this.test.$id}_${this.order}`, // Id is unique because there is one sys_atf_step record per step qed 1 per order, which ensures this id is unique
|
|
189
|
+
table: 'sys_atf_step',
|
|
190
|
+
data: {
|
|
191
|
+
step_config: stepConfig,
|
|
192
|
+
display_name: name,
|
|
193
|
+
sys_name: name,
|
|
194
|
+
description: description,
|
|
195
|
+
order: this.order,
|
|
196
|
+
test: this.test,
|
|
197
|
+
active: true,
|
|
198
|
+
table: tableName,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
this.stepRecords.push(stepRecord);
|
|
202
|
+
const currentStep = getRecordId(stepRecord, this.context);
|
|
203
|
+
this._records[currentStep] = [];
|
|
204
|
+
return stepRecord;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* All records: test, step, or metadata, which are necessary for the test
|
|
208
|
+
*/
|
|
209
|
+
get records() {
|
|
210
|
+
return this._records;
|
|
211
|
+
}
|
|
212
|
+
_createGemRecords(props) {
|
|
213
|
+
const { variable, value, stepRecord, stepConfig } = props;
|
|
214
|
+
if (typeof value === 'object') {
|
|
215
|
+
throw Error('Attempted to serialize an object to a value');
|
|
216
|
+
}
|
|
217
|
+
const variableValueRecord = this._createVariableValueRecord({ variable, stepRecord, value: '' });
|
|
218
|
+
const currentStep = getRecordId(stepRecord, this.context);
|
|
219
|
+
const stepConfigId = getRecordId(stepConfig, this.context);
|
|
220
|
+
const table = `var__m_atf_input_variable_${stepConfigId}`;
|
|
221
|
+
const field = variable.data.element ? variable.data.element : '';
|
|
222
|
+
const elementMappingRecord = (0, db_1.Record)({
|
|
223
|
+
$id: `sys_element_mapping_${this.test.$id}_${this.order}_${variable.$id}`,
|
|
224
|
+
table: 'sys_element_mapping',
|
|
225
|
+
data: {
|
|
226
|
+
id: currentStep,
|
|
227
|
+
field,
|
|
228
|
+
table,
|
|
229
|
+
value,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
if (!this._records[currentStep]) {
|
|
233
|
+
this._records[currentStep] = [elementMappingRecord];
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
this._records[currentStep].push(elementMappingRecord);
|
|
237
|
+
}
|
|
238
|
+
return { sys_variable_value: variableValueRecord, element_mapping: elementMappingRecord };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Use createVariable instead unless you have good reason to use this
|
|
242
|
+
* @param props
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
_createVariableValueRecord(props) {
|
|
246
|
+
const { variable, value, stepRecord } = props;
|
|
247
|
+
if (typeof value === 'object') {
|
|
248
|
+
throw Error('Attempted to serialize an object to a value');
|
|
249
|
+
}
|
|
250
|
+
const currentStep = getRecordId(stepRecord, this.context);
|
|
251
|
+
const variableRecord = (0, db_1.Record)({
|
|
252
|
+
table: 'sys_variable_value',
|
|
253
|
+
$id: `sys_variable_value_${this.test.$id}_${this.order}_${variable.$id}`,
|
|
254
|
+
data: {
|
|
255
|
+
document: 'sys_atf_step',
|
|
256
|
+
document_key: stepRecord,
|
|
257
|
+
variable,
|
|
258
|
+
value,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
if (!this._records[currentStep]) {
|
|
262
|
+
this._records[currentStep] = [variableRecord];
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this._records[currentStep].push(variableRecord);
|
|
266
|
+
}
|
|
267
|
+
return variableRecord;
|
|
268
|
+
}
|
|
269
|
+
fieldValuesToQuery(fieldValues) {
|
|
270
|
+
// This converts records/tables in a field value set to the correct string
|
|
271
|
+
const valuesObj = this.nameValuePairProcessing(fieldValues);
|
|
272
|
+
const queries = [];
|
|
273
|
+
for (const pair of Object.entries(valuesObj)) {
|
|
274
|
+
const key = pair[0];
|
|
275
|
+
let value = pair[1];
|
|
276
|
+
if (typeof value === 'string') {
|
|
277
|
+
value = value.replaceAll('^', '^^');
|
|
278
|
+
}
|
|
279
|
+
else if (value && typeof value === 'object' && '$id' in value) {
|
|
280
|
+
value = getRecordId(value, this.context);
|
|
281
|
+
}
|
|
282
|
+
queries.push(`${key}=${value}`);
|
|
283
|
+
}
|
|
284
|
+
return queries.join('^');
|
|
285
|
+
}
|
|
286
|
+
recordListToString(recordList) {
|
|
287
|
+
if (!recordList || recordList.length == 0) {
|
|
288
|
+
return '';
|
|
289
|
+
}
|
|
290
|
+
return recordList
|
|
291
|
+
.map((entry) => {
|
|
292
|
+
return this.extractSysIdIfRecord(entry);
|
|
293
|
+
})
|
|
294
|
+
.join(',');
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Outputs a string value which is either standard_ui or the sys_id of the form view
|
|
298
|
+
*/
|
|
299
|
+
parseFormUI(formUI) {
|
|
300
|
+
if (typeof formUI === 'string') {
|
|
301
|
+
if (atf.FormUI[formUI]) {
|
|
302
|
+
return typeof atf.FormUI[formUI] === 'string'
|
|
303
|
+
? atf.FormUI[formUI]
|
|
304
|
+
: getRecordId(atf.FormUI[formUI], this.context);
|
|
305
|
+
}
|
|
306
|
+
return formUI;
|
|
307
|
+
}
|
|
308
|
+
return getRecordId(formUI, this.context);
|
|
309
|
+
}
|
|
310
|
+
extractSysIdIfRecord(value) {
|
|
311
|
+
if (isRecord(value)) {
|
|
312
|
+
return getRecordId(value, this.context);
|
|
313
|
+
}
|
|
314
|
+
if (isRole(value)) {
|
|
315
|
+
return getRoleId(value, this.context);
|
|
316
|
+
}
|
|
317
|
+
return value;
|
|
318
|
+
}
|
|
319
|
+
secondsToDuration(value) {
|
|
320
|
+
const ms = value * 1000;
|
|
321
|
+
const time = new Date();
|
|
322
|
+
time.setTime(ms);
|
|
323
|
+
const str = time.toISOString().replace('T', ' ').split('.')[0];
|
|
324
|
+
return str;
|
|
325
|
+
}
|
|
326
|
+
nameValuePairProcessing(nvp) {
|
|
327
|
+
if (typeof nvp === 'object') {
|
|
328
|
+
if ('asRecord' in nvp) {
|
|
329
|
+
return getRecordId(nvp, this.context);
|
|
330
|
+
}
|
|
331
|
+
// If Object is an object, iterate over keys and recursively determine the values
|
|
332
|
+
const objKeys = Object.keys(nvp);
|
|
333
|
+
for (const key of objKeys) {
|
|
334
|
+
nvp[key] = this.nameValuePairProcessing(nvp[key]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return nvp;
|
|
338
|
+
}
|
|
339
|
+
createVariable(props) {
|
|
340
|
+
const { variable, stepRecord, stringifier, startingValue, stepConfig } = props;
|
|
341
|
+
// Do this first becaused parseValue can modify the object in place so it may get rid of gem values down a tree
|
|
342
|
+
const containsGem = this.containsGem(startingValue);
|
|
343
|
+
const parsedValue = stringifier ? stringifier(this.parseValue(startingValue)) : this.parseValue(startingValue);
|
|
344
|
+
if (containsGem) {
|
|
345
|
+
this._createGemRecords({
|
|
346
|
+
stepConfig,
|
|
347
|
+
stepRecord,
|
|
348
|
+
value: parsedValue,
|
|
349
|
+
variable,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
this._createVariableValueRecord({
|
|
354
|
+
stepRecord,
|
|
355
|
+
variable,
|
|
356
|
+
value: parsedValue,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
// ========
|
|
361
|
+
// BELOW THIS POINT IS ALL FUNCTIONS DEFINED IN THE TEST INTERFACE WHICH MAP 1:1 WITH TESTS
|
|
362
|
+
// Define any utility functions above for easy navigation
|
|
363
|
+
// ========
|
|
364
|
+
openExistingRecord(inputs) {
|
|
365
|
+
const { table, view, recordId, formUI, selectedTabIndex } = inputs;
|
|
366
|
+
const stepConfig = tables_1.StepConfig.OpenAnExistingRecord;
|
|
367
|
+
const stepRecord = this.createStepRecord({
|
|
368
|
+
name: 'Open an Existing Record',
|
|
369
|
+
stepConfig: stepConfig,
|
|
370
|
+
description: 'Opens an existing record in this table',
|
|
371
|
+
tableName: table,
|
|
372
|
+
});
|
|
373
|
+
this.createVariable({
|
|
374
|
+
stepRecord,
|
|
375
|
+
stepConfig: stepConfig,
|
|
376
|
+
variable: tables_1.Variables.OpenExistingRecord.Table,
|
|
377
|
+
startingValue: table,
|
|
378
|
+
});
|
|
379
|
+
this.createVariable({
|
|
380
|
+
stepRecord,
|
|
381
|
+
variable: tables_1.Variables.OpenExistingRecord.FormUI,
|
|
382
|
+
stepConfig: stepConfig,
|
|
383
|
+
startingValue: formUI,
|
|
384
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
385
|
+
});
|
|
386
|
+
this.createVariable({
|
|
387
|
+
stepRecord,
|
|
388
|
+
stepConfig,
|
|
389
|
+
variable: tables_1.Variables.OpenExistingRecord.RecordPath,
|
|
390
|
+
startingValue: 'record',
|
|
391
|
+
});
|
|
392
|
+
this.createVariable({
|
|
393
|
+
stepRecord,
|
|
394
|
+
stepConfig,
|
|
395
|
+
variable: tables_1.Variables.OpenExistingRecord.RecordId,
|
|
396
|
+
startingValue: recordId,
|
|
397
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
398
|
+
});
|
|
399
|
+
this.createVariable({
|
|
400
|
+
stepRecord,
|
|
401
|
+
stepConfig,
|
|
402
|
+
variable: tables_1.Variables.OpenExistingRecord.View,
|
|
403
|
+
startingValue: view,
|
|
404
|
+
});
|
|
405
|
+
this.createVariable({
|
|
406
|
+
stepRecord,
|
|
407
|
+
stepConfig,
|
|
408
|
+
variable: tables_1.Variables.OpenExistingRecord.SelectedTabIndex,
|
|
409
|
+
startingValue: selectedTabIndex,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
openNewForm(inputs) {
|
|
413
|
+
const { table: tableName, view = '', formUI } = inputs;
|
|
414
|
+
const stepConfig = tables_1.StepConfig.OpenANewForm;
|
|
415
|
+
const stepRecord = this.createStepRecord({
|
|
416
|
+
name: 'Open a New form',
|
|
417
|
+
stepConfig: stepConfig,
|
|
418
|
+
description: `Opens a new form in this table`,
|
|
419
|
+
tableName,
|
|
420
|
+
});
|
|
421
|
+
this.createVariable({
|
|
422
|
+
stepRecord,
|
|
423
|
+
stepConfig,
|
|
424
|
+
variable: tables_1.Variables.OpenNewForm.FormUI,
|
|
425
|
+
startingValue: formUI,
|
|
426
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
427
|
+
});
|
|
428
|
+
this.createVariable({
|
|
429
|
+
stepRecord,
|
|
430
|
+
stepConfig,
|
|
431
|
+
variable: tables_1.Variables.OpenNewForm.Table,
|
|
432
|
+
startingValue: tableName,
|
|
433
|
+
});
|
|
434
|
+
this.createVariable({
|
|
435
|
+
stepRecord,
|
|
436
|
+
stepConfig,
|
|
437
|
+
variable: tables_1.Variables.OpenNewForm.View,
|
|
438
|
+
startingValue: view,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
fieldValueValidation(inputs) {
|
|
442
|
+
const { table: tableName, conditions, formUI } = inputs;
|
|
443
|
+
const stepConfig = tables_1.StepConfig.FieldValueValidation;
|
|
444
|
+
const stepRecord = this.createStepRecord({
|
|
445
|
+
name: 'Field Values Validation',
|
|
446
|
+
description: `Validates field values on the current form.`,
|
|
447
|
+
tableName,
|
|
448
|
+
stepConfig,
|
|
449
|
+
});
|
|
450
|
+
this.createVariable({
|
|
451
|
+
stepRecord,
|
|
452
|
+
stepConfig,
|
|
453
|
+
variable: tables_1.Variables.FieldValueValidation.Table,
|
|
454
|
+
startingValue: tableName,
|
|
455
|
+
});
|
|
456
|
+
this.createVariable({
|
|
457
|
+
stepRecord,
|
|
458
|
+
stepConfig,
|
|
459
|
+
variable: tables_1.Variables.FieldValueValidation.FormUI,
|
|
460
|
+
startingValue: formUI,
|
|
461
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
462
|
+
});
|
|
463
|
+
this.createVariable({
|
|
464
|
+
stepRecord,
|
|
465
|
+
stepConfig,
|
|
466
|
+
variable: tables_1.Variables.FieldValueValidation.Conditions,
|
|
467
|
+
startingValue: conditions,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
setFieldValue(inputs) {
|
|
471
|
+
const { table, fieldValues, formUI } = inputs;
|
|
472
|
+
const stepConfig = tables_1.StepConfig.SetFieldValues;
|
|
473
|
+
const stepRecord = this.createStepRecord({
|
|
474
|
+
name: 'Set Field Values',
|
|
475
|
+
description: `Set field values on a form.`,
|
|
476
|
+
stepConfig,
|
|
477
|
+
tableName: table,
|
|
478
|
+
});
|
|
479
|
+
this.createVariable({
|
|
480
|
+
stepRecord,
|
|
481
|
+
stepConfig,
|
|
482
|
+
variable: tables_1.Variables.SetFieldValues.FormUI,
|
|
483
|
+
startingValue: formUI,
|
|
484
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
485
|
+
});
|
|
486
|
+
this.createVariable({
|
|
487
|
+
stepRecord,
|
|
488
|
+
stepConfig,
|
|
489
|
+
variable: tables_1.Variables.SetFieldValues.Table,
|
|
490
|
+
startingValue: table,
|
|
491
|
+
});
|
|
492
|
+
this.createVariable({
|
|
493
|
+
stepRecord,
|
|
494
|
+
stepConfig,
|
|
495
|
+
variable: tables_1.Variables.SetFieldValues.FieldValues,
|
|
496
|
+
startingValue: fieldValues,
|
|
497
|
+
stringifier: (val) => this.fieldValuesToQuery(val),
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
submitForm(inputs) {
|
|
501
|
+
const { assertType, formUI } = inputs;
|
|
502
|
+
const stepConfig = tables_1.StepConfig.SubmitAForm;
|
|
503
|
+
const stepRecord = this.createStepRecord({
|
|
504
|
+
name: 'Submit a Form',
|
|
505
|
+
stepConfig,
|
|
506
|
+
description: 'Submits the current form.',
|
|
507
|
+
});
|
|
508
|
+
this.createVariable({
|
|
509
|
+
stepRecord,
|
|
510
|
+
stepConfig,
|
|
511
|
+
variable: tables_1.Variables.SubmitForm.FormUI,
|
|
512
|
+
startingValue: formUI,
|
|
513
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
514
|
+
});
|
|
515
|
+
this.createVariable({
|
|
516
|
+
stepRecord,
|
|
517
|
+
stepConfig,
|
|
518
|
+
variable: tables_1.Variables.SubmitForm.AssertType,
|
|
519
|
+
startingValue: assertType,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
validateOutboundEmailGeneratedByNotification(inputs) {
|
|
523
|
+
const { sourceNotification, conditions } = inputs;
|
|
524
|
+
const stepConfig = tables_1.StepConfig.ValidateOutboundEmailGeneratedByNotification;
|
|
525
|
+
const stepRecord = this.createStepRecord({
|
|
526
|
+
name: 'Validate Outbound Email Generated by Notification',
|
|
527
|
+
stepConfig,
|
|
528
|
+
description: 'Finds and verifies an outbound email generated by a notification',
|
|
529
|
+
tableName: '',
|
|
530
|
+
});
|
|
531
|
+
this.createVariable({
|
|
532
|
+
stepRecord,
|
|
533
|
+
stepConfig,
|
|
534
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByNotification.Table,
|
|
535
|
+
startingValue: 'sys_email',
|
|
536
|
+
});
|
|
537
|
+
this.createVariable({
|
|
538
|
+
stepConfig,
|
|
539
|
+
stepRecord,
|
|
540
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByNotification.SourceNotification,
|
|
541
|
+
startingValue: sourceNotification,
|
|
542
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
543
|
+
});
|
|
544
|
+
this.createVariable({
|
|
545
|
+
stepRecord,
|
|
546
|
+
stepConfig,
|
|
547
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByNotification.Conditions,
|
|
548
|
+
startingValue: conditions,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
recordUpdate(inputs) {
|
|
552
|
+
const { table, assertType, enforceSecurity, recordId, fieldValues } = inputs;
|
|
553
|
+
const assertValue = assertType;
|
|
554
|
+
const stepConfig = tables_1.StepConfig.RecordUpdate;
|
|
555
|
+
const stepRecord = this.createStepRecord({
|
|
556
|
+
name: 'Record Update',
|
|
557
|
+
stepConfig,
|
|
558
|
+
description: 'Update a record in the table.',
|
|
559
|
+
tableName: table,
|
|
560
|
+
});
|
|
561
|
+
this.createVariable({
|
|
562
|
+
stepConfig,
|
|
563
|
+
stepRecord,
|
|
564
|
+
variable: tables_1.Variables.RecordUpdate.EnforceSecurity,
|
|
565
|
+
startingValue: enforceSecurity,
|
|
566
|
+
});
|
|
567
|
+
this.createVariable({
|
|
568
|
+
stepConfig,
|
|
569
|
+
stepRecord,
|
|
570
|
+
variable: tables_1.Variables.RecordUpdate.AssertType,
|
|
571
|
+
startingValue: assertValue,
|
|
572
|
+
});
|
|
573
|
+
this.createVariable({
|
|
574
|
+
stepConfig,
|
|
575
|
+
stepRecord,
|
|
576
|
+
variable: tables_1.Variables.RecordUpdate.RecordID,
|
|
577
|
+
startingValue: recordId,
|
|
578
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
579
|
+
});
|
|
580
|
+
this.createVariable({
|
|
581
|
+
stepConfig,
|
|
582
|
+
stepRecord,
|
|
583
|
+
variable: tables_1.Variables.RecordUpdate.FieldValues,
|
|
584
|
+
startingValue: fieldValues,
|
|
585
|
+
stringifier: (val) => this.fieldValuesToQuery(val),
|
|
586
|
+
});
|
|
587
|
+
this.createVariable({
|
|
588
|
+
stepConfig,
|
|
589
|
+
stepRecord,
|
|
590
|
+
variable: tables_1.Variables.RecordUpdate.Table,
|
|
591
|
+
startingValue: table,
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
generateRandomString(inputs) {
|
|
595
|
+
const { length } = inputs;
|
|
596
|
+
const stepConfig = tables_1.StepConfig.GenerateRandomString;
|
|
597
|
+
const stepRecord = this.createStepRecord({
|
|
598
|
+
name: 'Generate Random String',
|
|
599
|
+
stepConfig,
|
|
600
|
+
description: 'Generate a random string.',
|
|
601
|
+
});
|
|
602
|
+
this.createVariable({
|
|
603
|
+
stepConfig,
|
|
604
|
+
stepRecord,
|
|
605
|
+
variable: tables_1.Variables.GenerateARandomString.Length,
|
|
606
|
+
startingValue: length,
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
uiActionVisibility(inputs) {
|
|
610
|
+
const { table, formUI, visible, notVisible } = inputs;
|
|
611
|
+
const stepConfig = tables_1.StepConfig.UIActionVisibility;
|
|
612
|
+
const stepRecord = this.createStepRecord({
|
|
613
|
+
name: 'UI Action Visibility',
|
|
614
|
+
stepConfig,
|
|
615
|
+
description: 'Checks if the listed fields are visible or not visible on the form.',
|
|
616
|
+
tableName: table,
|
|
617
|
+
});
|
|
618
|
+
this.createVariable({
|
|
619
|
+
stepConfig,
|
|
620
|
+
stepRecord,
|
|
621
|
+
variable: tables_1.Variables.UIActionVisibility.Table,
|
|
622
|
+
startingValue: table,
|
|
623
|
+
});
|
|
624
|
+
this.createVariable({
|
|
625
|
+
stepConfig,
|
|
626
|
+
stepRecord,
|
|
627
|
+
variable: tables_1.Variables.UIActionVisibility.FormUI,
|
|
628
|
+
startingValue: formUI,
|
|
629
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
630
|
+
});
|
|
631
|
+
this.createVariable({
|
|
632
|
+
stepConfig,
|
|
633
|
+
stepRecord,
|
|
634
|
+
variable: tables_1.Variables.UIActionVisibility.Visible,
|
|
635
|
+
startingValue: visible,
|
|
636
|
+
stringifier: (value) => this.recordListToString(value),
|
|
637
|
+
});
|
|
638
|
+
this.createVariable({
|
|
639
|
+
stepConfig,
|
|
640
|
+
stepRecord,
|
|
641
|
+
variable: tables_1.Variables.UIActionVisibility.NotVisible,
|
|
642
|
+
startingValue: notVisible,
|
|
643
|
+
stringifier: (value) => this.recordListToString(value),
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
validatePriceAndRecurringPrice(inputs) {
|
|
647
|
+
const { price, recurringPrice, frequency } = inputs;
|
|
648
|
+
const stepConfig = tables_1.StepConfig.ValidatePriceAndRecurringPrice;
|
|
649
|
+
const stepRecord = this.createStepRecord({
|
|
650
|
+
name: 'Validate Price and Recurring Price',
|
|
651
|
+
stepConfig,
|
|
652
|
+
description: 'Validate Price and Recurring Price of a catalog item',
|
|
653
|
+
});
|
|
654
|
+
this.createVariable({
|
|
655
|
+
stepConfig,
|
|
656
|
+
stepRecord,
|
|
657
|
+
variable: tables_1.Variables.ValidatePriceAndRecurringPrice.Price,
|
|
658
|
+
startingValue: price,
|
|
659
|
+
});
|
|
660
|
+
this.createVariable({
|
|
661
|
+
stepConfig,
|
|
662
|
+
stepRecord,
|
|
663
|
+
variable: tables_1.Variables.ValidatePriceAndRecurringPrice.RecurringPrice,
|
|
664
|
+
startingValue: recurringPrice,
|
|
665
|
+
});
|
|
666
|
+
this.createVariable({
|
|
667
|
+
stepConfig,
|
|
668
|
+
stepRecord,
|
|
669
|
+
variable: tables_1.Variables.ValidatePriceAndRecurringPrice.RecurringFrequency,
|
|
670
|
+
startingValue: frequency,
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
assertResponseJSONPayloadIsValid(inputs) {
|
|
674
|
+
inputs;
|
|
675
|
+
const stepConfig = tables_1.StepConfig.AssertResponseJSONPayloadIsValid;
|
|
676
|
+
this.createStepRecord({
|
|
677
|
+
name: 'Assert Response JSON Payload Is Valid',
|
|
678
|
+
stepConfig,
|
|
679
|
+
description: 'Assert the JSON response payload is valid',
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
clickModalButton(inputs) {
|
|
683
|
+
const { formUI, uiPage, assertType, assertTimeout, button } = inputs;
|
|
684
|
+
const assertTimeoutStr = this.secondsToDuration(assertTimeout);
|
|
685
|
+
const assertValue = assertType;
|
|
686
|
+
const stepConfig = tables_1.StepConfig.ClickModalButton;
|
|
687
|
+
const stepRecord = this.createStepRecord({
|
|
688
|
+
name: 'Click Modal Button',
|
|
689
|
+
stepConfig,
|
|
690
|
+
description: 'Click Modal step presses a button in the modal',
|
|
691
|
+
});
|
|
692
|
+
this.createVariable({
|
|
693
|
+
stepConfig,
|
|
694
|
+
stepRecord,
|
|
695
|
+
variable: tables_1.Variables.ClickModalButton.FormUI,
|
|
696
|
+
startingValue: formUI,
|
|
697
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
698
|
+
});
|
|
699
|
+
this.createVariable({
|
|
700
|
+
stepConfig,
|
|
701
|
+
stepRecord,
|
|
702
|
+
variable: tables_1.Variables.ClickModalButton.UIPage,
|
|
703
|
+
startingValue: uiPage,
|
|
704
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
705
|
+
});
|
|
706
|
+
this.createVariable({
|
|
707
|
+
stepConfig,
|
|
708
|
+
stepRecord,
|
|
709
|
+
variable: tables_1.Variables.ClickModalButton.Assert,
|
|
710
|
+
startingValue: assertValue,
|
|
711
|
+
});
|
|
712
|
+
this.createVariable({
|
|
713
|
+
stepConfig,
|
|
714
|
+
stepRecord,
|
|
715
|
+
variable: tables_1.Variables.ClickModalButton.Button,
|
|
716
|
+
startingValue: button,
|
|
717
|
+
});
|
|
718
|
+
// TODO: ModalAction/ModalVAlues is sketchy cause the user does not set them explicitly in atf so idk if these values can be different
|
|
719
|
+
this.createVariable({
|
|
720
|
+
stepConfig,
|
|
721
|
+
stepRecord,
|
|
722
|
+
variable: tables_1.Variables.ClickModalButton.ModalAction,
|
|
723
|
+
startingValue: 'confirm',
|
|
724
|
+
});
|
|
725
|
+
this.createVariable({
|
|
726
|
+
stepConfig,
|
|
727
|
+
stepRecord,
|
|
728
|
+
variable: tables_1.Variables.ClickModalButton.ModalValues,
|
|
729
|
+
startingValue: '',
|
|
730
|
+
});
|
|
731
|
+
this.createVariable({
|
|
732
|
+
stepConfig,
|
|
733
|
+
stepRecord,
|
|
734
|
+
variable: tables_1.Variables.ClickModalButton.AssertionTimeout,
|
|
735
|
+
startingValue: assertTimeoutStr,
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
addItemToShoppingCart(inputs) {
|
|
739
|
+
const { assert } = inputs;
|
|
740
|
+
const assertValue = assert;
|
|
741
|
+
const stepConfig = tables_1.StepConfig.AddItemToShoppingCart;
|
|
742
|
+
const stepRecord = this.createStepRecord({
|
|
743
|
+
name: 'Add Item to Shopping Cart',
|
|
744
|
+
stepConfig,
|
|
745
|
+
description: 'Add Catalog Item to Shopping Cart',
|
|
746
|
+
});
|
|
747
|
+
this.createVariable({
|
|
748
|
+
stepConfig,
|
|
749
|
+
stepRecord,
|
|
750
|
+
variable: tables_1.Variables.AddItemToShoppingCart.Assert,
|
|
751
|
+
startingValue: assertValue,
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
moduleVisibility(inputs) {
|
|
755
|
+
const { navigator, assertNotVisible, assertVisible, notVisibleModules, visibleModules } = inputs;
|
|
756
|
+
const navigatorValue = navigator;
|
|
757
|
+
const assertNotVisibleValue = assertNotVisible;
|
|
758
|
+
const assertVisibleValue = assertVisible[assertVisible];
|
|
759
|
+
const stepConfig = tables_1.StepConfig.ModuleVisibility;
|
|
760
|
+
const stepRecord = this.createStepRecord({
|
|
761
|
+
name: 'Module Visibility',
|
|
762
|
+
stepConfig,
|
|
763
|
+
description: 'Verifies visibility of modules in the left navigation bar',
|
|
764
|
+
});
|
|
765
|
+
this.createVariable({
|
|
766
|
+
stepConfig,
|
|
767
|
+
stepRecord,
|
|
768
|
+
variable: tables_1.Variables.ModuleVisibility.Navigator,
|
|
769
|
+
startingValue: navigatorValue,
|
|
770
|
+
});
|
|
771
|
+
this.createVariable({
|
|
772
|
+
stepConfig,
|
|
773
|
+
stepRecord,
|
|
774
|
+
variable: tables_1.Variables.ModuleVisibility.NotVisibleAssert,
|
|
775
|
+
startingValue: assertNotVisibleValue,
|
|
776
|
+
});
|
|
777
|
+
this.createVariable({
|
|
778
|
+
stepConfig,
|
|
779
|
+
stepRecord,
|
|
780
|
+
variable: tables_1.Variables.ModuleVisibility.VisibleAssert,
|
|
781
|
+
startingValue: assertVisibleValue,
|
|
782
|
+
});
|
|
783
|
+
this.createVariable({
|
|
784
|
+
stepConfig,
|
|
785
|
+
stepRecord,
|
|
786
|
+
variable: tables_1.Variables.ModuleVisibility.VisibleModules,
|
|
787
|
+
startingValue: visibleModules,
|
|
788
|
+
stringifier: (val) => this.recordListToString(val),
|
|
789
|
+
});
|
|
790
|
+
this.createVariable({
|
|
791
|
+
stepConfig,
|
|
792
|
+
stepRecord,
|
|
793
|
+
variable: tables_1.Variables.ModuleVisibility.NotVisibleModules,
|
|
794
|
+
startingValue: notVisibleModules,
|
|
795
|
+
stringifier: (val) => this.recordListToString(val),
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
impersonate(inputs) {
|
|
799
|
+
const { user } = inputs;
|
|
800
|
+
const descriptionStr = 'Impersonates a specified user in the current session for the duration of the test or until another user is impersonated.';
|
|
801
|
+
const stepConfig = tables_1.StepConfig.Impersonate;
|
|
802
|
+
const stepRecord = this.createStepRecord({
|
|
803
|
+
name: 'Impersonate',
|
|
804
|
+
stepConfig,
|
|
805
|
+
description: descriptionStr,
|
|
806
|
+
});
|
|
807
|
+
this.createVariable({
|
|
808
|
+
stepRecord,
|
|
809
|
+
stepConfig,
|
|
810
|
+
variable: tables_1.Variables.Impersonate.User,
|
|
811
|
+
startingValue: user,
|
|
812
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
openRecordProducer(inputs) {
|
|
816
|
+
const { catalogItem } = inputs;
|
|
817
|
+
const descriptionStr = 'Opens a Record Producer.';
|
|
818
|
+
const stepConfig = tables_1.StepConfig.OpenRecordProducer;
|
|
819
|
+
const stepRecord = this.createStepRecord({
|
|
820
|
+
name: 'Open Record Producer',
|
|
821
|
+
stepConfig,
|
|
822
|
+
description: descriptionStr,
|
|
823
|
+
});
|
|
824
|
+
this.createVariable({
|
|
825
|
+
stepRecord,
|
|
826
|
+
stepConfig,
|
|
827
|
+
variable: tables_1.Variables.OpenRecordProducer.CatalogItem,
|
|
828
|
+
startingValue: catalogItem,
|
|
829
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
recordValidation(inputs) {
|
|
833
|
+
const { enforceSecurity, assertType, recordId, fieldValues, table } = inputs;
|
|
834
|
+
const stepConfig = tables_1.StepConfig.RecordValidation;
|
|
835
|
+
const stepRecord = this.createStepRecord({
|
|
836
|
+
name: 'Record Validation',
|
|
837
|
+
description: 'Validate a record',
|
|
838
|
+
tableName: table,
|
|
839
|
+
stepConfig,
|
|
840
|
+
});
|
|
841
|
+
this.createVariable({
|
|
842
|
+
stepRecord,
|
|
843
|
+
stepConfig,
|
|
844
|
+
variable: tables_1.Variables.RecordValidation.Table,
|
|
845
|
+
startingValue: table,
|
|
846
|
+
});
|
|
847
|
+
this.createVariable({
|
|
848
|
+
stepRecord,
|
|
849
|
+
stepConfig,
|
|
850
|
+
variable: tables_1.Variables.RecordValidation.EnforceSecurity,
|
|
851
|
+
startingValue: enforceSecurity,
|
|
852
|
+
});
|
|
853
|
+
this.createVariable({
|
|
854
|
+
stepRecord,
|
|
855
|
+
stepConfig,
|
|
856
|
+
variable: tables_1.Variables.RecordValidation.AssertType,
|
|
857
|
+
startingValue: assertType,
|
|
858
|
+
});
|
|
859
|
+
this.createVariable({
|
|
860
|
+
stepRecord,
|
|
861
|
+
stepConfig,
|
|
862
|
+
variable: tables_1.Variables.RecordValidation.RecordId,
|
|
863
|
+
startingValue: recordId,
|
|
864
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
865
|
+
});
|
|
866
|
+
this.createVariable({
|
|
867
|
+
stepRecord,
|
|
868
|
+
stepConfig,
|
|
869
|
+
variable: tables_1.Variables.RecordValidation.FieldValues,
|
|
870
|
+
startingValue: fieldValues,
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
setCatalogItemQuantity(inputs) {
|
|
874
|
+
const { quantity } = inputs;
|
|
875
|
+
const stepConfig = tables_1.StepConfig.SetCatalogItemQuantity;
|
|
876
|
+
const descriptionStr = 'Set quantity to ' + quantity.toString();
|
|
877
|
+
const stepRecord = this.createStepRecord({
|
|
878
|
+
name: 'Set Catalog Item Quantity',
|
|
879
|
+
description: descriptionStr,
|
|
880
|
+
stepConfig,
|
|
881
|
+
});
|
|
882
|
+
this.createVariable({
|
|
883
|
+
stepConfig,
|
|
884
|
+
stepRecord,
|
|
885
|
+
variable: tables_1.Variables.SetCatalogItemQuantity.Quantity,
|
|
886
|
+
startingValue: quantity,
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
orderCatalogItem(inputs) {
|
|
890
|
+
const { assertType } = inputs;
|
|
891
|
+
const stepConfig = tables_1.StepConfig.OrderCatalogItem;
|
|
892
|
+
let descriptionStr = 'Order item and confirm that ordering is canceled in browser';
|
|
893
|
+
if (assertType === 'form_submitted_to_server') {
|
|
894
|
+
descriptionStr = 'Order item and confirm that ordering is successful';
|
|
895
|
+
}
|
|
896
|
+
const stepRecord = this.createStepRecord({
|
|
897
|
+
name: 'Order Catalog Item',
|
|
898
|
+
description: descriptionStr,
|
|
899
|
+
stepConfig,
|
|
900
|
+
});
|
|
901
|
+
this.createVariable({
|
|
902
|
+
stepConfig,
|
|
903
|
+
stepRecord,
|
|
904
|
+
variable: tables_1.Variables.OrderCatalogItem.AssertType,
|
|
905
|
+
startingValue: assertType,
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
clickDeclarativeAction(inputs) {
|
|
909
|
+
const { formUI, declarativeAction, assertType, table } = inputs;
|
|
910
|
+
const stepConfig = tables_1.StepConfig.ClickADeclarativeAction;
|
|
911
|
+
const descriptionStr = 'Click a declarative action and confirm any relevant form or page reaction';
|
|
912
|
+
const stepRecord = this.createStepRecord({
|
|
913
|
+
name: 'Click a Declarative Action',
|
|
914
|
+
description: descriptionStr,
|
|
915
|
+
tableName: table,
|
|
916
|
+
stepConfig,
|
|
917
|
+
});
|
|
918
|
+
this.createVariable({
|
|
919
|
+
stepConfig,
|
|
920
|
+
stepRecord,
|
|
921
|
+
variable: tables_1.Variables.ClickADeclarativeAction.FormUI,
|
|
922
|
+
startingValue: formUI,
|
|
923
|
+
stringifier: (str) => this.parseFormUI(str),
|
|
924
|
+
});
|
|
925
|
+
this.createVariable({
|
|
926
|
+
stepRecord,
|
|
927
|
+
stepConfig,
|
|
928
|
+
variable: tables_1.Variables.ClickADeclarativeAction.Table,
|
|
929
|
+
startingValue: table,
|
|
930
|
+
});
|
|
931
|
+
this.createVariable({
|
|
932
|
+
stepConfig,
|
|
933
|
+
stepRecord,
|
|
934
|
+
variable: tables_1.Variables.ClickADeclarativeAction.DeclarativeAction,
|
|
935
|
+
startingValue: declarativeAction,
|
|
936
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
937
|
+
});
|
|
938
|
+
this.createVariable({
|
|
939
|
+
stepConfig,
|
|
940
|
+
stepRecord,
|
|
941
|
+
variable: tables_1.Variables.ClickADeclarativeAction.AssertType,
|
|
942
|
+
startingValue: assertType,
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
assertXMLResponsePayloadElement(inputs) {
|
|
946
|
+
const { elementPath, responseOperation, elementValue } = inputs;
|
|
947
|
+
const stepConfig = tables_1.StepConfig.AssertXMLResponsePayloadElement;
|
|
948
|
+
const descriptionStr = 'Assess the XML Response payload element';
|
|
949
|
+
const stepRecord = this.createStepRecord({
|
|
950
|
+
name: 'Assert XML Response Payload Element',
|
|
951
|
+
description: descriptionStr,
|
|
952
|
+
stepConfig,
|
|
953
|
+
});
|
|
954
|
+
this.createVariable({
|
|
955
|
+
stepConfig,
|
|
956
|
+
stepRecord,
|
|
957
|
+
variable: tables_1.Variables.AssertXMLResponsePayloadElement.ElementPath,
|
|
958
|
+
startingValue: elementPath,
|
|
959
|
+
});
|
|
960
|
+
this.createVariable({
|
|
961
|
+
stepConfig,
|
|
962
|
+
stepRecord,
|
|
963
|
+
variable: tables_1.Variables.AssertXMLResponsePayloadElement.ResponseOperation,
|
|
964
|
+
startingValue: responseOperation,
|
|
965
|
+
});
|
|
966
|
+
this.createVariable({
|
|
967
|
+
stepConfig,
|
|
968
|
+
stepRecord,
|
|
969
|
+
variable: tables_1.Variables.AssertXMLResponsePayloadElement.ElementValue,
|
|
970
|
+
startingValue: elementValue,
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
responsiveDashboardVisibility(inputs) {
|
|
974
|
+
const { dashboard, assertType } = inputs;
|
|
975
|
+
const stepConfig = tables_1.StepConfig.ResponsiveDashboardVisibility;
|
|
976
|
+
const stepRecord = this.createStepRecord({
|
|
977
|
+
stepConfig,
|
|
978
|
+
name: 'Responsive Dashboard Visibility',
|
|
979
|
+
description: 'Confirm whether a responsive dashboard is visible or not',
|
|
980
|
+
});
|
|
981
|
+
this.createVariable({
|
|
982
|
+
stepConfig,
|
|
983
|
+
stepRecord,
|
|
984
|
+
variable: tables_1.Variables.ResponsiveDashboardVisibility.Dashboard,
|
|
985
|
+
startingValue: dashboard,
|
|
986
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
987
|
+
});
|
|
988
|
+
this.createVariable({
|
|
989
|
+
stepConfig,
|
|
990
|
+
stepRecord,
|
|
991
|
+
variable: tables_1.Variables.ResponsiveDashboardVisibility.AssertType,
|
|
992
|
+
startingValue: assertType,
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
generateInboundReplyEmail(inputs) {
|
|
996
|
+
const { targetRecord, subject, body, from, to, targetTable } = inputs;
|
|
997
|
+
const stepConfig = tables_1.StepConfig.GenerateInboundReplyEmail;
|
|
998
|
+
const stepRecord = this.createStepRecord({
|
|
999
|
+
stepConfig,
|
|
1000
|
+
name: 'Generate Inbound Reply Email',
|
|
1001
|
+
description: 'Generate an email with subject ' + subject,
|
|
1002
|
+
});
|
|
1003
|
+
this.createVariable({
|
|
1004
|
+
stepConfig,
|
|
1005
|
+
stepRecord,
|
|
1006
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.TargetRecord,
|
|
1007
|
+
startingValue: targetRecord,
|
|
1008
|
+
stringifier: (str) => this.extractSysIdIfRecord(str),
|
|
1009
|
+
});
|
|
1010
|
+
this.createVariable({
|
|
1011
|
+
stepConfig,
|
|
1012
|
+
stepRecord,
|
|
1013
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.TargetTable,
|
|
1014
|
+
startingValue: targetTable,
|
|
1015
|
+
});
|
|
1016
|
+
this.createVariable({
|
|
1017
|
+
stepConfig,
|
|
1018
|
+
stepRecord,
|
|
1019
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.Body,
|
|
1020
|
+
startingValue: body,
|
|
1021
|
+
});
|
|
1022
|
+
this.createVariable({
|
|
1023
|
+
stepConfig,
|
|
1024
|
+
stepRecord,
|
|
1025
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.From,
|
|
1026
|
+
startingValue: from,
|
|
1027
|
+
});
|
|
1028
|
+
this.createVariable({
|
|
1029
|
+
stepConfig,
|
|
1030
|
+
stepRecord,
|
|
1031
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.Subject,
|
|
1032
|
+
startingValue: subject,
|
|
1033
|
+
});
|
|
1034
|
+
this.createVariable({
|
|
1035
|
+
stepConfig,
|
|
1036
|
+
stepRecord,
|
|
1037
|
+
variable: tables_1.Variables.GenerateInboundReplyEmail.To,
|
|
1038
|
+
startingValue: to,
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
assertStatusCodeName(inputs) {
|
|
1042
|
+
const { responseOperation, codeName } = inputs;
|
|
1043
|
+
const stepConfig = tables_1.StepConfig.AssertStatusCodeName;
|
|
1044
|
+
const stepRecord = this.createStepRecord({
|
|
1045
|
+
stepConfig,
|
|
1046
|
+
name: 'Assert Status Code Name',
|
|
1047
|
+
description: 'Assert a response status code name ' + responseOperation + ' ' + codeName,
|
|
1048
|
+
});
|
|
1049
|
+
this.createVariable({
|
|
1050
|
+
stepConfig,
|
|
1051
|
+
stepRecord,
|
|
1052
|
+
variable: tables_1.Variables.AssertStatusCodeName.ResponseOperation,
|
|
1053
|
+
startingValue: responseOperation,
|
|
1054
|
+
});
|
|
1055
|
+
this.createVariable({
|
|
1056
|
+
stepConfig,
|
|
1057
|
+
stepRecord,
|
|
1058
|
+
variable: tables_1.Variables.AssertStatusCodeName.CodeName,
|
|
1059
|
+
startingValue: codeName,
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
clickUIAction(inputs) {
|
|
1063
|
+
const { formUI, table, actionType, declarativeAction, uiAction, assertType } = inputs;
|
|
1064
|
+
const stepConfig = tables_1.StepConfig.ClickUIAction;
|
|
1065
|
+
const stepRecord = this.createStepRecord({
|
|
1066
|
+
name: 'Click a UI Action',
|
|
1067
|
+
stepConfig: stepConfig,
|
|
1068
|
+
description: 'Clicks a UI action on the current form',
|
|
1069
|
+
tableName: table,
|
|
1070
|
+
});
|
|
1071
|
+
this.createVariable({
|
|
1072
|
+
stepRecord,
|
|
1073
|
+
stepConfig,
|
|
1074
|
+
variable: tables_1.Variables.ClickUIAction.FormUI,
|
|
1075
|
+
startingValue: formUI,
|
|
1076
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
1077
|
+
});
|
|
1078
|
+
this.createVariable({
|
|
1079
|
+
stepRecord,
|
|
1080
|
+
stepConfig,
|
|
1081
|
+
variable: tables_1.Variables.ClickUIAction.Table,
|
|
1082
|
+
startingValue: table,
|
|
1083
|
+
});
|
|
1084
|
+
this.createVariable({
|
|
1085
|
+
stepRecord,
|
|
1086
|
+
stepConfig,
|
|
1087
|
+
variable: tables_1.Variables.ClickUIAction.ActionType,
|
|
1088
|
+
startingValue: actionType,
|
|
1089
|
+
});
|
|
1090
|
+
this.createVariable({
|
|
1091
|
+
stepRecord,
|
|
1092
|
+
stepConfig,
|
|
1093
|
+
variable: tables_1.Variables.ClickUIAction.DeclarativeAction,
|
|
1094
|
+
startingValue: declarativeAction,
|
|
1095
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1096
|
+
});
|
|
1097
|
+
this.createVariable({
|
|
1098
|
+
stepRecord,
|
|
1099
|
+
stepConfig,
|
|
1100
|
+
variable: tables_1.Variables.ClickUIAction.UIAction,
|
|
1101
|
+
startingValue: uiAction,
|
|
1102
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1103
|
+
});
|
|
1104
|
+
this.createVariable({
|
|
1105
|
+
stepRecord,
|
|
1106
|
+
stepConfig,
|
|
1107
|
+
variable: tables_1.Variables.ClickUIAction.AssertType,
|
|
1108
|
+
startingValue: assertType,
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
createUser(inputs) {
|
|
1112
|
+
const { fieldValues, groups, roles, impersonate, firstName, lastName } = inputs;
|
|
1113
|
+
const tableName = 'sys_user';
|
|
1114
|
+
const stepConfig = tables_1.StepConfig.CreateAUser;
|
|
1115
|
+
const stepRecord = this.createStepRecord({
|
|
1116
|
+
name: 'Create a User',
|
|
1117
|
+
description: `Create a User`,
|
|
1118
|
+
stepConfig,
|
|
1119
|
+
tableName: tableName,
|
|
1120
|
+
});
|
|
1121
|
+
this.createVariable({
|
|
1122
|
+
stepRecord,
|
|
1123
|
+
stepConfig,
|
|
1124
|
+
variable: tables_1.Variables.CreateAUser.FieldValues,
|
|
1125
|
+
startingValue: fieldValues,
|
|
1126
|
+
stringifier: (val) => this.fieldValuesToQuery(val),
|
|
1127
|
+
});
|
|
1128
|
+
this.createVariable({
|
|
1129
|
+
stepRecord,
|
|
1130
|
+
stepConfig,
|
|
1131
|
+
variable: tables_1.Variables.CreateAUser.Groups,
|
|
1132
|
+
startingValue: groups,
|
|
1133
|
+
stringifier: (value) => {
|
|
1134
|
+
return this.recordListToString(value);
|
|
1135
|
+
},
|
|
1136
|
+
});
|
|
1137
|
+
this.createVariable({
|
|
1138
|
+
stepRecord,
|
|
1139
|
+
stepConfig,
|
|
1140
|
+
variable: tables_1.Variables.CreateAUser.Roles,
|
|
1141
|
+
startingValue: roles,
|
|
1142
|
+
stringifier: (value) => {
|
|
1143
|
+
return this.recordListToString(value);
|
|
1144
|
+
},
|
|
1145
|
+
});
|
|
1146
|
+
this.createVariable({
|
|
1147
|
+
stepRecord,
|
|
1148
|
+
stepConfig,
|
|
1149
|
+
variable: tables_1.Variables.CreateAUser.Impersonate,
|
|
1150
|
+
startingValue: impersonate,
|
|
1151
|
+
});
|
|
1152
|
+
this.createVariable({
|
|
1153
|
+
stepRecord,
|
|
1154
|
+
stepConfig,
|
|
1155
|
+
variable: tables_1.Variables.CreateAUser.FirstName,
|
|
1156
|
+
startingValue: firstName,
|
|
1157
|
+
});
|
|
1158
|
+
this.createVariable({
|
|
1159
|
+
stepRecord,
|
|
1160
|
+
stepConfig,
|
|
1161
|
+
variable: tables_1.Variables.CreateAUser.LastName,
|
|
1162
|
+
startingValue: lastName,
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
recordDelete(inputs) {
|
|
1166
|
+
const { enforceSecurity, assertType, table, recordId } = inputs;
|
|
1167
|
+
const stepConfig = tables_1.StepConfig.RecordDelete;
|
|
1168
|
+
const stepRecord = this.createStepRecord({
|
|
1169
|
+
name: 'Record Delete',
|
|
1170
|
+
stepConfig,
|
|
1171
|
+
description: 'Delete a record in the table',
|
|
1172
|
+
});
|
|
1173
|
+
this.createVariable({
|
|
1174
|
+
stepRecord,
|
|
1175
|
+
stepConfig,
|
|
1176
|
+
variable: tables_1.Variables.RecordDelete.EnforceSecurity,
|
|
1177
|
+
startingValue: enforceSecurity,
|
|
1178
|
+
});
|
|
1179
|
+
this.createVariable({
|
|
1180
|
+
stepRecord,
|
|
1181
|
+
stepConfig,
|
|
1182
|
+
variable: tables_1.Variables.RecordDelete.AssertType,
|
|
1183
|
+
startingValue: assertType,
|
|
1184
|
+
});
|
|
1185
|
+
this.createVariable({
|
|
1186
|
+
stepRecord,
|
|
1187
|
+
stepConfig,
|
|
1188
|
+
variable: tables_1.Variables.RecordDelete.Table,
|
|
1189
|
+
startingValue: table,
|
|
1190
|
+
});
|
|
1191
|
+
this.createVariable({
|
|
1192
|
+
stepRecord,
|
|
1193
|
+
stepConfig,
|
|
1194
|
+
variable: tables_1.Variables.RecordDelete.RecordId,
|
|
1195
|
+
startingValue: recordId,
|
|
1196
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
openCatalogItem(inputs) {
|
|
1200
|
+
const { catalogItem } = inputs;
|
|
1201
|
+
const stepConfig = tables_1.StepConfig.OpenACatalogItem;
|
|
1202
|
+
const stepRecord = this.createStepRecord({
|
|
1203
|
+
name: 'Open a catalog item',
|
|
1204
|
+
stepConfig,
|
|
1205
|
+
description: 'Open a catalog item',
|
|
1206
|
+
});
|
|
1207
|
+
this.createVariable({
|
|
1208
|
+
stepRecord,
|
|
1209
|
+
stepConfig,
|
|
1210
|
+
variable: tables_1.Variables.OpenACatalogItem.CatalogItem,
|
|
1211
|
+
startingValue: catalogItem,
|
|
1212
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
setVariableValue(inputs) {
|
|
1216
|
+
const { catalogItem, variableValues } = inputs;
|
|
1217
|
+
const stepConfig = tables_1.StepConfig.SetVariableValues;
|
|
1218
|
+
const stepRecord = this.createStepRecord({
|
|
1219
|
+
name: 'Set Variable Values',
|
|
1220
|
+
stepConfig,
|
|
1221
|
+
description: 'Set variable values on a Catalog Item page',
|
|
1222
|
+
});
|
|
1223
|
+
this.createVariable({
|
|
1224
|
+
stepRecord,
|
|
1225
|
+
stepConfig,
|
|
1226
|
+
variable: tables_1.Variables.SetVariableValues.Item,
|
|
1227
|
+
startingValue: catalogItem,
|
|
1228
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1229
|
+
});
|
|
1230
|
+
this.createVariable({
|
|
1231
|
+
stepRecord,
|
|
1232
|
+
stepConfig,
|
|
1233
|
+
variable: tables_1.Variables.SetVariableValues.VariableValues,
|
|
1234
|
+
startingValue: variableValues,
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
sendRestRequest(inputs) {
|
|
1238
|
+
const { basicAuthentication, method, path, queryParameters, headers, body } = inputs;
|
|
1239
|
+
const processedParams = this.nameValuePairProcessing(queryParameters);
|
|
1240
|
+
const processedHeaders = this.nameValuePairProcessing(headers);
|
|
1241
|
+
const stepConfig = tables_1.StepConfig.SendRestRequestInbound;
|
|
1242
|
+
const stepRecord = this.createStepRecord({
|
|
1243
|
+
name: 'Send REST Request - Inbound',
|
|
1244
|
+
stepConfig,
|
|
1245
|
+
description: 'Send REST Request - Inbound',
|
|
1246
|
+
});
|
|
1247
|
+
this.createVariable({
|
|
1248
|
+
stepRecord,
|
|
1249
|
+
stepConfig,
|
|
1250
|
+
variable: tables_1.Variables.SendRestRequestInbound.BasicAuthentication,
|
|
1251
|
+
startingValue: basicAuthentication,
|
|
1252
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1253
|
+
});
|
|
1254
|
+
this.createVariable({
|
|
1255
|
+
stepRecord,
|
|
1256
|
+
stepConfig,
|
|
1257
|
+
variable: tables_1.Variables.SendRestRequestInbound.Method,
|
|
1258
|
+
startingValue: method,
|
|
1259
|
+
});
|
|
1260
|
+
this.createVariable({
|
|
1261
|
+
stepRecord,
|
|
1262
|
+
stepConfig,
|
|
1263
|
+
variable: tables_1.Variables.SendRestRequestInbound.Path,
|
|
1264
|
+
startingValue: path,
|
|
1265
|
+
});
|
|
1266
|
+
this.createVariable({
|
|
1267
|
+
stepRecord,
|
|
1268
|
+
stepConfig,
|
|
1269
|
+
variable: tables_1.Variables.SendRestRequestInbound.QueryParameters,
|
|
1270
|
+
startingValue: processedParams,
|
|
1271
|
+
stringifier: (value) => JSON.stringify(value),
|
|
1272
|
+
});
|
|
1273
|
+
this.createVariable({
|
|
1274
|
+
stepRecord,
|
|
1275
|
+
stepConfig,
|
|
1276
|
+
variable: tables_1.Variables.SendRestRequestInbound.Headers,
|
|
1277
|
+
startingValue: processedHeaders,
|
|
1278
|
+
stringifier: (value) => JSON.stringify(value),
|
|
1279
|
+
});
|
|
1280
|
+
this.createVariable({
|
|
1281
|
+
stepRecord,
|
|
1282
|
+
stepConfig,
|
|
1283
|
+
variable: tables_1.Variables.SendRestRequestInbound.Body,
|
|
1284
|
+
startingValue: body,
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
assertStatusCode(inputs) {
|
|
1288
|
+
const { operation, statusCode } = inputs;
|
|
1289
|
+
const stepConfig = tables_1.StepConfig.AssertStatusCode;
|
|
1290
|
+
const stepRecord = this.createStepRecord({
|
|
1291
|
+
name: 'Assert Status Code',
|
|
1292
|
+
stepConfig,
|
|
1293
|
+
description: 'Assert the HTTP response status code is equals to a specified value',
|
|
1294
|
+
});
|
|
1295
|
+
this.createVariable({
|
|
1296
|
+
stepRecord,
|
|
1297
|
+
stepConfig,
|
|
1298
|
+
variable: tables_1.Variables.AssertStatusCode.Operation,
|
|
1299
|
+
startingValue: operation,
|
|
1300
|
+
});
|
|
1301
|
+
this.createVariable({
|
|
1302
|
+
stepRecord,
|
|
1303
|
+
stepConfig,
|
|
1304
|
+
variable: tables_1.Variables.AssertStatusCode.StatusCode,
|
|
1305
|
+
startingValue: statusCode,
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
assertResponseXMLPayloadIsWellFormed(inputs) {
|
|
1309
|
+
inputs;
|
|
1310
|
+
const stepConfig = tables_1.StepConfig.AssertResponseXMLPayloadIsWellFormed;
|
|
1311
|
+
this.createStepRecord({
|
|
1312
|
+
name: 'Assert Response XML Payload Is Well-Formed',
|
|
1313
|
+
stepConfig,
|
|
1314
|
+
description: 'Assert the XML response payload is well-formed',
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
responsiveDashboardSharing(inputs) {
|
|
1318
|
+
const { dashboard, assertType } = inputs;
|
|
1319
|
+
const descriptionStr = 'Confirm a dashboard can or cannot be shared';
|
|
1320
|
+
const stepConfig = tables_1.StepConfig.ResponsiveDashboardSharing;
|
|
1321
|
+
const stepRecord = this.createStepRecord({
|
|
1322
|
+
name: 'Responsive Dashboard Sharing',
|
|
1323
|
+
stepConfig,
|
|
1324
|
+
description: descriptionStr,
|
|
1325
|
+
});
|
|
1326
|
+
this.createVariable({
|
|
1327
|
+
stepRecord,
|
|
1328
|
+
stepConfig,
|
|
1329
|
+
variable: tables_1.Variables.ResponsiveDashboardSharing.Dashboard,
|
|
1330
|
+
startingValue: dashboard,
|
|
1331
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1332
|
+
});
|
|
1333
|
+
this.createVariable({
|
|
1334
|
+
stepRecord,
|
|
1335
|
+
stepConfig,
|
|
1336
|
+
variable: tables_1.Variables.ResponsiveDashboardSharing.AssertType,
|
|
1337
|
+
startingValue: assertType,
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
log(inputs) {
|
|
1341
|
+
const { log } = inputs;
|
|
1342
|
+
const stepConfig = tables_1.StepConfig.Log;
|
|
1343
|
+
const stepRecord = this.createStepRecord({
|
|
1344
|
+
name: 'Log',
|
|
1345
|
+
stepConfig,
|
|
1346
|
+
description: 'Log an output',
|
|
1347
|
+
});
|
|
1348
|
+
this.createVariable({
|
|
1349
|
+
stepRecord,
|
|
1350
|
+
stepConfig,
|
|
1351
|
+
variable: tables_1.Variables.Log.Log,
|
|
1352
|
+
startingValue: log,
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
declarativeActionVisibility(inputs) {
|
|
1356
|
+
const { formUI, table, visible, notVisible } = inputs;
|
|
1357
|
+
const stepConfig = tables_1.StepConfig.DeclarativeActionVisibility;
|
|
1358
|
+
const stepRecord = this.createStepRecord({
|
|
1359
|
+
name: 'Declarative Action Visibility',
|
|
1360
|
+
stepConfig,
|
|
1361
|
+
description: 'Validate the visible, not visible fields of the form',
|
|
1362
|
+
});
|
|
1363
|
+
this.createVariable({
|
|
1364
|
+
stepRecord,
|
|
1365
|
+
stepConfig,
|
|
1366
|
+
variable: tables_1.Variables.DeclarativeActionVisibility.FormUI,
|
|
1367
|
+
startingValue: formUI,
|
|
1368
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
1369
|
+
});
|
|
1370
|
+
this.createVariable({
|
|
1371
|
+
stepRecord,
|
|
1372
|
+
stepConfig,
|
|
1373
|
+
variable: tables_1.Variables.DeclarativeActionVisibility.Table,
|
|
1374
|
+
startingValue: table,
|
|
1375
|
+
});
|
|
1376
|
+
this.createVariable({
|
|
1377
|
+
stepRecord,
|
|
1378
|
+
stepConfig,
|
|
1379
|
+
variable: tables_1.Variables.DeclarativeActionVisibility.Visible,
|
|
1380
|
+
startingValue: visible,
|
|
1381
|
+
stringifier: (value) => {
|
|
1382
|
+
return this.recordListToString(value);
|
|
1383
|
+
},
|
|
1384
|
+
});
|
|
1385
|
+
this.createVariable({
|
|
1386
|
+
stepRecord,
|
|
1387
|
+
stepConfig,
|
|
1388
|
+
variable: tables_1.Variables.DeclarativeActionVisibility.NotVisible,
|
|
1389
|
+
startingValue: notVisible,
|
|
1390
|
+
stringifier: (value) => {
|
|
1391
|
+
return this.recordListToString(value);
|
|
1392
|
+
},
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
navigateToModule(inputs) {
|
|
1396
|
+
const { module } = inputs;
|
|
1397
|
+
const stepConfig = tables_1.StepConfig.NavigateToModule;
|
|
1398
|
+
const stepRecord = this.createStepRecord({
|
|
1399
|
+
name: 'Navigate to Module',
|
|
1400
|
+
stepConfig,
|
|
1401
|
+
description: 'Navigates to a module, as if a user had clicked on it',
|
|
1402
|
+
});
|
|
1403
|
+
this.createVariable({
|
|
1404
|
+
stepConfig,
|
|
1405
|
+
stepRecord,
|
|
1406
|
+
variable: tables_1.Variables.NavigateToModule.Module,
|
|
1407
|
+
startingValue: module,
|
|
1408
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
applicationMenuVisibility(inputs) {
|
|
1412
|
+
const { navigator, visible, assertNotVisible, assertVisible, notVisible } = inputs;
|
|
1413
|
+
const stepConfig = tables_1.StepConfig.ApplicationMenuVisibility;
|
|
1414
|
+
const stepRecord = this.createStepRecord({
|
|
1415
|
+
name: 'Application Menu Visibility',
|
|
1416
|
+
stepConfig,
|
|
1417
|
+
description: 'Verifies visibility of application menus in the left navigation bar',
|
|
1418
|
+
});
|
|
1419
|
+
this.createVariable({
|
|
1420
|
+
stepConfig,
|
|
1421
|
+
stepRecord,
|
|
1422
|
+
variable: tables_1.Variables.ApplicationMenuVisibility.Navigator,
|
|
1423
|
+
startingValue: navigator,
|
|
1424
|
+
});
|
|
1425
|
+
this.createVariable({
|
|
1426
|
+
stepConfig,
|
|
1427
|
+
stepRecord,
|
|
1428
|
+
variable: tables_1.Variables.ApplicationMenuVisibility.VisibileAssert,
|
|
1429
|
+
startingValue: assertVisible,
|
|
1430
|
+
});
|
|
1431
|
+
this.createVariable({
|
|
1432
|
+
stepConfig,
|
|
1433
|
+
stepRecord,
|
|
1434
|
+
variable: tables_1.Variables.ApplicationMenuVisibility.NotVisibleAssert,
|
|
1435
|
+
startingValue: assertNotVisible,
|
|
1436
|
+
});
|
|
1437
|
+
this.createVariable({
|
|
1438
|
+
stepConfig,
|
|
1439
|
+
stepRecord,
|
|
1440
|
+
variable: tables_1.Variables.ApplicationMenuVisibility.VisibleApplications,
|
|
1441
|
+
startingValue: visible,
|
|
1442
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1443
|
+
});
|
|
1444
|
+
this.createVariable({
|
|
1445
|
+
stepConfig,
|
|
1446
|
+
stepRecord,
|
|
1447
|
+
variable: tables_1.Variables.ApplicationMenuVisibility.NotVisibleApplications,
|
|
1448
|
+
startingValue: notVisible,
|
|
1449
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
checkoutShoppingCart(inputs) {
|
|
1453
|
+
const { assert, requestedFor, deliveryAddress, specialInstructions } = inputs;
|
|
1454
|
+
const stepConfig = tables_1.StepConfig.CheckoutShoppingCart;
|
|
1455
|
+
const stepRecord = this.createStepRecord({
|
|
1456
|
+
name: 'Checkout Shopping Cart',
|
|
1457
|
+
stepConfig,
|
|
1458
|
+
description: 'Checkout Shopping Cart',
|
|
1459
|
+
});
|
|
1460
|
+
this.createVariable({
|
|
1461
|
+
stepConfig,
|
|
1462
|
+
stepRecord,
|
|
1463
|
+
variable: tables_1.Variables.CheckoutShoppingCart.Assert,
|
|
1464
|
+
startingValue: assert,
|
|
1465
|
+
});
|
|
1466
|
+
this.createVariable({
|
|
1467
|
+
stepConfig,
|
|
1468
|
+
stepRecord,
|
|
1469
|
+
variable: tables_1.Variables.CheckoutShoppingCart.DeliveryAddress,
|
|
1470
|
+
startingValue: deliveryAddress,
|
|
1471
|
+
});
|
|
1472
|
+
this.createVariable({
|
|
1473
|
+
stepConfig,
|
|
1474
|
+
stepRecord,
|
|
1475
|
+
variable: tables_1.Variables.CheckoutShoppingCart.Instructions,
|
|
1476
|
+
startingValue: specialInstructions,
|
|
1477
|
+
});
|
|
1478
|
+
this.createVariable({
|
|
1479
|
+
stepConfig,
|
|
1480
|
+
stepRecord,
|
|
1481
|
+
variable: tables_1.Variables.CheckoutShoppingCart.Requested,
|
|
1482
|
+
startingValue: requestedFor,
|
|
1483
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
submitRecordProducer(inputs) {
|
|
1487
|
+
const { assert } = inputs;
|
|
1488
|
+
const stepConfig = tables_1.StepConfig.SubmitRecordProducer;
|
|
1489
|
+
const stepRecord = this.createStepRecord({
|
|
1490
|
+
name: 'Submit Record Producer',
|
|
1491
|
+
stepConfig,
|
|
1492
|
+
description: 'Submit a Record Producer',
|
|
1493
|
+
});
|
|
1494
|
+
this.createVariable({
|
|
1495
|
+
stepConfig,
|
|
1496
|
+
stepRecord,
|
|
1497
|
+
variable: tables_1.Variables.SubmitRecordProducer.Assert,
|
|
1498
|
+
startingValue: assert,
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
openRecordProducer_SP(inputs) {
|
|
1502
|
+
const { portal, page, recordProducer, queryParameters } = inputs;
|
|
1503
|
+
const processedParams = this.nameValuePairProcessing(queryParameters);
|
|
1504
|
+
const stepConfig = tables_1.StepConfig.OpenRecordProducer_SP;
|
|
1505
|
+
const stepRecord = this.createStepRecord({
|
|
1506
|
+
name: 'Open a Record Producer (SP)',
|
|
1507
|
+
stepConfig,
|
|
1508
|
+
description: 'Open a Record Producer (SP)',
|
|
1509
|
+
});
|
|
1510
|
+
this.createVariable({
|
|
1511
|
+
stepConfig,
|
|
1512
|
+
stepRecord,
|
|
1513
|
+
variable: tables_1.Variables.OpenRecordProducer_SP.Page,
|
|
1514
|
+
startingValue: page,
|
|
1515
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1516
|
+
});
|
|
1517
|
+
this.createVariable({
|
|
1518
|
+
stepConfig,
|
|
1519
|
+
stepRecord,
|
|
1520
|
+
variable: tables_1.Variables.OpenRecordProducer_SP.Portal,
|
|
1521
|
+
startingValue: portal,
|
|
1522
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1523
|
+
});
|
|
1524
|
+
this.createVariable({
|
|
1525
|
+
stepConfig,
|
|
1526
|
+
stepRecord,
|
|
1527
|
+
variable: tables_1.Variables.OpenRecordProducer_SP.RecordProducer,
|
|
1528
|
+
startingValue: recordProducer,
|
|
1529
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1530
|
+
});
|
|
1531
|
+
this.createVariable({
|
|
1532
|
+
stepConfig,
|
|
1533
|
+
stepRecord,
|
|
1534
|
+
variable: tables_1.Variables.OpenRecordProducer_SP.QueryParam,
|
|
1535
|
+
startingValue: processedParams,
|
|
1536
|
+
stringifier: JSON.stringify,
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
openOrderGuide_SP(inputs) {
|
|
1540
|
+
const { portal, page, orderGuide, queryParameters } = inputs;
|
|
1541
|
+
const queryParametersProcessed = this.nameValuePairProcessing(queryParameters);
|
|
1542
|
+
const stepConfig = tables_1.StepConfig.OpenOrderGuide_SP;
|
|
1543
|
+
const stepRecord = this.createStepRecord({
|
|
1544
|
+
name: 'Open an Order Guide (SP)',
|
|
1545
|
+
stepConfig,
|
|
1546
|
+
description: 'Open an Order Guide (SP)',
|
|
1547
|
+
});
|
|
1548
|
+
this.createVariable({
|
|
1549
|
+
stepConfig,
|
|
1550
|
+
stepRecord,
|
|
1551
|
+
variable: tables_1.Variables.OpenOrderGuide_SP.Page,
|
|
1552
|
+
startingValue: page,
|
|
1553
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1554
|
+
});
|
|
1555
|
+
this.createVariable({
|
|
1556
|
+
stepConfig,
|
|
1557
|
+
stepRecord,
|
|
1558
|
+
variable: tables_1.Variables.OpenOrderGuide_SP.Portal,
|
|
1559
|
+
startingValue: portal,
|
|
1560
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1561
|
+
});
|
|
1562
|
+
this.createVariable({
|
|
1563
|
+
stepConfig,
|
|
1564
|
+
stepRecord,
|
|
1565
|
+
variable: tables_1.Variables.OpenOrderGuide_SP.OrderGuide,
|
|
1566
|
+
startingValue: orderGuide,
|
|
1567
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1568
|
+
});
|
|
1569
|
+
this.createVariable({
|
|
1570
|
+
stepConfig,
|
|
1571
|
+
stepRecord,
|
|
1572
|
+
variable: tables_1.Variables.OpenOrderGuide_SP.QueryParam,
|
|
1573
|
+
startingValue: queryParametersProcessed,
|
|
1574
|
+
stringifier: JSON.stringify,
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
openForm_SP(inputs) {
|
|
1578
|
+
const { portal, page, paramID, view, queryParameters, table } = inputs;
|
|
1579
|
+
const queryParametersProcessed = this.nameValuePairProcessing(queryParameters);
|
|
1580
|
+
const stepConfig = tables_1.StepConfig.OpenAForm_SP;
|
|
1581
|
+
const stepRecord = this.createStepRecord({
|
|
1582
|
+
name: 'Open a Form (SP)',
|
|
1583
|
+
stepConfig,
|
|
1584
|
+
description: 'Open a Form (SP)',
|
|
1585
|
+
tableName: table,
|
|
1586
|
+
});
|
|
1587
|
+
this.createVariable({
|
|
1588
|
+
stepConfig,
|
|
1589
|
+
stepRecord,
|
|
1590
|
+
variable: tables_1.Variables.OpenAForm_SP.Portal,
|
|
1591
|
+
startingValue: portal,
|
|
1592
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1593
|
+
});
|
|
1594
|
+
this.createVariable({
|
|
1595
|
+
stepConfig,
|
|
1596
|
+
stepRecord,
|
|
1597
|
+
variable: tables_1.Variables.OpenAForm_SP.Page,
|
|
1598
|
+
startingValue: page,
|
|
1599
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1600
|
+
});
|
|
1601
|
+
this.createVariable({
|
|
1602
|
+
stepConfig,
|
|
1603
|
+
stepRecord,
|
|
1604
|
+
variable: tables_1.Variables.OpenAForm_SP.ParamID,
|
|
1605
|
+
startingValue: paramID,
|
|
1606
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1607
|
+
});
|
|
1608
|
+
this.createVariable({
|
|
1609
|
+
stepConfig,
|
|
1610
|
+
stepRecord,
|
|
1611
|
+
variable: tables_1.Variables.OpenAForm_SP.Table,
|
|
1612
|
+
startingValue: table,
|
|
1613
|
+
});
|
|
1614
|
+
this.createVariable({
|
|
1615
|
+
stepConfig,
|
|
1616
|
+
stepRecord,
|
|
1617
|
+
variable: tables_1.Variables.OpenAForm_SP.View,
|
|
1618
|
+
startingValue: view,
|
|
1619
|
+
});
|
|
1620
|
+
this.createVariable({
|
|
1621
|
+
stepConfig,
|
|
1622
|
+
stepRecord,
|
|
1623
|
+
variable: tables_1.Variables.OpenAForm_SP.QueryParam,
|
|
1624
|
+
startingValue: queryParametersProcessed,
|
|
1625
|
+
stringifier: JSON.stringify,
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
openCatalogItem_SP(inputs) {
|
|
1629
|
+
const { portal, page, catItem, queryParameters } = inputs;
|
|
1630
|
+
const queryParametersProcessed = this.nameValuePairProcessing(queryParameters);
|
|
1631
|
+
const stepConfig = tables_1.StepConfig.OpenCatalogItem_SP;
|
|
1632
|
+
const stepRecord = this.createStepRecord({
|
|
1633
|
+
name: 'Open a Catalog Item (SP)',
|
|
1634
|
+
stepConfig,
|
|
1635
|
+
description: 'Open a Catalog Item (SP)',
|
|
1636
|
+
});
|
|
1637
|
+
this.createVariable({
|
|
1638
|
+
stepConfig,
|
|
1639
|
+
stepRecord,
|
|
1640
|
+
variable: tables_1.Variables.OpenCatalogItem_SP.Portal,
|
|
1641
|
+
startingValue: portal,
|
|
1642
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1643
|
+
});
|
|
1644
|
+
this.createVariable({
|
|
1645
|
+
stepConfig,
|
|
1646
|
+
stepRecord,
|
|
1647
|
+
variable: tables_1.Variables.OpenCatalogItem_SP.Page,
|
|
1648
|
+
startingValue: page,
|
|
1649
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1650
|
+
});
|
|
1651
|
+
this.createVariable({
|
|
1652
|
+
stepConfig,
|
|
1653
|
+
stepRecord,
|
|
1654
|
+
variable: tables_1.Variables.OpenCatalogItem_SP.CatalogItem,
|
|
1655
|
+
startingValue: catItem,
|
|
1656
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1657
|
+
});
|
|
1658
|
+
this.createVariable({
|
|
1659
|
+
stepConfig,
|
|
1660
|
+
stepRecord,
|
|
1661
|
+
variable: tables_1.Variables.OpenCatalogItem_SP.QueryParam,
|
|
1662
|
+
startingValue: queryParametersProcessed,
|
|
1663
|
+
stringifier: JSON.stringify,
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
saveCurrentRowOfMultiRowVariableSet_SP(inputs) {
|
|
1667
|
+
const { assert } = inputs;
|
|
1668
|
+
const stepConfig = tables_1.StepConfig.SaveCurrentRowOfMultiRowVariableSet_SP;
|
|
1669
|
+
const stepRecord = this.createStepRecord({
|
|
1670
|
+
name: 'Save current row of multi-row variable set (SP)',
|
|
1671
|
+
stepConfig,
|
|
1672
|
+
description: 'Save current row of multi-row variable set (SP)',
|
|
1673
|
+
});
|
|
1674
|
+
this.createVariable({
|
|
1675
|
+
stepConfig,
|
|
1676
|
+
stepRecord,
|
|
1677
|
+
variable: tables_1.Variables.SaveCurrentRowOfMultiRowVariableSet_SP.Assert,
|
|
1678
|
+
startingValue: assert,
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
addRowToMultiRowVariableSet_SP(inputs) {
|
|
1682
|
+
const { catItem, variableSet } = inputs;
|
|
1683
|
+
const stepConfig = tables_1.StepConfig.AddRowToMultiRowVariableSet_SP;
|
|
1684
|
+
const stepRecord = this.createStepRecord({
|
|
1685
|
+
name: 'Add row to multi-row variable set (SP)',
|
|
1686
|
+
stepConfig,
|
|
1687
|
+
description: 'Add row to multi-row variable set (SP)',
|
|
1688
|
+
});
|
|
1689
|
+
this.createVariable({
|
|
1690
|
+
stepConfig,
|
|
1691
|
+
stepRecord,
|
|
1692
|
+
variable: tables_1.Variables.AddRowToMultiRowVariableSet_SP.CatalogItem,
|
|
1693
|
+
startingValue: catItem,
|
|
1694
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1695
|
+
});
|
|
1696
|
+
this.createVariable({
|
|
1697
|
+
stepConfig,
|
|
1698
|
+
stepRecord,
|
|
1699
|
+
variable: tables_1.Variables.AddRowToMultiRowVariableSet_SP.VariableSet,
|
|
1700
|
+
startingValue: variableSet,
|
|
1701
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
fieldStateValidation(inputs) {
|
|
1705
|
+
const { formUI, visible, notMandatory, notReadOnly, notVisible, readOnly, mandatory, table } = inputs;
|
|
1706
|
+
const stepConfig = tables_1.StepConfig.FieldStateValidation;
|
|
1707
|
+
const stepRecord = this.createStepRecord({
|
|
1708
|
+
name: 'Field State Validation',
|
|
1709
|
+
stepConfig,
|
|
1710
|
+
description: "Assert that fields are or aren't: mandatory, read only, and visible on the form.",
|
|
1711
|
+
});
|
|
1712
|
+
this.createVariable({
|
|
1713
|
+
stepConfig,
|
|
1714
|
+
stepRecord,
|
|
1715
|
+
variable: tables_1.Variables.FieldStateValidation.Table,
|
|
1716
|
+
startingValue: table,
|
|
1717
|
+
});
|
|
1718
|
+
this.createVariable({
|
|
1719
|
+
stepConfig,
|
|
1720
|
+
stepRecord,
|
|
1721
|
+
variable: tables_1.Variables.FieldStateValidation.FormUI,
|
|
1722
|
+
startingValue: formUI,
|
|
1723
|
+
stringifier: (val) => this.parseFormUI(val),
|
|
1724
|
+
});
|
|
1725
|
+
this.createVariable({
|
|
1726
|
+
stepConfig,
|
|
1727
|
+
stepRecord,
|
|
1728
|
+
variable: tables_1.Variables.FieldStateValidation.Mandatory,
|
|
1729
|
+
startingValue: mandatory,
|
|
1730
|
+
stringifier: (val) => this.recordListToString(val), // Since it is a list of strings we can re-use this recordListToString
|
|
1731
|
+
});
|
|
1732
|
+
this.createVariable({
|
|
1733
|
+
stepConfig,
|
|
1734
|
+
stepRecord,
|
|
1735
|
+
variable: tables_1.Variables.FieldStateValidation.NotMandatory,
|
|
1736
|
+
startingValue: notMandatory,
|
|
1737
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1738
|
+
});
|
|
1739
|
+
this.createVariable({
|
|
1740
|
+
stepConfig,
|
|
1741
|
+
stepRecord,
|
|
1742
|
+
variable: tables_1.Variables.FieldStateValidation.Visible,
|
|
1743
|
+
startingValue: visible,
|
|
1744
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1745
|
+
});
|
|
1746
|
+
this.createVariable({
|
|
1747
|
+
stepConfig,
|
|
1748
|
+
stepRecord,
|
|
1749
|
+
variable: tables_1.Variables.FieldStateValidation.NotVisible,
|
|
1750
|
+
startingValue: notVisible,
|
|
1751
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1752
|
+
});
|
|
1753
|
+
this.createVariable({
|
|
1754
|
+
stepConfig,
|
|
1755
|
+
stepRecord,
|
|
1756
|
+
variable: tables_1.Variables.FieldStateValidation.ReadOnly,
|
|
1757
|
+
startingValue: readOnly,
|
|
1758
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1759
|
+
});
|
|
1760
|
+
this.createVariable({
|
|
1761
|
+
stepConfig,
|
|
1762
|
+
stepRecord,
|
|
1763
|
+
variable: tables_1.Variables.FieldStateValidation.NotReadOnly,
|
|
1764
|
+
startingValue: notReadOnly,
|
|
1765
|
+
stringifier: (val) => this.recordListToString(val),
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
validateOutboundEmailGeneratedByFlow(inputs) {
|
|
1769
|
+
const { sourceFlow, conditions } = inputs;
|
|
1770
|
+
const stepConfig = tables_1.StepConfig.ValidateOutboundEmailGeneratedByFlow;
|
|
1771
|
+
const stepRecord = this.createStepRecord({
|
|
1772
|
+
name: 'Validate Outbound Email Generated by Flow',
|
|
1773
|
+
stepConfig,
|
|
1774
|
+
description: 'Finds and verifies an outbound email.',
|
|
1775
|
+
tableName: '',
|
|
1776
|
+
});
|
|
1777
|
+
this.createVariable({
|
|
1778
|
+
stepRecord,
|
|
1779
|
+
stepConfig,
|
|
1780
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByFlow.Table,
|
|
1781
|
+
startingValue: 'sys_email',
|
|
1782
|
+
});
|
|
1783
|
+
this.createVariable({
|
|
1784
|
+
stepRecord,
|
|
1785
|
+
stepConfig,
|
|
1786
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByFlow.SourceFlow,
|
|
1787
|
+
startingValue: sourceFlow,
|
|
1788
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1789
|
+
});
|
|
1790
|
+
this.createVariable({
|
|
1791
|
+
stepRecord,
|
|
1792
|
+
stepConfig,
|
|
1793
|
+
variable: tables_1.Variables.ValidateOutboundEmailGeneratedByFlow.Conditions,
|
|
1794
|
+
startingValue: conditions,
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
reportVisibility(inputs) {
|
|
1798
|
+
const { report, assertType } = inputs;
|
|
1799
|
+
const stepConfig = tables_1.StepConfig.ReportVisibility;
|
|
1800
|
+
const stepRecord = this.createStepRecord({
|
|
1801
|
+
name: 'Report Visibility',
|
|
1802
|
+
stepConfig,
|
|
1803
|
+
description: 'Assert a report can or cannot be viewed.',
|
|
1804
|
+
tableName: '',
|
|
1805
|
+
});
|
|
1806
|
+
this.createVariable({
|
|
1807
|
+
stepRecord,
|
|
1808
|
+
stepConfig,
|
|
1809
|
+
variable: tables_1.Variables.ReportVisibility.Report,
|
|
1810
|
+
startingValue: report,
|
|
1811
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1812
|
+
});
|
|
1813
|
+
this.createVariable({
|
|
1814
|
+
stepRecord,
|
|
1815
|
+
stepConfig,
|
|
1816
|
+
variable: tables_1.Variables.ReportVisibility.AssertType,
|
|
1817
|
+
startingValue: assertType,
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
openServicePortalPage(inputs) {
|
|
1821
|
+
const { portal, page, queryParams } = inputs;
|
|
1822
|
+
const stepConfig = tables_1.StepConfig.OpenServicePortalPage;
|
|
1823
|
+
const processedParams = this.nameValuePairProcessing(queryParams);
|
|
1824
|
+
const stepRecord = this.createStepRecord({
|
|
1825
|
+
name: 'Open Service Portal Page',
|
|
1826
|
+
stepConfig,
|
|
1827
|
+
description: 'Open a page in Service Portal',
|
|
1828
|
+
tableName: '',
|
|
1829
|
+
});
|
|
1830
|
+
this.createVariable({
|
|
1831
|
+
stepRecord,
|
|
1832
|
+
stepConfig,
|
|
1833
|
+
variable: tables_1.Variables.OpenServicePortalPage.Portal,
|
|
1834
|
+
startingValue: portal,
|
|
1835
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1836
|
+
});
|
|
1837
|
+
this.createVariable({
|
|
1838
|
+
stepRecord,
|
|
1839
|
+
stepConfig,
|
|
1840
|
+
variable: tables_1.Variables.OpenServicePortalPage.Page,
|
|
1841
|
+
startingValue: page,
|
|
1842
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1843
|
+
});
|
|
1844
|
+
this.createVariable({
|
|
1845
|
+
stepRecord,
|
|
1846
|
+
stepConfig,
|
|
1847
|
+
variable: tables_1.Variables.OpenServicePortalPage.QueryParams,
|
|
1848
|
+
startingValue: processedParams,
|
|
1849
|
+
stringifier: JSON.stringify,
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
recordQuery(inputs) {
|
|
1853
|
+
const { enforceSecurity, assertType, table, fieldValues } = inputs;
|
|
1854
|
+
const stepConfig = tables_1.StepConfig.RecordQuery;
|
|
1855
|
+
const stepRecord = this.createStepRecord({
|
|
1856
|
+
name: 'Record Query',
|
|
1857
|
+
stepConfig,
|
|
1858
|
+
description: 'Select a record and validate field values.',
|
|
1859
|
+
tableName: '',
|
|
1860
|
+
});
|
|
1861
|
+
this.createVariable({
|
|
1862
|
+
stepRecord,
|
|
1863
|
+
stepConfig,
|
|
1864
|
+
variable: tables_1.Variables.RecordQuery.EnforceSecurity,
|
|
1865
|
+
startingValue: enforceSecurity,
|
|
1866
|
+
});
|
|
1867
|
+
this.createVariable({
|
|
1868
|
+
stepRecord,
|
|
1869
|
+
stepConfig,
|
|
1870
|
+
variable: tables_1.Variables.RecordQuery.AssertType,
|
|
1871
|
+
startingValue: assertType,
|
|
1872
|
+
});
|
|
1873
|
+
this.createVariable({
|
|
1874
|
+
stepRecord,
|
|
1875
|
+
stepConfig,
|
|
1876
|
+
variable: tables_1.Variables.RecordQuery.Table,
|
|
1877
|
+
startingValue: table,
|
|
1878
|
+
});
|
|
1879
|
+
this.createVariable({
|
|
1880
|
+
stepRecord,
|
|
1881
|
+
stepConfig,
|
|
1882
|
+
variable: tables_1.Variables.RecordQuery.FieldValues,
|
|
1883
|
+
startingValue: fieldValues,
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
generateInboundEmail(inputs) {
|
|
1887
|
+
const { from, to, subject, body } = inputs;
|
|
1888
|
+
const stepConfig = tables_1.StepConfig.GenerateInboundEmail;
|
|
1889
|
+
const stepRecord = this.createStepRecord({
|
|
1890
|
+
name: 'Generate Inbound Email',
|
|
1891
|
+
stepConfig,
|
|
1892
|
+
description: 'Generate an inbound email.',
|
|
1893
|
+
tableName: '',
|
|
1894
|
+
});
|
|
1895
|
+
this.createVariable({
|
|
1896
|
+
stepRecord,
|
|
1897
|
+
stepConfig,
|
|
1898
|
+
variable: tables_1.Variables.GenerateInboundEmail.From,
|
|
1899
|
+
startingValue: from,
|
|
1900
|
+
});
|
|
1901
|
+
this.createVariable({
|
|
1902
|
+
stepRecord,
|
|
1903
|
+
stepConfig,
|
|
1904
|
+
variable: tables_1.Variables.GenerateInboundEmail.To,
|
|
1905
|
+
startingValue: to,
|
|
1906
|
+
});
|
|
1907
|
+
this.createVariable({
|
|
1908
|
+
stepRecord,
|
|
1909
|
+
stepConfig,
|
|
1910
|
+
variable: tables_1.Variables.GenerateInboundEmail.Subject,
|
|
1911
|
+
startingValue: subject,
|
|
1912
|
+
});
|
|
1913
|
+
this.createVariable({
|
|
1914
|
+
stepRecord,
|
|
1915
|
+
stepConfig,
|
|
1916
|
+
variable: tables_1.Variables.GenerateInboundEmail.Body,
|
|
1917
|
+
startingValue: body,
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
validateVariableValue(inputs) {
|
|
1921
|
+
const { catalogItem, catalogConditions } = inputs;
|
|
1922
|
+
const stepConfig = tables_1.StepConfig.ValidateVariableValues;
|
|
1923
|
+
const stepRecord = this.createStepRecord({
|
|
1924
|
+
name: 'Validate Variable Values',
|
|
1925
|
+
stepConfig,
|
|
1926
|
+
description: 'Validates Variable values on the Catalog Item.',
|
|
1927
|
+
tableName: '',
|
|
1928
|
+
});
|
|
1929
|
+
this.createVariable({
|
|
1930
|
+
stepRecord,
|
|
1931
|
+
stepConfig,
|
|
1932
|
+
variable: tables_1.Variables.ValidateVariableValues.CatalogItem,
|
|
1933
|
+
startingValue: catalogItem,
|
|
1934
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
1935
|
+
});
|
|
1936
|
+
this.createVariable({
|
|
1937
|
+
stepRecord,
|
|
1938
|
+
stepConfig,
|
|
1939
|
+
variable: tables_1.Variables.ValidateVariableValues.CatalogConditions,
|
|
1940
|
+
startingValue: catalogConditions,
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
assertResponseTime(inputs) {
|
|
1944
|
+
const { responseOperation, responseTime } = inputs;
|
|
1945
|
+
const stepConfig = tables_1.StepConfig.AssertResponseTime;
|
|
1946
|
+
const stepRecord = this.createStepRecord({
|
|
1947
|
+
name: 'Assert Response Time',
|
|
1948
|
+
stepConfig,
|
|
1949
|
+
description: 'Assert the HTTP response time is less than or greater than a specified value',
|
|
1950
|
+
tableName: '',
|
|
1951
|
+
});
|
|
1952
|
+
this.createVariable({
|
|
1953
|
+
stepRecord,
|
|
1954
|
+
stepConfig,
|
|
1955
|
+
variable: tables_1.Variables.AssertResponseTime.ResponseOperation,
|
|
1956
|
+
startingValue: responseOperation,
|
|
1957
|
+
});
|
|
1958
|
+
this.createVariable({
|
|
1959
|
+
stepRecord,
|
|
1960
|
+
stepConfig,
|
|
1961
|
+
variable: tables_1.Variables.AssertResponseTime.ResponseTime,
|
|
1962
|
+
startingValue: responseTime,
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
assertJsonResponsePayloadElement(inputs) {
|
|
1966
|
+
const { elementName, operation, elementValue } = inputs;
|
|
1967
|
+
const stepConfig = tables_1.StepConfig.AssertJsonResponsePayloadElement;
|
|
1968
|
+
const stepRecord = this.createStepRecord({
|
|
1969
|
+
name: 'Assert JSON Response Payload Element',
|
|
1970
|
+
stepConfig,
|
|
1971
|
+
description: 'Assert the JSON response payload element exists, or the element value is equals to or contains a specified value',
|
|
1972
|
+
tableName: '',
|
|
1973
|
+
});
|
|
1974
|
+
this.createVariable({
|
|
1975
|
+
stepRecord,
|
|
1976
|
+
stepConfig,
|
|
1977
|
+
variable: tables_1.Variables.AssertJsonResponsePayloadElement.ElementName,
|
|
1978
|
+
startingValue: elementName,
|
|
1979
|
+
});
|
|
1980
|
+
this.createVariable({
|
|
1981
|
+
stepRecord,
|
|
1982
|
+
stepConfig,
|
|
1983
|
+
variable: tables_1.Variables.AssertJsonResponsePayloadElement.ResponseOperation,
|
|
1984
|
+
startingValue: operation,
|
|
1985
|
+
});
|
|
1986
|
+
this.createVariable({
|
|
1987
|
+
stepRecord,
|
|
1988
|
+
stepConfig,
|
|
1989
|
+
variable: tables_1.Variables.AssertJsonResponsePayloadElement.ElementValue,
|
|
1990
|
+
startingValue: elementValue,
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
setVariableValue_SP(inputs) {
|
|
1994
|
+
const { catItem, variableSet, variableValues } = inputs;
|
|
1995
|
+
const stepConfig = tables_1.StepConfig.SetVariableValues_SP;
|
|
1996
|
+
const stepRecord = this.createStepRecord({
|
|
1997
|
+
name: 'Set Variable Values (SP)',
|
|
1998
|
+
stepConfig,
|
|
1999
|
+
description: 'Set Variable Values (SP)',
|
|
2000
|
+
});
|
|
2001
|
+
this.createVariable({
|
|
2002
|
+
stepConfig,
|
|
2003
|
+
stepRecord,
|
|
2004
|
+
variable: tables_1.Variables.SetVariableValues_SP.Item,
|
|
2005
|
+
startingValue: catItem,
|
|
2006
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2007
|
+
});
|
|
2008
|
+
this.createVariable({
|
|
2009
|
+
stepConfig,
|
|
2010
|
+
stepRecord,
|
|
2011
|
+
variable: tables_1.Variables.SetVariableValues_SP.VariableSet,
|
|
2012
|
+
startingValue: variableSet,
|
|
2013
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2014
|
+
});
|
|
2015
|
+
this.createVariable({
|
|
2016
|
+
stepConfig,
|
|
2017
|
+
stepRecord,
|
|
2018
|
+
variable: tables_1.Variables.SetVariableValues_SP.VariableValues,
|
|
2019
|
+
startingValue: variableValues,
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
validateVariableValue_SP(inputs) {
|
|
2023
|
+
const { catItem, variableSet, variableValues } = inputs;
|
|
2024
|
+
const stepConfig = tables_1.StepConfig.ValidateVariableValues_SP;
|
|
2025
|
+
const stepRecord = this.createStepRecord({
|
|
2026
|
+
name: 'Validate Variable Values (SP)',
|
|
2027
|
+
stepConfig,
|
|
2028
|
+
description: 'Validates Variable values on the Catalog Item.',
|
|
2029
|
+
});
|
|
2030
|
+
this.createVariable({
|
|
2031
|
+
stepConfig,
|
|
2032
|
+
stepRecord,
|
|
2033
|
+
variable: tables_1.Variables.ValidateVariableValues_SP.Item,
|
|
2034
|
+
startingValue: catItem,
|
|
2035
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2036
|
+
});
|
|
2037
|
+
this.createVariable({
|
|
2038
|
+
stepConfig,
|
|
2039
|
+
stepRecord,
|
|
2040
|
+
variable: tables_1.Variables.ValidateVariableValues_SP.VariableSet,
|
|
2041
|
+
startingValue: variableSet,
|
|
2042
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2043
|
+
});
|
|
2044
|
+
this.createVariable({
|
|
2045
|
+
stepConfig,
|
|
2046
|
+
stepRecord,
|
|
2047
|
+
variable: tables_1.Variables.ValidateVariableValues_SP.Conditions,
|
|
2048
|
+
startingValue: variableValues,
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
variableStateValidation_SP(inputs) {
|
|
2052
|
+
const { catItem, variableSet, visible, notMandatory, notReadonly, notVisible, mandatory, readonly } = inputs;
|
|
2053
|
+
const stepConfig = tables_1.StepConfig.VariableStateValidation_SP;
|
|
2054
|
+
const stepRecord = this.createStepRecord({
|
|
2055
|
+
name: 'Variable State Validation (SP)',
|
|
2056
|
+
stepConfig,
|
|
2057
|
+
description: "Assert that variables are or aren't: mandatory, read only, and visible in service portal view on the catalog item.",
|
|
2058
|
+
});
|
|
2059
|
+
this.createVariable({
|
|
2060
|
+
stepConfig,
|
|
2061
|
+
stepRecord,
|
|
2062
|
+
variable: tables_1.Variables.VariableStateValidation_SP.Item,
|
|
2063
|
+
startingValue: catItem,
|
|
2064
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2065
|
+
});
|
|
2066
|
+
this.createVariable({
|
|
2067
|
+
stepConfig,
|
|
2068
|
+
stepRecord,
|
|
2069
|
+
variable: tables_1.Variables.VariableStateValidation_SP.VariableSet,
|
|
2070
|
+
startingValue: variableSet,
|
|
2071
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2072
|
+
});
|
|
2073
|
+
this.createVariable({
|
|
2074
|
+
stepConfig,
|
|
2075
|
+
stepRecord,
|
|
2076
|
+
variable: tables_1.Variables.VariableStateValidation_SP.Visible,
|
|
2077
|
+
startingValue: visible,
|
|
2078
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2079
|
+
});
|
|
2080
|
+
this.createVariable({
|
|
2081
|
+
stepConfig,
|
|
2082
|
+
stepRecord,
|
|
2083
|
+
variable: tables_1.Variables.VariableStateValidation_SP.NotVisible,
|
|
2084
|
+
startingValue: notVisible,
|
|
2085
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2086
|
+
});
|
|
2087
|
+
this.createVariable({
|
|
2088
|
+
stepConfig,
|
|
2089
|
+
stepRecord,
|
|
2090
|
+
variable: tables_1.Variables.VariableStateValidation_SP.Mandatory,
|
|
2091
|
+
startingValue: mandatory,
|
|
2092
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2093
|
+
});
|
|
2094
|
+
this.createVariable({
|
|
2095
|
+
stepConfig,
|
|
2096
|
+
stepRecord,
|
|
2097
|
+
variable: tables_1.Variables.VariableStateValidation_SP.NotMandatory,
|
|
2098
|
+
startingValue: notMandatory,
|
|
2099
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2100
|
+
});
|
|
2101
|
+
this.createVariable({
|
|
2102
|
+
stepConfig,
|
|
2103
|
+
stepRecord,
|
|
2104
|
+
variable: tables_1.Variables.VariableStateValidation_SP.ReadOnly,
|
|
2105
|
+
startingValue: readonly,
|
|
2106
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2107
|
+
});
|
|
2108
|
+
this.createVariable({
|
|
2109
|
+
stepConfig,
|
|
2110
|
+
stepRecord,
|
|
2111
|
+
variable: tables_1.Variables.VariableStateValidation_SP.NotReadOnly,
|
|
2112
|
+
startingValue: notReadonly,
|
|
2113
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
validatePriceAndRecurringPrice_SP(inputs) {
|
|
2117
|
+
const { price, recurringPrice, frequency } = inputs;
|
|
2118
|
+
const stepConfig = tables_1.StepConfig.ValidatePriceandRecurringPrice_SP;
|
|
2119
|
+
const stepRecord = this.createStepRecord({
|
|
2120
|
+
stepConfig,
|
|
2121
|
+
name: 'Validate Price and Recurring Price (SP)',
|
|
2122
|
+
description: 'Validate Price and Recurring Price (SP)',
|
|
2123
|
+
});
|
|
2124
|
+
this.createVariable({
|
|
2125
|
+
stepConfig,
|
|
2126
|
+
stepRecord,
|
|
2127
|
+
variable: tables_1.Variables.ValidatePriceandRecurringPrice_SP.Price,
|
|
2128
|
+
startingValue: price,
|
|
2129
|
+
});
|
|
2130
|
+
this.createVariable({
|
|
2131
|
+
stepConfig,
|
|
2132
|
+
stepRecord,
|
|
2133
|
+
variable: tables_1.Variables.ValidatePriceandRecurringPrice_SP.RecurringPrice,
|
|
2134
|
+
startingValue: recurringPrice,
|
|
2135
|
+
});
|
|
2136
|
+
this.createVariable({
|
|
2137
|
+
stepConfig,
|
|
2138
|
+
stepRecord,
|
|
2139
|
+
variable: tables_1.Variables.ValidatePriceandRecurringPrice_SP.RecurringFrequency,
|
|
2140
|
+
startingValue: frequency,
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2143
|
+
navigatewithinOrderGuide_SP(inputs) {
|
|
2144
|
+
const { guideStep, assert } = inputs;
|
|
2145
|
+
const stepConfig = tables_1.StepConfig.NavigatewithinOrderGuide_SP;
|
|
2146
|
+
const stepRecord = this.createStepRecord({
|
|
2147
|
+
stepConfig,
|
|
2148
|
+
name: 'Navigate within Order Guide (SP)',
|
|
2149
|
+
description: 'Navigate in Order Guide (SP)',
|
|
2150
|
+
});
|
|
2151
|
+
this.createVariable({
|
|
2152
|
+
stepConfig,
|
|
2153
|
+
stepRecord,
|
|
2154
|
+
variable: tables_1.Variables.NavigatewithinOrderGuide_SP.GuideStep,
|
|
2155
|
+
startingValue: guideStep,
|
|
2156
|
+
});
|
|
2157
|
+
this.createVariable({
|
|
2158
|
+
stepConfig,
|
|
2159
|
+
stepRecord,
|
|
2160
|
+
variable: tables_1.Variables.NavigatewithinOrderGuide_SP.Assert,
|
|
2161
|
+
startingValue: assert,
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
setFieldValue_SP(inputs) {
|
|
2165
|
+
const { table, fieldValues } = inputs;
|
|
2166
|
+
const stepConfig = tables_1.StepConfig.SetFieldValues_SP;
|
|
2167
|
+
const stepRecord = this.createStepRecord({
|
|
2168
|
+
name: 'Set Field Values (SP)',
|
|
2169
|
+
stepConfig,
|
|
2170
|
+
description: 'Set Field Values (SP)',
|
|
2171
|
+
tableName: table,
|
|
2172
|
+
});
|
|
2173
|
+
this.createVariable({
|
|
2174
|
+
stepConfig,
|
|
2175
|
+
stepRecord,
|
|
2176
|
+
variable: tables_1.Variables.SetFieldValues_SP.Table,
|
|
2177
|
+
startingValue: table,
|
|
2178
|
+
});
|
|
2179
|
+
this.createVariable({
|
|
2180
|
+
stepConfig,
|
|
2181
|
+
stepRecord,
|
|
2182
|
+
variable: tables_1.Variables.SetFieldValues_SP.FieldValues,
|
|
2183
|
+
startingValue: fieldValues,
|
|
2184
|
+
stringifier: (val) => this.fieldValuesToQuery(val),
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
setCatalogItemQuantity_SP(inputs) {
|
|
2188
|
+
const { quantity } = inputs;
|
|
2189
|
+
const stepConfig = tables_1.StepConfig.SetCatalogItemQuantity_SP;
|
|
2190
|
+
const stepRecord = this.createStepRecord({
|
|
2191
|
+
stepConfig,
|
|
2192
|
+
name: 'Set Catalog Item Quantity (SP)',
|
|
2193
|
+
description: 'Set Catalog Item Quantity (SP)',
|
|
2194
|
+
});
|
|
2195
|
+
this.createVariable({
|
|
2196
|
+
stepConfig,
|
|
2197
|
+
stepRecord,
|
|
2198
|
+
variable: tables_1.Variables.SetCatalogItemQuantity_SP.Quantity,
|
|
2199
|
+
startingValue: quantity,
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
validateOrderGuideItem_SP(inputs) {
|
|
2203
|
+
const { items } = inputs;
|
|
2204
|
+
const stepConfig = tables_1.StepConfig.ValidateOrderGuideItems_SP;
|
|
2205
|
+
const stepRecord = this.createStepRecord({
|
|
2206
|
+
name: 'Validate Order Guide Items (SP)',
|
|
2207
|
+
stepConfig,
|
|
2208
|
+
description: 'Validate Order Guide Items (SP)',
|
|
2209
|
+
});
|
|
2210
|
+
this.createVariable({
|
|
2211
|
+
stepConfig,
|
|
2212
|
+
stepRecord,
|
|
2213
|
+
variable: tables_1.Variables.ValidateOrderGuideItems_SP.Items,
|
|
2214
|
+
startingValue: items,
|
|
2215
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
reviewOrderGuideSummary_SP(inputs) {
|
|
2219
|
+
const { items, price } = inputs;
|
|
2220
|
+
const stepConfig = tables_1.StepConfig.ReviewOrderGuideSummary_SP;
|
|
2221
|
+
const stepRecord = this.createStepRecord({
|
|
2222
|
+
stepConfig,
|
|
2223
|
+
name: 'Review Order Guide Summary (SP)',
|
|
2224
|
+
description: 'Review Order Guide Summary (SP)',
|
|
2225
|
+
});
|
|
2226
|
+
this.createVariable({
|
|
2227
|
+
stepConfig,
|
|
2228
|
+
stepRecord,
|
|
2229
|
+
variable: tables_1.Variables.ReviewOrderGuideSummary_SP.Price,
|
|
2230
|
+
startingValue: price,
|
|
2231
|
+
});
|
|
2232
|
+
this.createVariable({
|
|
2233
|
+
stepConfig,
|
|
2234
|
+
stepRecord,
|
|
2235
|
+
variable: tables_1.Variables.ReviewOrderGuideSummary_SP.Items,
|
|
2236
|
+
startingValue: items,
|
|
2237
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
fieldValueValidation_SP(inputs) {
|
|
2241
|
+
const { table, conditions } = inputs;
|
|
2242
|
+
const stepConfig = tables_1.StepConfig.FieldValuesValidation_SP;
|
|
2243
|
+
const stepRecord = this.createStepRecord({
|
|
2244
|
+
stepConfig,
|
|
2245
|
+
name: 'Field Values Validation (SP)',
|
|
2246
|
+
description: 'Field Values Validation (SP)',
|
|
2247
|
+
});
|
|
2248
|
+
this.createVariable({
|
|
2249
|
+
stepConfig,
|
|
2250
|
+
stepRecord,
|
|
2251
|
+
variable: tables_1.Variables.FieldValuesValidation_SP.Table,
|
|
2252
|
+
startingValue: table,
|
|
2253
|
+
});
|
|
2254
|
+
this.createVariable({
|
|
2255
|
+
stepConfig,
|
|
2256
|
+
stepRecord,
|
|
2257
|
+
variable: tables_1.Variables.FieldValuesValidation_SP.Conditions,
|
|
2258
|
+
startingValue: conditions,
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
fieldStateValidation_SP(inputs) {
|
|
2262
|
+
const { table, mandatory, notMandatory, notReadonly, notVisible, readonly, visible } = inputs;
|
|
2263
|
+
const stepConfig = tables_1.StepConfig.FieldStateValidation_SP;
|
|
2264
|
+
const stepRecord = this.createStepRecord({
|
|
2265
|
+
stepConfig,
|
|
2266
|
+
name: 'Field State Validation (SP)',
|
|
2267
|
+
description: 'Field State Validation (SP)',
|
|
2268
|
+
tableName: table,
|
|
2269
|
+
});
|
|
2270
|
+
this.createVariable({
|
|
2271
|
+
stepConfig,
|
|
2272
|
+
stepRecord,
|
|
2273
|
+
variable: tables_1.Variables.FieldStateValidation_SP.Table,
|
|
2274
|
+
startingValue: table,
|
|
2275
|
+
});
|
|
2276
|
+
this.createVariable({
|
|
2277
|
+
stepConfig,
|
|
2278
|
+
stepRecord,
|
|
2279
|
+
variable: tables_1.Variables.FieldStateValidation_SP.Mandatory,
|
|
2280
|
+
startingValue: mandatory,
|
|
2281
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2282
|
+
});
|
|
2283
|
+
this.createVariable({
|
|
2284
|
+
stepConfig,
|
|
2285
|
+
stepRecord,
|
|
2286
|
+
variable: tables_1.Variables.FieldStateValidation_SP.NotMandatory,
|
|
2287
|
+
startingValue: notMandatory,
|
|
2288
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2289
|
+
});
|
|
2290
|
+
this.createVariable({
|
|
2291
|
+
stepConfig,
|
|
2292
|
+
stepRecord,
|
|
2293
|
+
variable: tables_1.Variables.FieldStateValidation_SP.ReadOnly,
|
|
2294
|
+
startingValue: readonly,
|
|
2295
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2296
|
+
});
|
|
2297
|
+
this.createVariable({
|
|
2298
|
+
stepConfig,
|
|
2299
|
+
stepRecord,
|
|
2300
|
+
variable: tables_1.Variables.FieldStateValidation_SP.NotReadOnly,
|
|
2301
|
+
startingValue: notReadonly,
|
|
2302
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2303
|
+
});
|
|
2304
|
+
this.createVariable({
|
|
2305
|
+
stepConfig,
|
|
2306
|
+
stepRecord,
|
|
2307
|
+
variable: tables_1.Variables.FieldStateValidation_SP.Visible,
|
|
2308
|
+
startingValue: visible,
|
|
2309
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2310
|
+
});
|
|
2311
|
+
this.createVariable({
|
|
2312
|
+
stepConfig,
|
|
2313
|
+
stepRecord,
|
|
2314
|
+
variable: tables_1.Variables.FieldStateValidation_SP.NotVisible,
|
|
2315
|
+
startingValue: notVisible,
|
|
2316
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2319
|
+
uiActionVisibilityValidation_SP(inputs) {
|
|
2320
|
+
const { table, visible, notVisible } = inputs;
|
|
2321
|
+
const stepConfig = tables_1.StepConfig.UIActionVisibilityValidation_SP;
|
|
2322
|
+
const stepRecord = this.createStepRecord({
|
|
2323
|
+
name: 'UI Action Visibility Validation (SP)',
|
|
2324
|
+
stepConfig,
|
|
2325
|
+
description: 'UI Action Visibility Validation (SP)',
|
|
2326
|
+
tableName: table,
|
|
2327
|
+
});
|
|
2328
|
+
this.createVariable({
|
|
2329
|
+
stepConfig,
|
|
2330
|
+
stepRecord,
|
|
2331
|
+
variable: tables_1.Variables.UIActionVisibilityValidation_SP.Table,
|
|
2332
|
+
startingValue: table,
|
|
2333
|
+
});
|
|
2334
|
+
this.createVariable({
|
|
2335
|
+
stepConfig,
|
|
2336
|
+
stepRecord,
|
|
2337
|
+
variable: tables_1.Variables.UIActionVisibilityValidation_SP.Visible,
|
|
2338
|
+
startingValue: visible,
|
|
2339
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2340
|
+
});
|
|
2341
|
+
this.createVariable({
|
|
2342
|
+
stepConfig,
|
|
2343
|
+
stepRecord,
|
|
2344
|
+
variable: tables_1.Variables.UIActionVisibilityValidation_SP.NotVisible,
|
|
2345
|
+
startingValue: notVisible,
|
|
2346
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
reviewIteminOrderGuide_SP(inputs) {
|
|
2350
|
+
const { item, included } = inputs;
|
|
2351
|
+
const stepConfig = tables_1.StepConfig.ReviewIteminOrderGuide_SP;
|
|
2352
|
+
const stepRecord = this.createStepRecord({
|
|
2353
|
+
name: 'Review Item in Order Guide (SP)',
|
|
2354
|
+
stepConfig,
|
|
2355
|
+
description: 'Review Item in Order Guide (SP)',
|
|
2356
|
+
});
|
|
2357
|
+
this.createVariable({
|
|
2358
|
+
stepConfig,
|
|
2359
|
+
stepRecord,
|
|
2360
|
+
variable: tables_1.Variables.ReviewIteminOrderGuide_SP.Item,
|
|
2361
|
+
startingValue: item,
|
|
2362
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2363
|
+
});
|
|
2364
|
+
this.createVariable({
|
|
2365
|
+
stepConfig,
|
|
2366
|
+
stepRecord,
|
|
2367
|
+
variable: tables_1.Variables.ReviewIteminOrderGuide_SP.Included,
|
|
2368
|
+
startingValue: included,
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
clickUIAction_SP(inputs) {
|
|
2372
|
+
const { table, uiAction, assert } = inputs;
|
|
2373
|
+
const stepConfig = tables_1.StepConfig.ClickaUIAction_SP;
|
|
2374
|
+
const stepRecord = this.createStepRecord({
|
|
2375
|
+
stepConfig,
|
|
2376
|
+
name: 'Click a UI Action (SP)',
|
|
2377
|
+
description: 'Click a UI Action (SP)',
|
|
2378
|
+
tableName: table,
|
|
2379
|
+
});
|
|
2380
|
+
this.createVariable({
|
|
2381
|
+
stepConfig,
|
|
2382
|
+
stepRecord,
|
|
2383
|
+
variable: tables_1.Variables.ClickaUIAction_SP.Table,
|
|
2384
|
+
startingValue: table,
|
|
2385
|
+
});
|
|
2386
|
+
this.createVariable({
|
|
2387
|
+
stepConfig,
|
|
2388
|
+
stepRecord,
|
|
2389
|
+
variable: tables_1.Variables.ClickaUIAction_SP.Assert,
|
|
2390
|
+
startingValue: assert,
|
|
2391
|
+
});
|
|
2392
|
+
this.createVariable({
|
|
2393
|
+
stepConfig,
|
|
2394
|
+
stepRecord,
|
|
2395
|
+
variable: tables_1.Variables.ClickaUIAction_SP.UIAction,
|
|
2396
|
+
startingValue: uiAction,
|
|
2397
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
submitForm_SP(inputs) {
|
|
2401
|
+
const { assert } = inputs;
|
|
2402
|
+
const stepConfig = tables_1.StepConfig.SubmitForm_SP;
|
|
2403
|
+
const stepRecord = this.createStepRecord({
|
|
2404
|
+
name: 'Submit a Form (SP)',
|
|
2405
|
+
stepConfig,
|
|
2406
|
+
description: 'Submits the current form.',
|
|
2407
|
+
});
|
|
2408
|
+
this.createVariable({
|
|
2409
|
+
stepConfig,
|
|
2410
|
+
stepRecord,
|
|
2411
|
+
variable: tables_1.Variables.SubmitForm_SP.Assert,
|
|
2412
|
+
startingValue: assert,
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
addItemtoShoppingCart_SP(inputs) {
|
|
2416
|
+
const { assert } = inputs;
|
|
2417
|
+
const stepConfig = tables_1.StepConfig.AddItemtoShoppingCart_SP;
|
|
2418
|
+
const stepRecord = this.createStepRecord({
|
|
2419
|
+
stepConfig,
|
|
2420
|
+
name: 'Add Item to Shopping Cart (SP)',
|
|
2421
|
+
description: 'Add Item to Shopping Cart (SP)',
|
|
2422
|
+
});
|
|
2423
|
+
this.createVariable({
|
|
2424
|
+
stepConfig,
|
|
2425
|
+
stepRecord,
|
|
2426
|
+
variable: tables_1.Variables.AddItemtoShoppingCart_SP.Assert,
|
|
2427
|
+
startingValue: assert,
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
addOrderGuidetoShoppingCart_SP(inputs) {
|
|
2431
|
+
const { assert } = inputs;
|
|
2432
|
+
const stepConfig = tables_1.StepConfig.AddOrderGuidetoShoppingCart_SP;
|
|
2433
|
+
const stepRecord = this.createStepRecord({
|
|
2434
|
+
stepConfig,
|
|
2435
|
+
name: 'Add Order Guide to Shopping Cart (SP)',
|
|
2436
|
+
description: 'Add Order Guide to Shopping Cart (SP)',
|
|
2437
|
+
});
|
|
2438
|
+
this.createVariable({
|
|
2439
|
+
stepConfig,
|
|
2440
|
+
stepRecord,
|
|
2441
|
+
variable: tables_1.Variables.AddOrderGuidetoShoppingCart_SP.Assert,
|
|
2442
|
+
startingValue: assert,
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
submitOrderGuide_SP(inputs) {
|
|
2446
|
+
const { assert } = inputs;
|
|
2447
|
+
const stepConfig = tables_1.StepConfig.SubmitOrderGuide_SP;
|
|
2448
|
+
const stepRecord = this.createStepRecord({
|
|
2449
|
+
name: 'Submit an Order Guide (SP)',
|
|
2450
|
+
stepConfig,
|
|
2451
|
+
description: 'Submit an Order Guide (SP)',
|
|
2452
|
+
});
|
|
2453
|
+
this.createVariable({
|
|
2454
|
+
stepConfig,
|
|
2455
|
+
stepRecord,
|
|
2456
|
+
variable: tables_1.Variables.SubmitOrderGuide_SP.Assert,
|
|
2457
|
+
startingValue: assert,
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2460
|
+
submitRecordProducer_SP(inputs) {
|
|
2461
|
+
const { assert } = inputs;
|
|
2462
|
+
const stepConfig = tables_1.StepConfig.SubmitRecordProducer_SP;
|
|
2463
|
+
const stepRecord = this.createStepRecord({
|
|
2464
|
+
stepConfig,
|
|
2465
|
+
name: 'Submit Record Producer (SP)',
|
|
2466
|
+
description: 'Submit a Record Producer (SP)',
|
|
2467
|
+
});
|
|
2468
|
+
this.createVariable({
|
|
2469
|
+
stepConfig,
|
|
2470
|
+
stepRecord,
|
|
2471
|
+
variable: tables_1.Variables.SubmitRecordProducer_SP.Assert,
|
|
2472
|
+
startingValue: assert,
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
orderCatalogItem_SP(inputs) {
|
|
2476
|
+
const { assert } = inputs;
|
|
2477
|
+
const stepConfig = tables_1.StepConfig.OrderCatalogItem_SP;
|
|
2478
|
+
const stepRecord = this.createStepRecord({
|
|
2479
|
+
name: 'Order a Catalog Item (SP)',
|
|
2480
|
+
stepConfig,
|
|
2481
|
+
description: 'Order a Catalog Item (SP)',
|
|
2482
|
+
});
|
|
2483
|
+
this.createVariable({
|
|
2484
|
+
stepConfig,
|
|
2485
|
+
stepRecord,
|
|
2486
|
+
variable: tables_1.Variables.OrderCatalogItem_SP.Assert,
|
|
2487
|
+
startingValue: assert,
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
validateOutboundEmail(inputs) {
|
|
2491
|
+
const { conditions } = inputs;
|
|
2492
|
+
const stepConfig = tables_1.StepConfig.ValidateOutboundEmail;
|
|
2493
|
+
const stepRecord = this.createStepRecord({
|
|
2494
|
+
name: 'Validate Outbound Email',
|
|
2495
|
+
stepConfig,
|
|
2496
|
+
description: 'Filters the Email [sys_email] table to find an email that was sent during testing',
|
|
2497
|
+
});
|
|
2498
|
+
this.createVariable({
|
|
2499
|
+
stepConfig,
|
|
2500
|
+
stepRecord,
|
|
2501
|
+
variable: tables_1.Variables.ValidateOutboundEmail.Conditions,
|
|
2502
|
+
startingValue: conditions,
|
|
2503
|
+
});
|
|
2504
|
+
this.createVariable({
|
|
2505
|
+
stepConfig,
|
|
2506
|
+
stepRecord,
|
|
2507
|
+
variable: tables_1.Variables.ValidateOutboundEmail.Table,
|
|
2508
|
+
startingValue: 'sys_email',
|
|
2509
|
+
});
|
|
2510
|
+
}
|
|
2511
|
+
recordInsert(inputs) {
|
|
2512
|
+
const { assertType, enforceSecurity, table, fieldValues } = inputs;
|
|
2513
|
+
const stepConfig = tables_1.StepConfig.RecordInsert;
|
|
2514
|
+
const stepRecord = this.createStepRecord({
|
|
2515
|
+
name: 'Record Insert',
|
|
2516
|
+
stepConfig,
|
|
2517
|
+
description: 'Insert a record to the table',
|
|
2518
|
+
});
|
|
2519
|
+
this.createVariable({
|
|
2520
|
+
stepConfig,
|
|
2521
|
+
stepRecord,
|
|
2522
|
+
variable: tables_1.Variables.RecordInsert.AssertType,
|
|
2523
|
+
startingValue: assertType,
|
|
2524
|
+
});
|
|
2525
|
+
this.createVariable({
|
|
2526
|
+
stepConfig,
|
|
2527
|
+
stepRecord,
|
|
2528
|
+
variable: tables_1.Variables.RecordInsert.EnforceSecurity,
|
|
2529
|
+
startingValue: enforceSecurity,
|
|
2530
|
+
});
|
|
2531
|
+
this.createVariable({
|
|
2532
|
+
stepConfig,
|
|
2533
|
+
stepRecord,
|
|
2534
|
+
variable: tables_1.Variables.RecordInsert.Table,
|
|
2535
|
+
startingValue: table,
|
|
2536
|
+
});
|
|
2537
|
+
this.createVariable({
|
|
2538
|
+
stepConfig,
|
|
2539
|
+
stepRecord,
|
|
2540
|
+
variable: tables_1.Variables.RecordInsert.FieldValues,
|
|
2541
|
+
startingValue: fieldValues,
|
|
2542
|
+
stringifier: (val) => this.fieldValuesToQuery(val),
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
searchForCatalogItem(inputs) {
|
|
2546
|
+
const { search_in_portal, search_term, catalog, category, assert_item, assert_type } = inputs;
|
|
2547
|
+
const stepConfig = tables_1.StepConfig.SearchForACatalogItem;
|
|
2548
|
+
const stepRecord = this.createStepRecord({
|
|
2549
|
+
name: 'Search for a Catalog Item',
|
|
2550
|
+
stepConfig,
|
|
2551
|
+
description: 'Perform search for a Catalog Item or Record Producer in the specified Catalog and Category',
|
|
2552
|
+
});
|
|
2553
|
+
this.createVariable({
|
|
2554
|
+
stepConfig,
|
|
2555
|
+
stepRecord,
|
|
2556
|
+
variable: tables_1.Variables.SearchForACatalogItem.SearchInPortalOnly,
|
|
2557
|
+
startingValue: search_in_portal,
|
|
2558
|
+
});
|
|
2559
|
+
this.createVariable({
|
|
2560
|
+
stepConfig,
|
|
2561
|
+
stepRecord,
|
|
2562
|
+
variable: tables_1.Variables.SearchForACatalogItem.SearchTerm,
|
|
2563
|
+
startingValue: search_term,
|
|
2564
|
+
});
|
|
2565
|
+
this.createVariable({
|
|
2566
|
+
stepConfig,
|
|
2567
|
+
stepRecord,
|
|
2568
|
+
variable: tables_1.Variables.SearchForACatalogItem.Catalog,
|
|
2569
|
+
startingValue: catalog,
|
|
2570
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2571
|
+
});
|
|
2572
|
+
this.createVariable({
|
|
2573
|
+
stepConfig,
|
|
2574
|
+
stepRecord,
|
|
2575
|
+
variable: tables_1.Variables.SearchForACatalogItem.Category,
|
|
2576
|
+
startingValue: category,
|
|
2577
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2578
|
+
});
|
|
2579
|
+
this.createVariable({
|
|
2580
|
+
stepConfig,
|
|
2581
|
+
stepRecord,
|
|
2582
|
+
variable: tables_1.Variables.SearchForACatalogItem.AssertItem,
|
|
2583
|
+
startingValue: assert_item,
|
|
2584
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2585
|
+
});
|
|
2586
|
+
this.createVariable({
|
|
2587
|
+
stepConfig,
|
|
2588
|
+
stepRecord,
|
|
2589
|
+
variable: tables_1.Variables.SearchForACatalogItem.AssertType,
|
|
2590
|
+
startingValue: assert_type,
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
replayRequestItem(inputs) {
|
|
2594
|
+
const { request_item } = inputs;
|
|
2595
|
+
const stepConfig = tables_1.StepConfig.ReplayRequestItem;
|
|
2596
|
+
const stepRecord = this.createStepRecord({
|
|
2597
|
+
name: 'Replay Request Item',
|
|
2598
|
+
stepConfig,
|
|
2599
|
+
description: 'Replays a previously created request item with the same values and options',
|
|
2600
|
+
});
|
|
2601
|
+
this.createVariable({
|
|
2602
|
+
stepConfig,
|
|
2603
|
+
stepRecord,
|
|
2604
|
+
variable: tables_1.Variables.ReplayRequestItem.OriginalRequestItem,
|
|
2605
|
+
startingValue: request_item,
|
|
2606
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
variableStateValidation(inputs) {
|
|
2610
|
+
const { catalog_item, visible, not_visible, read_only, not_read_only, mandatory, not_mandatory } = inputs;
|
|
2611
|
+
const stepConfig = tables_1.StepConfig.VariableStateValidation;
|
|
2612
|
+
const stepRecord = this.createStepRecord({
|
|
2613
|
+
name: 'Variable State Validation',
|
|
2614
|
+
stepConfig,
|
|
2615
|
+
description: 'Validates states of the desired variables',
|
|
2616
|
+
});
|
|
2617
|
+
this.createVariable({
|
|
2618
|
+
stepConfig,
|
|
2619
|
+
stepRecord,
|
|
2620
|
+
variable: tables_1.Variables.VariableStateValidation.CatalogItem,
|
|
2621
|
+
startingValue: catalog_item,
|
|
2622
|
+
stringifier: (val) => this.extractSysIdIfRecord(val),
|
|
2623
|
+
});
|
|
2624
|
+
this.createVariable({
|
|
2625
|
+
stepConfig,
|
|
2626
|
+
stepRecord,
|
|
2627
|
+
variable: tables_1.Variables.VariableStateValidation.Visible,
|
|
2628
|
+
startingValue: visible,
|
|
2629
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2630
|
+
});
|
|
2631
|
+
this.createVariable({
|
|
2632
|
+
stepConfig,
|
|
2633
|
+
stepRecord,
|
|
2634
|
+
variable: tables_1.Variables.VariableStateValidation.NotVisible,
|
|
2635
|
+
startingValue: not_visible,
|
|
2636
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2637
|
+
});
|
|
2638
|
+
this.createVariable({
|
|
2639
|
+
stepConfig,
|
|
2640
|
+
stepRecord,
|
|
2641
|
+
variable: tables_1.Variables.VariableStateValidation.ReadOnly,
|
|
2642
|
+
startingValue: read_only,
|
|
2643
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2644
|
+
});
|
|
2645
|
+
this.createVariable({
|
|
2646
|
+
stepConfig,
|
|
2647
|
+
stepRecord,
|
|
2648
|
+
variable: tables_1.Variables.VariableStateValidation.NotReadOnly,
|
|
2649
|
+
startingValue: not_read_only,
|
|
2650
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2651
|
+
});
|
|
2652
|
+
this.createVariable({
|
|
2653
|
+
stepConfig,
|
|
2654
|
+
stepRecord,
|
|
2655
|
+
variable: tables_1.Variables.VariableStateValidation.Mandatory,
|
|
2656
|
+
startingValue: mandatory,
|
|
2657
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2658
|
+
});
|
|
2659
|
+
this.createVariable({
|
|
2660
|
+
stepConfig,
|
|
2661
|
+
stepRecord,
|
|
2662
|
+
variable: tables_1.Variables.VariableStateValidation.NotMandatory,
|
|
2663
|
+
startingValue: not_mandatory,
|
|
2664
|
+
stringifier: (val) => this.recordListToString(val),
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
assertResponseHeader(inputs) {
|
|
2668
|
+
const { header_name, response_operation, header_value } = inputs;
|
|
2669
|
+
const stepConfig = tables_1.StepConfig.AssertResponseHeader;
|
|
2670
|
+
const stepRecord = this.createStepRecord({
|
|
2671
|
+
name: 'Assert Response Header',
|
|
2672
|
+
stepConfig,
|
|
2673
|
+
description: 'Assert an HTTP response header',
|
|
2674
|
+
});
|
|
2675
|
+
this.createVariable({
|
|
2676
|
+
stepConfig,
|
|
2677
|
+
stepRecord,
|
|
2678
|
+
variable: tables_1.Variables.AssertResponseHeader.Header,
|
|
2679
|
+
startingValue: header_name,
|
|
2680
|
+
});
|
|
2681
|
+
this.createVariable({
|
|
2682
|
+
stepConfig,
|
|
2683
|
+
stepRecord,
|
|
2684
|
+
variable: tables_1.Variables.AssertResponseHeader.Operation,
|
|
2685
|
+
startingValue: response_operation,
|
|
2686
|
+
});
|
|
2687
|
+
this.createVariable({
|
|
2688
|
+
stepConfig,
|
|
2689
|
+
stepRecord,
|
|
2690
|
+
variable: tables_1.Variables.AssertResponseHeader.Value,
|
|
2691
|
+
startingValue: header_value,
|
|
2692
|
+
});
|
|
2693
|
+
}
|
|
2694
|
+
assertResponsePayload(inputs) {
|
|
2695
|
+
const { response_body, response_operation } = inputs;
|
|
2696
|
+
const stepConfig = tables_1.StepConfig.AssertResponsePayload;
|
|
2697
|
+
const stepRecord = this.createStepRecord({
|
|
2698
|
+
name: 'Assert Response Payload',
|
|
2699
|
+
stepConfig,
|
|
2700
|
+
description: 'Assert the HTTP response payload is equals to or contains a specified value',
|
|
2701
|
+
});
|
|
2702
|
+
this.createVariable({
|
|
2703
|
+
stepConfig,
|
|
2704
|
+
stepRecord,
|
|
2705
|
+
variable: tables_1.Variables.AssertResponsePayload.ResponseBody,
|
|
2706
|
+
startingValue: response_body,
|
|
2707
|
+
});
|
|
2708
|
+
this.createVariable({
|
|
2709
|
+
stepConfig,
|
|
2710
|
+
stepRecord,
|
|
2711
|
+
variable: tables_1.Variables.AssertResponsePayload.Operation,
|
|
2712
|
+
startingValue: response_operation,
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
exports.ATF = ATF;
|
|
2717
|
+
//# sourceMappingURL=ATFComposer.js.map
|