JSON Test File

Test collection

Parameters

Parameter
Type
Description
processName
String
Name of the process for which you want to run a test
processVersion
Int
Version of the process for which you want to run a test
tests
List of tests to be run
You can define one or several tests in this array.
deleteRequest
Boolean
Indicates whether you want to delete requests that will be launched once the tests have been run

Example

1
{
2
"processName": "TEST_PROCESS",
3
"processVersion": 1,
4
"tests": [...],
5
"deleteRequest": false
6
}
Copied!

Test

Parameters

Parameter
Type
Description
describe
String
Description of the test
requestParameters
List of parameters that will be transmitted upon launching the request
You can define one or several parameters in this array.
actions
List of actions that will be covered by the test
You can define one or several actions in this array.
assertions
Checks to be performed on the request created during the test

Example

1
"tests": [
2
{
3
"describe": "First test",
4
"requestParameters": [...],
5
"actions": [...],
6
"assertions": {...}
7
},
8
{
9
"describe": "First test",
10
"requestParameters": [...],
11
"actions": [...],
12
"assertions": {...}
13
}
14
]
15
Copied!

Action

Test actions will be run in the order that you define.

Parameters

Parameter
Type
Description
name
String
Action ID
operation
Enum
Type of action that will be executed
Possible values: COMPLETE, CHECK, SUBPROCESS , orCANCEL.
timeout
Int
Maximum time for execution of the action
parameters
List of parameters that will be transmitted upon launching the request
You can define one or several parameters in this array.
subRequestFile
String
Path to the sub request's JSON test file
subRequest
Elements of the sub request
assertions
Checks to perform on the action
exception
Throw an exception when performing an action

Example

1
"actions": [
2
{
3
"name": "INITIATES",
4
"operation": "COMPLETE",
5
"parameters": [...],
6
"assertions": {...}
7
},
8
{
9
"name": "COPY_DATA",
10
"operation": "CHECK",
11
"timeout": 10,
12
"assertions": {...}
13
},
14
{
15
"name": "SUBTEST_PROCESS",
16
"operation": "SUBPROCESS",
17
"subRequestFile": "./Resource/Process/Test/subprocessjson.json",
18
"assertions": {...}
19
}
20
]
Copied!
The content of the sub request file includes only the actions that will be performed.
An example of this content is provided in the Usage example section.

Sub request

Parameters

Parameter
Type
Description
actions
Action
List of actions that will be covered by the test
You can define one or several actions in this array.
assertions
Checks to be performed on the sub-request created during the test

Example

1
"subRequest": {
2
"actions": [...]
3
},
4
"assertions": {...}
Copied!

Parameter

Parameters

Parameter
Type
Description
name
String
Name of the data
numericValue
Float
Numeric value of the data
textValue
String
Text value of the data
dateTimeValue
String
Date/time value of the data
fileValue
File type value of the data

Examples

📌 Example of Test request parameters

1
"requestParameters": [
2
{
3
"name": "IN_TEXT",
4
"textValue": "Text"
5
},
6
{
7
"name": "IN_NUMERIC",
8
"numericValue": 11.1
9
},
10
{
11
"name": "IN_DATETIME",
12
"dateTimeValue": "1977-04-22T06:00:00Z"
13
},
14
{
15
"name": "IN_FILE",
16
"fileValue": {...}
17
}
18
]
Copied!

📌 Example of Test action parameters

1
"parameters": [
2
{
3
"name": "IN_TEXT",
4
"textValue": "Text"
5
},
6
{
7
"name": "IN_NUMERIC",
8
"numericValue": 11.1
9
},
10
{
11
"name": "IN_DATETIME",
12
"dateTimeValue": "1977-04-22T06:00:00Z"
13
},
14
{
15
"name": "IN_FILE",
16
"fileValue": {...}
17
}
18
]
Copied!

Action assertions

Parameters

Parameter
Type
Description
status
Enum
Expected completion status of the action to be performed
Possible values: OPEN or CLOSED
substatus
Enum
Expected sub status completion of the action that will be performed
Possible values: COMPLETED, ABORTED, RUNNING, or NOT_RUNNING_NOT_STARTED
data
Data
List of data to check for the tested action
The assertions node checks whether the data returned by the action is exactly the same as that specified in its parameters. If they don't match, the test will be evaluated as having failed.

Example

1
"assertions": {
2
"status": "CLOSED",
3
"subStatus": "COMPLETED",
4
"data": [...]
5
}
Copied!

Request assertions

Parameters

Parameter
Type
Description
completedActionCount
Int
Expected number of completed actions
status
Enum
Expected completion status of the request created during the test
Possible types: OPEN or CLOSED
substatus
Enum
Expected completion status of the request created during the test
Possible types: COMPLETED, ABORTED, RUNNING, or NOT_RUNNING_NOT_STARTED
data
Data
List of data to check for the request created during the test
The assertions node checks whether the data returned by the request created during the test is exactly the same as that specified in its parameters. If they don't match, the test will be evaluated as having failed.

