-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_collection.json
48 lines (48 loc) · 1.23 KB
/
api_collection.json
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
{
"variables": [],
"info": {
"name": "API-newmn-POC | https://api.agify.io",
"_postman_id": "5d604721-fce3-a7y8-635c-fbbf5744a888",
"description": "Input = NAME | Output = AGE",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "GET: `AGE` from `Name`",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"",
"console.log(\"Entered NAME is\" , data.name)",
"",
"// using pm.response.to.have",
"pm.test(\"Response status code to be 200\", function () {",
" pm.response.to.have.status(\"OK\");",
"});",
"",
"var jsonData = JSON.parse(responseBody);",
"tests['Response has data `name`'] = jsonData.name === data.name",
"",
"// Use values from Response",
"console.log(\"Predicted AGE is :\" ,jsonData.age)",
"console.log(\"# of search with same name :\" ,jsonData.count)",
""
]
}
}
],
"request": {
"url": "{{url}}?name={{name}}",
"method": "GET",
"header": [],
"body": {
},
"description": "The value of `name` is coming from test_data.csv file "
},
"response": []
}
]
}