/
jsondata.suite.yml
107 lines (99 loc) · 2.68 KB
/
jsondata.suite.yml
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
meta:
name: verifying JSON data suite
configuration:
scheme: http
host: 127.0.0.1
port: 3027
specs:
- name: validate json response with json data functionality
request: &default_request
path: /echoJSONBodyResponse
method: post
headers:
- name: content-type
value: application/json
payload:
body:
type: json
content: &default_json_content
key1: value1
key2: value2
keyn: 4
keyBoolean: false
keyNull: null
response:
json_data:
- path: $.key2
value: value2
- path: $.keyBoolean
value: false
- path: $.keyNull
value: null
- name: validate json response with json data functionality - should fail
request: *default_request
response:
json_data:
- path: $.key2
value: wrongvalue
- name: validate json response with json data functionality regex
request: *default_request
response:
json_data:
- path: $.key2
value: !!js/regexp /value(\d)/
- name: should fail when json data regex does not match the value
request: *default_request
response:
json_data:
- path: $.key2
value: !!js/regexp /valuex(\d)/
- name: validate json response with multiple json data expectations
request: *default_request
response:
json_data:
- path: $.key2
value: !!js/regexp /value(\d)/
- path: $.key1
value: value1
- path: $.keyn
value: 4
- name: validate json response with json data value as object
request: *default_request
response:
json_data:
- path: $
value: *default_json_content
- name: validate json response with json data value as non matching object - should fail
request: *default_request
response:
json_data:
- path: $
value:
<<: *default_json_content
key2: value3
- name: validate json response with json data value as Array
request: &array_json_request
path: /echoJSONBodyResponse
method: post
headers:
- name: content-type
value: application/json
payload:
body:
type: json
content: &array_json_content
- item1
- item2
response:
json_data:
- path: $
value: *array_json_content
- name: validate json response with json data value as non matching Array - should fail
request: *array_json_request
response:
json_data:
- path: $
value:
- item1
- item2
- item3