PMJobs.robot 22.2 KB
Newer Older
1
2
*** Settings ***
Library           JSONSchemaLibrary    schemas/
3
Resource          environment/variables.txt    # Generic Parameters
4
5
Library           JSONLibrary
Library           OperatingSystem
6
Library           String
7
Resource          environment/pmJobs.txt
Elian Kraja's avatar
Elian Kraja committed
8
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Elian Kraja's avatar
Elian Kraja committed
9
Library           MockServerLibrary
10
11

*** Test Cases ***
12
13
14
15
16
GET all VNF Performance Monitoring Jobs
    [Documentation]    Test ID: 7.3.4.1.1
    ...    Test title: GET all VNF Performance Monitoring Jobs
    ...    Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
17
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
18
19
20
21
22
23
24
25
26
27
28
29
30
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body Does Not Contain reports

GET VNF Performance Monitoring Jobs with attribute-based filter
    [Documentation]    Test ID: 7.3.4.1.2
    ...    Test title: GET all VNF Performance Monitoring Jobs with attribute-based filter
    ...    Test objective: The objective is to test the retrieval of VNF performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued attribute-based filter
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
31
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
32
33
34
35
36
37
38
39
40
41
42
43
44
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with attribute-based filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested attribute-based filter

GET all VNF Performance Monitoring Jobs with all_fields attribute selector
    [Documentation]    Test ID: 7.3.4.1.3
    ...    Test title: GET all VNF Performance Monitoring Jobs with all_fields attribute selector
    ...    Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs all_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued all_fileds selector
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
45
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
46
47
48
49
50
51
52
53
54
55
56
57
58
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with all_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested all_fields selector

GET all VNF Performance Monitoring Jobs with exclude_default attribute selector
    [Documentation]    Test ID: 7.3.4.1.4
    ...    Test title: GET all VNF Performance Monitoring Jobs with exclude_default attribute selector
    ...    Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_default selector
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
59
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
60
61
62
63
64
65
66
67
68
69
70
71
72
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with exclude_default attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested exclude_default selector

GET all VNF Performance Monitoring Jobs with fields attribute selector
    [Documentation]    Test ID: 7.3.4.1.5
    ...    Test title: GET all VNF Performance Monitoring Jobs with fields attribute selector
    ...    Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued fields selector
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
73
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
74
75
76
77
78
79
80
81
82
83
84
85
86
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: The VNFM supports the use of exclude_fields attribute selector
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested fields selector

GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector
    [Documentation]    Test ID: 7.3.4.1.6
    ...    Test title: GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector
    ...    Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_fields selector
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
87
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
88
89
90
91
92
93
94
95
96
97
98
99
100
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: The VNFM supports the use of exclude_fields attribute selector
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with exclude_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested exclude_fields selector

GET VNF Performance Monitoring Jobs with invalid attribute-based filter
    [Documentation]    Test ID: 7.3.4.1.7
    ...    Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter
    ...    Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
101
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
102
103
104
105
106
107
108
109
110
111
112
113
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with invalid attribute-based filter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails

GET VNF Performance Monitoring Jobs with invalid resource endpoint
    [Documentation]    Test ID: 7.3.4.1.8
    ...    Test title: GET VNF Performance Monitoring Jobs with invalid resource endpoint
    ...    Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
114
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
115
116
117
118
119
120
121
122
123
124
125
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with invalid resource endpoint
    Check HTTP Response Status Code Is    404

Create new VNF Performance Monitoring Job
    [Documentation]    Test ID: 7.3.4.1.9
    ...    Test title:  Create a new VNF Performance Monitoring Job
    ...    Test objective: The objective is to test the creation of a new VNF performance monitoring job and perform the JSON schema validation of the returned job data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
126
    ...    Reference: Clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
127
128
129
130
131
132
133
134
135
136
137
138
139
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Job is successfully created on the VNFM
    Send Post Request Create new VNF Performance Monitoring Job
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is   PmJob
    Check Postcondition PmJob Exists