Example

1
"assertions": {
2
"completedActionCount": 3,
3
"requestStatus": "CLOSED",
4
"requestSubStatus": "ABORTED",
5
"requestData": [...]
6
}
Copied!

Data

Parameters

Parameter
Type
Description
name
String
Name of the data
numericValue
Float
Numeric value of the data
textValue
Chaîne
Text value of the data
dateTimeValue
Chaîne
Date/time value of the data

Example

1
"requestData": [
2
{
3
"name": "REQUEST_SUBJECT",
4
"textValue": "OK"
5
},
6
{
7
"name": "COPYDATA_VALUE",
8
"textValue": "OK"
9
}
10
]
Copied!

File value

Parameters

Parameter
Type
Description
name
String
File name, including its extension
description
String
Description of the file
content
String
Content of the file encoded in base64
contentType
String
File content type
size
Int
File size in MB

Example

1
"fileValue": {
2
"content": "R3JhcGhRTCBGaWxl",
3
"contentType": "plain/text",
4
"description": "desc",
5
"name": "test.txt",
6
"size": 12
7
}
Copied!

Action exception

Parameters

Parameter
Type
Description
type
Enum
Type of exception to send
Possible values: ERROR or CANCEL
message
String
Error message to send to the action
source
String
Source of the exception to send to the action

Example

1
"exception": {
2
"type": "ERROR",
3
"message": "Message",
4
"source": "Source"
5
}
Copied!

Usage example

The process test command is based on a json file. This definition document allows you to define the flows that will be executed for your tests and the expected results. It consists of 10 different aspects.
Here's the workflow that we'll use for the explanations:

Test file

