|
108 | 108 | "exec": [ |
109 | 109 | "pm.test(\"Status code is 401\", function () {\r", |
110 | 110 | " pm.response.to.have.status(401);\r", |
| 111 | + "});\r", |
| 112 | + "\r", |
| 113 | + "pm.test(\"Check error message\", function () {\r", |
| 114 | + " var jsonData = pm.response.json();\r", |
| 115 | + " pm.expect(jsonData.message).to.eql(\"The credentials are invalid.\");\r", |
111 | 116 | "});" |
112 | 117 | ], |
113 | 118 | "type": "text/javascript" |
|
235 | 240 | "exec": [ |
236 | 241 | "pm.test(\"Status code is 500\", function () {\r", |
237 | 242 | " pm.response.to.have.status(500);\r", |
| 243 | + "});\r", |
| 244 | + "\r", |
| 245 | + "pm.test(\"Check Error msg\", function () {\r", |
| 246 | + " var jsonData = pm.response.json();\r", |
| 247 | + " pm.expect(jsonData.message).to.eql(\"Oops! An Internal Error Occured.\");\r", |
238 | 248 | "});" |
239 | 249 | ], |
240 | 250 | "type": "text/javascript" |
|
274 | 284 | "exec": [ |
275 | 285 | "pm.test(\"Status code is 400\", function () {\r", |
276 | 286 | " pm.response.to.have.status(400);\r", |
| 287 | + "});\r", |
| 288 | + "\r", |
| 289 | + "pm.test(\"Check error message\", function () {\r", |
| 290 | + " var jsonData = pm.response.json();\r", |
| 291 | + " pm.expect(jsonData.message).to.eql(\"No name. No game.\");\r", |
277 | 292 | "});" |
278 | 293 | ], |
279 | 294 | "type": "text/javascript" |
|
0 commit comments