|
| 1 | +{ |
| 2 | + "name": "Performance api test", |
| 3 | + "testCases": { |
| 4 | + "missing_required": { |
| 5 | + "path": "/app-signals/workstreams/work_stream_1/targets/focus", |
| 6 | + "method": "post", |
| 7 | + "description": "When start_date and end date is missing", |
| 8 | + "body": { |
| 9 | + "page": 1, |
| 10 | + "per_page": 1 |
| 11 | + }, |
| 12 | + "expect": { |
| 13 | + "header": { |
| 14 | + "contains": { |
| 15 | + "Content-Type": "application/json; charset=utf-8", |
| 16 | + "http_response": "HTTP/1.1 422 Unprocessable Entity" |
| 17 | + }, |
| 18 | + "hasKey": ["http_status", "Date"] |
| 19 | + }, |
| 20 | + "body": { |
| 21 | + "eq": { |
| 22 | + "ByField": { |
| 23 | + "EndDate": [ |
| 24 | + { |
| 25 | + "Code": "C-INVALID_END_DATE", |
| 26 | + "Message": "end_date is a required field and should follow ISO8601 format." |
| 27 | + } |
| 28 | + ], |
| 29 | + "StartDate": [ |
| 30 | + { |
| 31 | + "Code": "C-INVALID_START_DATE", |
| 32 | + "Message": "start_date is a required field and should follow ISO8601 format." |
| 33 | + } |
| 34 | + ] |
| 35 | + } |
| 36 | + }, |
| 37 | + "hasKey": ["", "ByField"], |
| 38 | + "contains": { |
| 39 | + "ByField": { |
| 40 | + "EndDate": [ |
| 41 | + { |
| 42 | + "Code": "C-INVALID_END_DATE" |
| 43 | + } |
| 44 | + ] |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | + } |
| 49 | + }, |
| 50 | + "invalid_params": { |
| 51 | + "path": "/app-signals/workstreams/work_stream_1/targets/focus", |
| 52 | + "method": "post", |
| 53 | + "description": "When params are invalid", |
| 54 | + "body": { |
| 55 | + "start_date": "2020-0-01", |
| 56 | + "end_date": "2020-3-30", |
| 57 | + "target_ids": ["1", "2"], |
| 58 | + "page": 1, |
| 59 | + "per_page": 100 |
| 60 | + }, |
| 61 | + "expect": { |
| 62 | + "header": { |
| 63 | + "contains": { |
| 64 | + "Content-Type": "application/json; charset=utf-8", |
| 65 | + "http_response": "HTTP/1.1 422 Unprocessable Entity" |
| 66 | + }, |
| 67 | + "hasKey": ["http_status", "Date"] |
| 68 | + }, |
| 69 | + "body": { |
| 70 | + "eq": { |
| 71 | + "ByField": { |
| 72 | + "EndDate": [ |
| 73 | + { |
| 74 | + "Code": "C-INVALID_END_DATE", |
| 75 | + "Message": "end_date is a required field and should follow ISO8601 format." |
| 76 | + } |
| 77 | + ], |
| 78 | + "StartDate": [ |
| 79 | + { |
| 80 | + "Code": "C-INVALID_START_DATE", |
| 81 | + "Message": "start_date is a required field and should follow ISO8601 format." |
| 82 | + } |
| 83 | + ], |
| 84 | + "TargetIDs[0]": [ |
| 85 | + { |
| 86 | + "Code": "C-INVALID_ID_FORMAT", |
| 87 | + "Message": "The provided ID should be valid ID with length 36." |
| 88 | + } |
| 89 | + ], |
| 90 | + "TargetIDs[1]": [ |
| 91 | + { |
| 92 | + "Code": "C-INVALID_ID_FORMAT", |
| 93 | + "Message": "The provided ID should be valid ID with length 36." |
| 94 | + } |
| 95 | + ] |
| 96 | + } |
| 97 | + }, |
| 98 | + "hasKey": ["", "ByField"], |
| 99 | + "contains": { |
| 100 | + "ByField": { |
| 101 | + "EndDate": [ |
| 102 | + { |
| 103 | + "Code": "C-INVALID_END_DATE" |
| 104 | + } |
| 105 | + ] |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + }, |
| 111 | + "per_page": { |
| 112 | + "path": "/app-signals/workstreams/work_stream_1/targets/focus", |
| 113 | + "method": "post", |
| 114 | + "description": "When per page is 2", |
| 115 | + "body": { |
| 116 | + "start_date": "2020-01-01", |
| 117 | + "end_date": "2020-03-30", |
| 118 | + "page": 1, |
| 119 | + "per_page": 2 |
| 120 | + }, |
| 121 | + "header": {}, |
| 122 | + "expect": { |
| 123 | + "body": { |
| 124 | + "path_eq": { |
| 125 | + "data[0]": { |
| 126 | + "target_id": "1164", |
| 127 | + "mode": "focused", |
| 128 | + "duration": 1994, |
| 129 | + "target_name": "http://website1164.com" |
| 130 | + }, |
| 131 | + "data[1].target_id": 11738 |
| 132 | + }, |
| 133 | + "path_contains": { |
| 134 | + "data[0]": { |
| 135 | + "target_id": "1164" |
| 136 | + }, |
| 137 | + "data[1].target_id": 11738 |
| 138 | + } |
| 139 | + |
| 140 | + } |
| 141 | + } |
| 142 | + }, |
| 143 | + "parse_error": { |
| 144 | + "path": "/app-signals/workstreams/work_stream_1/targets/focus", |
| 145 | + "method": "post", |
| 146 | + "description": "When per page is 2", |
| 147 | + "body": { |
| 148 | + "start_date": "2020-01-01", |
| 149 | + "end_date": "2020-03-30", |
| 150 | + "page": "1", |
| 151 | + "per_page": 2 |
| 152 | + } |
| 153 | + }, |
| 154 | + "all_valid_test": { |
| 155 | + "path": "/app-signals/workstreams/work_stream_1/targets/focus", |
| 156 | + "method": "post", |
| 157 | + "description": "When params are invalid", |
| 158 | + "body": { |
| 159 | + "start_date": "2020-01-01", |
| 160 | + "end_date": "2020-03-30", |
| 161 | + "page": 1, |
| 162 | + "per_page": 100 |
| 163 | + }, |
| 164 | + "header": {}, |
| 165 | + "expect": { |
| 166 | + "header": { |
| 167 | + "contains": { |
| 168 | + "Content-Type": "application/json; charset=utf-8", |
| 169 | + "http_response": "HTTP/1.1 200 OK" |
| 170 | + }, |
| 171 | + "hasKey": ["Content-Type"] |
| 172 | + }, |
| 173 | + "body": { |
| 174 | + "hasKey": ["meta.total_duration", "data.99"], |
| 175 | + "contains": { "data": [], "meta": {} } |
| 176 | + } |
| 177 | + } |
| 178 | + } |
| 179 | + }, |
| 180 | + "url": "localhost:3304", |
| 181 | + "header": { |
| 182 | + "Authorization": "Bearer ACCESS_TOKEN : ID_TOKEN" |
| 183 | + } |
| 184 | +} |
0 commit comments