forked from erwinel/sn_typings_server_scoped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsn_atf.d.ts
373 lines (325 loc) · 11.7 KB
/
sn_atf.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
/// <reference path="./Packages.d.ts" />
/// <reference path="./$$rhino.d.ts" />
/// <reference path="./ElementTypes.d.ts" />
/// <reference path="./RecordTypes.d.ts" />
declare namespace $$GlideRecord {
/**
* "Output Variables" GlideRecord.
*/
export type atf_output_variable = $$tableFields.atf_output_variable & sys_atf_variable;
/**
* "Test Variable" GlideRecord.
* Extendable: true
*/
export type sys_atf_variable = $$tableFields.sys_atf_variable & var_dictionary;
/**
* "Test Step Config" GlideRecord.
*/
export type sys_atf_step_config = $$tableFields.sys_atf_step_config & sys_metadata;
/**
* "Test Step Config Category" GlideRecord.
*/
export type sys_atf_step_config_category = $$tableFields.sys_atf_step_config_category & sys_metadata;
/**
* "Input Variables" GlideRecord.
*/
export type atf_input_variable = $$tableFields.atf_input_variable & sys_atf_variable;
/**
* "Test Step Environment" GlideRecord.
*/
export type sys_atf_step_env = $$tableFields.sys_atf_step_env & sys_metadata;
}
declare namespace $$GlideElement {
/**
* Reference element for the "Output Variables" record type.
*/
export type atf_output_variable = Reference<$$tableFields.atf_output_variable, $$GlideRecord.atf_output_variable> & sys_atf_variable;
/**
* Reference element for the "Test Variable" record type.
*/
export type sys_atf_variable = Reference<$$tableFields.sys_atf_variable, $$GlideRecord.sys_atf_variable> & var_dictionary;
/**
* Reference element for the "Test Step Config" record type.
*/
export type sys_atf_step_config = Reference<$$tableFields.sys_atf_step_config, $$GlideRecord.sys_atf_step_config> & sys_metadata;
/**
* Reference element for the "Test Step Config Category" record type.
*/
export type sys_atf_step_config_category = Reference<$$tableFields.sys_atf_step_config_category, $$GlideRecord.sys_atf_step_config_category> & sys_metadata;
/**
* Reference element for the "Input Variables" record type.
*/
export type atf_input_variable = Reference<$$tableFields.atf_input_variable, $$GlideRecord.atf_input_variable> & sys_atf_variable;
/**
* Reference element for the "Test Step Environment" record type.
*/
export type sys_atf_step_env = Reference<$$tableFields.sys_atf_step_env, $$GlideRecord.sys_atf_step_env> & sys_metadata;
}
declare namespace $$tableFields {
/**
* "Output Variables" GlideRecord fields.
* @see {@link $$GlideRecord.atf_output_variable}
* @see {@link $$GlideElement.atf_output_variable}
*/
export interface atf_output_variable extends sys_atf_variable { }
/**
* "Test Variable" GlideRecord fields.
* @see {@link $$GlideRecord.sys_atf_variable}
* @see {@link $$GlideElement.sys_atf_variable}
*/
export interface sys_atf_variable extends var_dictionary {
/**
* "Model" column element.
* Read-only: true; Max Length: 32.
*/
model: $$GlideElement.sys_atf_step_config;
}
/**
* "Test Step Config" GlideRecord fields.
* @see {@link $$GlideRecord.sys_atf_step_config}
* @see {@link $$GlideElement.sys_atf_step_config}
*/
export interface sys_atf_step_config extends sys_metadata {
/**
* "Active" column element.
* Type: "True/False" (boolean).
* Max Length: 40.
* Default Value: true.
*/
active: GlideElement;
/**
* "Batch order constraint" column element.
* Type: "Choice" (choice).
* Max Length: 40.
*/
batch_order_constraint: GlideElement;
/**
* "Can mutate page" column element.
* Type: "True/False" (boolean).
* Max Length: 40.
* Default Value: false.
*/
can_mutate_page: GlideElement;
/**
* "Category" column element.
* Max Length: 32.
*/
category: $$GlideElement.sys_atf_step_config_category;
/**
* "Class Name" column element.
* Max Length: 200.
*/
class_name: GlideElement;
/**
* "Class type" column element.
* Max Length: 40.
* Default Value: "script".
*/
class_type: GlideElement;
/**
* "Deprecated" column element.
* Type: "True/False" (boolean).
* Max Length: 40.
* Default Value: false.
*/
deprecated: GlideElement;
/**
* "Description generation script" column element.
* Type: "Script (Plain)" (script_plain).
* Max Length: 8000.
*/
description_generator: GlideElement;
/**
* "HTML description" column element.
* Type: "Translated HTML" (translated_html).
* Mandatory: true; Max Length: 8000.
*/
html_description: GlideElement;
/**
* "Icon" column element.
* Max Length: 100.
* Default Value: "icon-article-document".
*/
icon: GlideElement;
/**
* "Input variables" column element.
* Type: "Glide Var" (glide_var).
* Max Length: 32.
*/
inputs: $$GlideElement.atf_input_variable;
/**
* "Name" column element.
* Type: "Translated Field" (translated_field).
* Mandatory: true; Display: true; Max Length: 250.
*/
name: GlideElement;
/**
* "Order" column element.
* Type: "Integer" (integer).
* Mandatory: true; Max Length: 40.
*/
order: GlideElement;
/**
* "Output variables" column element.
* Type: "Glide Var" (glide_var).
* Max Length: 32.
*/
outputs: $$GlideElement.atf_output_variable;
/**
* "Step environment" column element.
* Mandatory: true; Max Length: 32.
* Default Value: "6c2bcea1870312009dccc9ded0e3ecca".
*/
step_env: $$GlideElement.sys_atf_step_env;
/**
* "Step execution script" column element.
* Type: "Script (Plain)" (script_plain).
* Max Length: 8000.
*/
step_execution_generator: GlideElement;
/**
* "Template reminder" column element.
* Type: "Translated Text" (translated_text).
* Mandatory: true; Max Length: 255.
*/
template_reminder: GlideElement;
/**
* "Type" column element.
* Mandatory: true; Max Length: 32.
*/
type: $$GlideElement.sys_db_object;
/**
* "Wizard Redirect" column element.
* Max Length: 255.
*/
wizard_redirect: GlideElement;
}
/**
* "Test Step Config Category" GlideRecord fields.
* @see {@link $$GlideRecord.sys_atf_step_config_category}
* @see {@link $$GlideElement.sys_atf_step_config_category}
*/
export interface sys_atf_step_config_category extends sys_metadata {
/**
* "Display name" column element.
* Mandatory: true; Max Length: 100.
*/
display_name: GlideElement;
/**
* "Name" column element.
* Mandatory: true; Display: true; Max Length: 100.
*/
name: GlideElement;
/**
* "Step environment" column element.
* Mandatory: true; Max Length: 32.
*/
step_env: $$GlideElement.sys_atf_step_env;
}
/**
* "Input Variables" GlideRecord fields.
* @see {@link $$GlideRecord.atf_input_variable}
* @see {@link $$GlideElement.atf_input_variable}
*/
export interface atf_input_variable extends sys_atf_variable { }
/**
* "Test Step Environment" GlideRecord fields.
* @see {@link $$GlideRecord.sys_atf_step_env}
* @see {@link $$GlideElement.sys_atf_step_env}
*/
export interface sys_atf_step_env extends sys_metadata {
/**
* "Class name" column element.
* Max Length: 200.
*/
class_name: GlideElement;
/**
* "Description" column element.
* Max Length: 1000.
*/
description: GlideElement;
/**
* "Has batch constraint" column element.
* Type: "True/False" (boolean).
* Max Length: 40.
* Default Value: true.
*/
has_batch_constraint: GlideElement;
/**
* "Name" column element.
* Mandatory: true; Display: true; Max Length: 100.
*/
name: GlideElement;
/**
* "Order" column element.
* Type: "Integer" (integer).
* Max Length: 40.
*/
order: GlideElement;
/**
* "Class type" column element.
* Max Length: 40.
* Default Value: "java".
*/
type: GlideElement;
}
}
declare namespace sn_atf {
export interface ITestStepOutputs {
[key: string]: $$GlideElement.atf_output_variable;
}
/**
* Represents the steps function that exists for ATF server script tests
* @export
* @interface ITestStepsFunc
* @example declare function steps(sys_id: string): sn_atf.ITestStepOutputs;
* declare function assertEqual(assertion: sn_atf.ITestAssertion): void;
* declare var outputs: sn_atf.ITestStepOutputs;
* declare var stepResult: sn_atf.ITestStepResult;
* (function constructorTest(outputs: sn_atf.ITestStepOutputs, steps: sn_atf.ITestStepsFunc, stepResult: sn_atf.ITestStepResult, assertEqual: sn_atf.IAssertEqualFunc) {
* })(outputs, steps, stepResult, assertEqual);
*/
export interface ITestStepsFunc { (sys_id: string): ITestStepOutputs }
/**
* Represents the stepResult object for ATF server script tests.
* @export
* @interface ITestStepResult
* @example declare var stepResult: sn_atf.ITestStepResult;
* declare var outputs: sn_atf.ITestStepOutputs;
* declare function assertEqual(assertion: sn_atf.ITestAssertion): void;
* declare function steps(sys_id: string): sn_atf.ITestStepOutputs;
* (function constructorTest(outputs: sn_atf.ITestStepOutputs, steps: sn_atf.ITestStepsFunc, stepResult: sn_atf.ITestStepResult, assertEqual: sn_atf.IAssertEqualFunc) {
* })(outputs, steps, stepResult, assertEqual);
*/
export interface ITestStepResult {
setOutputMessage(message: string): void;
setSuccess(): void;
/**
* @memberof ITestStepResult
* @throws When the setFailed method is invoked on stepResult, an exception will be thrown.
*/
setFailed(): never;
}
/**
* Interface for object that is passed to the assertEqual function.
* @export
* @interface ITestAssertion
*/
export interface ITestAssertion {
name: string;
shouldbe: any;
value: any
}
/**
* Represents the assertEqual function that exists for ATF server script tests
* @export
* @interface IAssertEqualFunc
* @example declare function assertEqual(assertion: sn_atf.ITestAssertion): void;
* declare function steps(sys_id: string): sn_atf.ITestStepOutputs;
* declare var outputs: sn_atf.ITestStepOutputs;
* declare var stepResult: sn_atf.ITestStepResult;
* (function constructorTest(outputs: sn_atf.ITestStepOutputs, steps: sn_atf.ITestStepsFunc, stepResult: sn_atf.ITestStepResult, assertEqual:sn_atf. IAssertEqualFunc) {
* })(outputs, steps, stepResult, assertEqual);
*/
export interface IAssertEqualFunc { (assertion: ITestAssertion): void }
}