-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflexible_json_global.feature
41 lines (38 loc) · 1.3 KB
/
flexible_json_global.feature
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
# ignore new array elements for the feature by annotation
@bdd_lib_json_ignore_new_array_elements
Feature: Flexible JSON assert configuration
Background:
# ignore array order for this feature by background
Given that the response JSON can contain arrays in different order
Scenario: Compare JSON with different sorted JSON arrays set as global background
When executing a GET call to "/api/v1/jsonWithUnsortedArray"
Then I ensure that the response code is 200 and the body is equal to
"""
{
"unsorted": [
"First Element",
"Second Element",
"Last Element"
]
}
"""
Scenario: Compare JSON with response with extra array elements set as global annotation
When executing a GET call to "/api/v1/jsonWithUnsortedArray"
Then I ensure that the response code is 200 and the body is equal to
"""
{
"unsorted": [
"Last Element"
]
}
"""
Scenario: Compare JSON with response with extra array elements and unsorted order set as global annotation and background
When executing a GET call to "/api/v1/jsonWithUnsortedArray"
Then I ensure that the response code is 200 and the body is equal to
"""
{
"unsorted": [
"First Element"
]
}
"""