PUT all VNF Performance Monitoring Jobs - Method not implemented
    [Documentation]    Test ID: 7.3.4.1.10
    ...    Test title: PUT all VNF Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify VNF Performance Monitoring Jobs
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
140
    ...    Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
141
142
143
144
145
146
147
148
149
150
151
    ...    Config ID: Config_prod_VE
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PUT Request for all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    405
    
PATCH all VNF Performance Monitoring Jobs - (Method not implemented)
    [Documentation]    Test ID: 7.3.4.1.11
    ...    Test title: PATCH all VNF Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update VNF Performance Monitoring Jobs
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
152
    ...    Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
153
154
155
156
157
158
159
160
161
162
163
    ...    Config ID: Config_prod_VE
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH Request for all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    405
    
DELETE all VNF Performance Monitoring Jobs - Method not implemented
    [Documentation]    Test ID: 7.3.4.1.12
    ...    Test title: DELETE all VNF Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to update VNF Performance Monitoring Jobs
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
164
    ...    Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
165
166
167
168
169
170
171
    ...    Config ID: Config_prod_VE
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH Request for all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Monitoring Jobs Exist
    
172
173
174
175
176
GET all VNF Performance Monitoring Jobs as Paged Response
    [Documentation]    Test ID: 7.3.4.1.13
    ...    Test title: GET all VNF Performance Monitoring Jobs as Paged Response
    ...    Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs as Paged Response.
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
177
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
178
179
180
181
182
183
184
185
186
187
188
189
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    
GET VNF Performance Monitoring Jobs - Bad Request Response too Big
    [Documentation]    Test ID: 7.3.4.1.14
    ...    Test title: GET VNF Performance Monitoring Jobs - Bad Request Response too Big
    ...    Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
Michele Carignani's avatar
Michele Carignani committed
190
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
191
192
193
194
195
196
197
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all VNF Performance Monitoring Jobs
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
198
199
*** Keywords ***
GET all VNF Performance Monitoring Jobs
200
    Log    Trying to get all PM Jobs present in the VNFM
201
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
202
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
203
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs
204
205
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
206

207
GET VNF Performance Monitoring Jobs with attribute-based filter
208
    Log    Trying to get all PM Jobs present in the VNFM, using filter params
209
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
210
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
211
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${POS_FILTER}
212
213
214
215
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET VNF Performance Monitoring Jobs with all_fields attribute selector
216
    Log    Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter
217
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
218
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
219
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?all_fields
220
221
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
222

223
GET VNF Performance Monitoring Jobs with exclude_default attribute selector
224
225
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
226
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
227
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?exclude_default
228
229
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
230

231
GET VNF Performance Monitoring Jobs with fields attribute selector
232
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
Giacomo Bernini's avatar
fixes    
Giacomo Bernini committed
233
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
234
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
235
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
236
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
237
238
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
239

240
GET VNF Performance Monitoring Jobs with exclude_fields attribute selector
241
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
Giacomo Bernini's avatar
fixes    
Giacomo Bernini committed
242
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
243
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
244
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
245
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
246
247
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
248

249
GET VNF Performance Monitoring Jobs with invalid attribute-based filter
250
251
    Log    Trying to get all PM Jobs present in the VNFM, using an erroneous filter param
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
252
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
253
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER}
254
255
256
257
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET VNF Performance Monitoring Jobs with invalid resource endpoint    
258
    Log    Trying to perform a GET on a erroneous URI
259
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
260
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
261
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_job    # wrong URI /pm_job instead of /pm_jobs
262
263
264
265
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request Create new VNF Performance Monitoring Job
266
    Log    Creating a new PM Job
267
268
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
269
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
270
    ${body}=    Get File    jsons/CreatePmJobRequest.json
271
    POST    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs    ${body}
272
273
274
275
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PUT Request for all VNF Performance Monitoring Jobs 
276
    Log    Trying to perform a PUT. This method should not be implemented
277
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
278
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
279
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs
280
281
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
282