This is the content of the parent process test file:
1
{
2
"processName": "TEST_PROCESS",
3
"processVersion": 1,
4
"tests": [
5
{
6
"describe": "First test",
7
"requestParameters": [],
8
"actions": [
9
{
10
"name": "INITIATES",
11
"operation": "COMPLETE",
12
"parameters": [
13
{
14
"name": "REQUEST_SUBJECT",
15
"textValue": "OK"
16
}
17
],
18
"assertions": {
19
"status": "CLOSED",
20
"subStatus": "COMPLETED"
21
}
22
},
23
{
24
"name": "COPY_DATA",
25
"operation": "CHECK",
26
"timeout": 10,
27
"assertions": {
28
"status": "CLOSED",
29
"subStatus": "COMPLETED",
30
"data": [
31
{
32
"name": "COPYDATA_VALUE",
33
"textValue": "OK"
34
}
35
]
36
}
37
},
38
{
39
"name": "SUBTEST_PROCESS",
40
"operation": "SUBPROCESS",
41
"subRequestFile": "./Resource/Process/Test/subprocessjson.json",
42
"assertions": {
43
"status": "CLOSED",
44
"subStatus": "COMPLETED"
45
}
46
}
47
],
48
"assertions": {
49
"completedActionCount": 3,
50
"requestStatus": "CLOSED",
51
"requestSubStatus": "COMPLETED",
52
"requestData": [
53
{
54
"name": "REQUEST_SUBJECT",
55
"textValue": "OK"
56
},
57
{
58
"name": "COPYDATA_VALUE",
59
"textValue": "OK"
60
}
61
]
62
}
63
},
64
{
65
"describe": "Second test",
66
"requestParameters": [],
67
"actions": [
68
{
69
"name": "INITIATES",
70
"operation": "COMPLETE",
71
"parameters": [
72
{
73
"name": "REQUEST_SUBJECT",
74
"textValue": "OK"
75
}
76
]
77
},
78
{
79
"name": "COPY_DATA",
80
"operation": "CHECK",
81
"timeout": 10,
82
"assertions": {
83
"status": "CLOSED",
84
"subStatus": "COMPLETED",
85
"data": [
86
{
87
"name": "COPYDATA_VALUE",
88
"textValue": "OK"
89
}
90
]
91
}
92
},
93
{
94
"name": "SUBTEST_PROCESS",
95
"operation": "SUBPROCESS",
96
"subRequest": {
97
"actions": [
98
{
99
"name": "INITIATES",
100
"operation": "COMPLETE",
101
"parameters": [
102
{
103
"name": "REQUEST_SUBJECT",
104
"textValue": "OK"
105
}
106
]
107
},
108
{
109
"name": "VALIDATES",
110
"operation": "COMPLETE",
111
"parameters": [
112
{
113
"name": "APPROVAL_DECISION",
114
"textValue": "MORE_INFO"
115
}
116
]
117
},
118
{
119
"name": "UPDATES",
120
"operation": "COMPLETE",
121
"timeout": 5,
122
"parameters": [
123
{
124
"name": "REQUEST_SUBJECT",
125
"textValue": "OK"
126
}
127
]
128
},
129
{
130
"name": "VALIDATES",
131
"operation": "COMPLETE",
132
"parameters": [
133
{
134
"name": "APPROVAL_DECISION",
135
"textValue": "YES"
136
}
137
]
138
}
139
]
140
},
141
"assertions": {
142
"status": "CLOSED",
143
"subStatus": "COMPLETED"
144
}
145
}
146
],
147
"assertions": {
148
"completedActionCount": 3,
149
"requestStatus": "CLOSED",
150
"requestSubStatus": "COMPLETED",
151
"requestData": [
152
{
153
"name": "REQUEST_SUBJECT",
154
"textValue": "OK"
155
},
156
{
157
"name": "COPYDATA_VALUE",
158
"textValue": "OK"
159
}
160
]
161
}
162
},
163
{
164
"describe": "Third test",
165
"requestParameters": [],
166
"actions": [
167
{
168
"name": "INITIATES",
169
"operation": "COMPLETE",
170
"parameters": [
171
{
172
"name": "REQUEST_SUBJECT",
173
"textValue": "OK"
174
}
175
]
176
},
177
{
178
"name": "COPY_DATA",
179
"operation": "CHECK",
180
"timeout": 10,
181
"assertions": {
182
"status": "CLOSED",
183
"subStatus": "COMPLETED",
184
"data": [
185
{
186
"name": "COPYDATA_VALUE",
187
"textValue": "OK"
188
}
189
]
190
}
191
},
192
{
193
"name": "SUBTEST_PROCESS",
194
"operation": "SUBPROCESS",
195
"subRequest": {
196
"actions": [
197
{
198
"name": "INITIATES",
199
"operation": "COMPLETE",
200
"parameters": [
201
{
202
"name": "REQUEST_SUBJECT",
203
"textValue": "OK"
204
}
205
]
206
},
207
{
208
"name": "VALIDATES",
209
"operation": "CANCEL",
210
"exception": {
211
"type": "ERROR",
212
"message": "Message",
213
"source": "Source"
214
},
215
"assertions": {
216
"status": "CLOSED",
217
"subStatus": "ABORTED"
218
}
219
}
220
]
221
},
222
"assertions": {
223
"status": "CLOSED",
224
"subStatus": "ABORTED"
225
}
226
}
227
],
228
"assertions": {
229
"completedActionCount": 3,
230
"requestStatus": "CLOSED",
231
"requestSubStatus": "ABORTED",
232
"requestData": [
233
{
234
"name": "REQUEST_SUBJECT",
235
"textValue": "OK"
236
},
237
{
238
"name": "COPYDATA_VALUE",
239
"textValue": "OK"
240
}
241
]
242
}
243
},
244
{
245
"describe": "Fourth test",
246
"requestParameters": [],
247
"actions": [
248
{
249
"name": "INITIATES",
250
"operation": "COMPLETE",
251
"parameters": [
252
{
253
"name": "REQUEST_SUBJECT",
254
"textValue": "OK"
255
}
256
]
257
},
258
{
259
"name": "COPY_DATA",
260
"operation": "CHECK",
261
"timeout": 10,
262
"assertions": {
263
"status": "CLOSED",
264
"subStatus": "COMPLETED",
265
"data": [
266
{
267
"name": "COPYDATA_VALUE",
268
"textValue": "OK"
269
}
270
]
271
}
272
},
273
{
274
"name": "SUBTEST_PROCESS",
275
"operation": "SUBPROCESS",
276
"subRequest": {
277
"actions": [
278
{
279
"name": "INITIATES",
280
"operation": "COMPLETE",
281
"parameters": [
282
{
283
"name": "REQUEST_SUBJECT",
284
"textValue": "OK"
285
}
286
]
287
},
288
{
289
"name": "VALIDATES",
290
"operation": "CANCEL",
291
"assertions": {
292
"status": "CLOSED",
293
"subStatus": "ABORTED"
294
}
295
}
296
]
297
},
298
"assertions": {
299
"status": "CLOSED",
300
"subStatus": "ABORTED"
301
}
302
}
303
],
304
"assertions": {
305
"completedActionCount": 3,
306
"requestStatus": "CLOSED",
307
"requestSubStatus": "ABORTED",
308
"requestData": [
309
{
310
"name": "REQUEST_SUBJECT",
311
"textValue": "OK"
312
},
313
{
314
"name": "COPYDATA_VALUE",
315
"textValue": "OK"
316
}
317
]
318
}
319
}
320
],
321
"deleteRequest": false
322
}
Copied!

subRequestFile

This is the content of the subprocessjson.json test file, used in the first test for the SUBTEST_PROCESS action:
1
{
2
"actions": [
3
{
4
"name": "INITIATES",
5
"operation": "COMPLETE",
6
"parameters": [
7
{
8
"name": "REQUEST_SUBJECT",
9
"textValue": "OK"
10
}
11
]
12
},
13
{
14
"name": "VALIDATES",
15
"operation": "COMPLETE",
16
"parameters": [
17
{
18
"name": "APPROVAL_DECISION",
19
"textValue": "YES"
20
}
21
]
22
}
23
]
24
}
Copied!
Last modified 3mo ago