-
Notifications
You must be signed in to change notification settings - Fork 4
/
Github_Api.postman_collection.json
94 lines (94 loc) · 2.49 KB
/
Github_Api.postman_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
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
{
"info": {
"name": "Github Api",
"_postman_id": "761f07cf-a72d-6fcf-2b54-7c8d6aa45552",
"description": "This is a collection for the Github API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Github Root APi",
"description": "This folder contains github Api's",
"item": [
{
"name": "Github Root APi Request",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const jsonData = JSON.parse(responseBody);",
"const usersURL = \"https://api.github.com/user\"",
"const emailsURL = \"https://api.github.com/user/emails\"",
"const followersURL = \"https://api.github.com/user/followers\"",
"const followingURL = \"https://api.github.com/user/following{/target}\"",
"",
"let {current_user_url, emails_url, followers_url, following_url} = jsonData",
"",
"// Tests go here",
"tests[\"Gets the correct users url\"] = current_user_url === usersURL;",
"tests[\"Gets the correct emails url\"] = emails_url === emailsURL;",
"tests[\"Gets the correct followers url\"] = followers_url === followersURL;",
"tests[\"Gets the correct following url\"] = following_url === followingURL;"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{base_url}}",
"host": [
"{{base_url}}"
]
},
"description": ""
},
"response": []
},
{
"name": "Github User API Request",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const jsonData = JSON.parse(responseBody);",
"",
"const { login } = jsonData;",
"",
"tests[\"Gets the correct username\"] = login === \"scotch-io\";",
"",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{base_url}}/users/{{user_name}}",
"host": [
"{{base_url}}"
],
"path": [
"users",
"{{user_name}}"
]
},
"description": ""
},
"response": []
}
]
}
]
}