283
284
285
286
287
288
289
290
291
292
Send PATCH Request for all VNF Performance Monitoring Jobs 
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send DELETE Request for all VNF Performance Monitoring Jobs 
    Log    Trying to perform a PUT. This method should not be implemented
293
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
294
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
295
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs
296
297
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
298

299
300
301
302
303
304
Check Postcondition VNF Performance Monitoring Jobs Exist
    Log    Checking that Pm Job still exists
    GET all VNF Performance Monitoring Jobs
    
Check Postcondition PmJob Exists
    Log    Checking that Pm Job exists
305
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
306
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${response['body']['id']}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PmJob
    
Check HTTP Response Body PmJobs Matches the requested exclude_fields selector
    Log    Checking that reports element is missing
    ${reports}=    Get Value From Json    ${response['body']}    $..reports
    Should Be Empty    ${reports}
    Log    Checking that reports element is missing
    ${criteria}=    Get Value From Json    ${response['body']}    $..criteria
    Should Be Empty    ${criteria}
    Log    Reports element is empty as expected

Check HTTP Response Body PmJobs Matches the requested fields selector
    Log    Trying to validate criteria schema
    ${criteria}=    Get Value From Json    ${response['body']}    $..criteria
325
    Validate Json    criteria.schema.json    ${criteria}
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
    Log    Validation for criteria schema OK
    Log    Trying to validate criteria schema
    ${reports}=    Get Value From Json    ${response['body']}    $..reports
    Validate Json    reports.schema.json    ${reports[0]}
    Log    Validation for reports schema OK
    
Check HTTP Response Body PmJobs Matches the requested exclude_default selector
    Log    Checking that reports element is missing
    ${reports}=    Get Value From Json    ${response['body']}    $..reports
    Should Be Empty    ${reports}
    Log    Reports element is empty as expected

Check HTTP Response Body PmJobs Matches the requested all_fields selector
    Log    Trying to validate criteria schema
    ${criteria}=    Get Value From Json    ${response['body']}    $..criteria
341
    Validate Json    criteria.schema.json    ${criteria}
342
343
344
345
346
347
348
349
350
351
352
353
    Log    Validation for criteria schema OK
    Log    Trying to validate criteria schema
    ${reports}=    Get Value From Json    ${response['body']}    $..reports
    Validate Json    reports.schema.json    ${reports[0]}
    Log    Validation for reports schema OK
    Log    Validating _links schema
    ${links}=    Get Value From Json    ${response['body']}    $.._links
    Validate Json    links.schema.json    ${links[0]}
    Log    Validation for _links schema OK
    
Check HTTP Response Body PmJobs Matches the requested Attribute-Based Filter 
    Log    Checking that attribute-based filter is matched
Najam UI Hassan's avatar
Najam UI Hassan committed
354
355
    @{words} =  Split String    ${POS_FILTER}       ,${SEPERATOR} 
    Should Be Equal As Strings    ${response['body'][0]['objectInstanceIds']}    @{words}[1]
356
357
358
359
360
361
362
363
364
365

Check HTTP Response Body Does Not Contain reports
    Log    Checking that field element is missing
    ${reports}=    Get Value From Json    ${response['body']}    $..reports
    Should Be Empty    ${reports}
    Log    Reports element is empty as expected
    
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    ${status}=    Convert To Integer    ${expected_status}    
Elian Kraja's avatar
Elian Kraja committed
366
    Should Be Equal As Strings    ${response['status']}    ${status} 
367
368
369
370
371
    Log    Status code validated
    
Check HTTP Response Status Code Is 40x  
    Should Contain Any    ${response['status']}    401    403
    Log    Status code validated
372

373
374
375
376
377
378
379
380
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    Should Contain    ${response['headers']['Content-Type']}    application/json
381
    ${schema} =    Catenate    SEPARATOR=    ${input}    .schema.json
382
383
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
384
385
    
Check LINK in Header
Elian Kraja's avatar
Elian Kraja committed
386
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
387
    Should Not Be Empty    ${linkURL}