-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataLoad.postman_collection.json
More file actions
93 lines (93 loc) · 2.21 KB
/
Copy pathDataLoad.postman_collection.json
File metadata and controls
93 lines (93 loc) · 2.21 KB
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
{
"info": {
"_postman_id": "8ecfa48a-f368-4967-950e-b6373b8fae92",
"name": "DataLoad",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Booking",
"event": [
{
"listen": "test",
"script": {
"id": "549f86bc-1001-4118-9f97-f9d41b0224c6",
"type": "text/javascript",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"pm.test(\"Response time is less than 200ms\", function () {",
" pm.expect(pm.response.responseTime).to.be.below(50);",
"});"
]
}
},
{
"listen": "prerequest",
"script": {
"id": "edaadf8e-f1a3-4e50-b256-40e078967906",
"type": "text/javascript",
"exec": [
"/*",
"Note that restfulbooker-herokuapp.com is a shared resource",
"which resets every 10 minutes. Please run this on your local instance!!",
"*/",
"const createRequest = {",
" url: pm.environment.get(\"RB_URL\") + \"/booking\",",
" method: 'POST',",
" header: 'Content-Type:application/json',",
" body: {",
" mode: 'raw',",
" raw: JSON.stringify({",
" \"firstname\" : \"Sally\",",
" \"lastname\" : \"Brown\",",
" \"totalprice\" : 125,",
" \"depositpaid\" : true,",
" \"additionalneeds\" : \"Breakfast\",",
" \"bookingdates\" : {",
" \"checkin\" : \"2018-10-23\",",
" \"checkout\" : \"2018-10-25\"",
" }",
"})",
" }",
"};",
"for(var i = 0; i < 100; i++){",
" pm.sendRequest(createRequest, function (err, res) {",
" console.log(err ? err : res.json());",
" });",
"}"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{RB_URL}}/booking?firstname=Mark",
"host": [
"{{RB_URL}}"
],
"path": [
"booking"
],
"query": [
{
"key": "firstname",
"value": "Mark"
}
]
}
},
"response": []
}
]
}