-
Notifications
You must be signed in to change notification settings - Fork 0
/
NPM test Postive -Negative.txt
400 lines (328 loc) · 18.2 KB
/
NPM test Postive -Negative.txt
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
PS C:\Users\aelya\OneDrive\Bureaublad\bed-final-repository> npm test
> express-bookings@1.0.0 test
> npm run test-positive && npm run test-negative
> express-bookings@1.0.0 test-positive
> newman run "./postman/collections/Bookings API.json" -e "./postman/environments/Local.postman_environment.json"
newman
Bookings API
□ users / {userId}
└ Get user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 356ms]
GET http://0.0.0.0:3000/users/e5678901-23f0-1234-5678-9abcdef01234 [200 OK, 475B, 187ms]
√ Response status code is 200
√ Id should be a non-empty string
└ Update user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 151ms]
PUT http://0.0.0.0:3000/users/e5678901-23f0-1234-5678-9abcdef01234 [200 OK, 319B, 350ms]
√ Response status code is 200
└ Delete user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 136ms]
DELETE http://0.0.0.0:3000/users/e5678901-23f0-1234-5678-9abcdef01234 [200 OK, 583B, 300ms]
√ Response status code is 200
□ users
└ Get all users
POST http://0.0.0.0:3000/login [200 OK, 412B, 150ms]
GET http://0.0.0.0:3000/users [200 OK, 1.17kB, 153ms]
√ Response status code is 200
√ Response is an array
└ Create a new user
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
POST http://0.0.0.0:3000/users [201 Created, 644B, 192ms]
√ Response status code is 201
□ hosts / {hostId}
└ Get host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 135ms]
GET http://0.0.0.0:3000/hosts/e2345678-90bc-def0-0123-456789abcdef [200 OK, 575B, 125ms]
√ Response status code is 200
√ ID is a non-empty string
└ Update host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 147ms]
PUT http://0.0.0.0:3000/hosts/e2345678-90bc-def0-0123-456789abcdef [200 OK, 319B, 216ms]
√ Response status code is 200
└ Delete host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 129ms]
DELETE http://0.0.0.0:3000/hosts/e2345678-90bc-def0-0123-456789abcdef [200 OK, 619B, 333ms]
√ Response status code is 200
□ hosts
└ Get all hosts
POST http://0.0.0.0:3000/login [200 OK, 412B, 163ms]
GET http://0.0.0.0:3000/hosts [200 OK, 1.59kB, 130ms]
√ Response status code is 200
√ Response body is an array
└ Create a new host
POST http://0.0.0.0:3000/login [200 OK, 412B, 139ms]
POST http://0.0.0.0:3000/hosts [201 Created, 655B, 208ms]
√ Response status code is 201
□ properties / {propertyId}
└ Get property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 128ms]
GET http://0.0.0.0:3000/properties/i1234567-89f0-1234-5678-9abcdef01234 [200 OK, 566B, 121ms]
√ Response status code is 200
√ Id should be a non-empty string
└ Update property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
PUT http://0.0.0.0:3000/properties/i1234567-89f0-1234-5678-9abcdef01234 [200 OK, 323B, 214ms]
√ Response status code is 200
└ Delete property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 145ms]
DELETE http://0.0.0.0:3000/properties/i1234567-89f0-1234-5678-9abcdef01234 [200 OK, 655B, 256ms]
√ Response status code is 200
□ properties
└ Get all properties
POST http://0.0.0.0:3000/login [200 OK, 412B, 137ms]
GET http://0.0.0.0:3000/properties [200 OK, 1.24kB, 154ms]
√ Response status code is 200
√ Response is an array with at least one element
√ maxGuestCount is a non-negative integer
└ Create a new property
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
POST http://0.0.0.0:3000/properties [201 Created, 685B, 202ms]
√ Response status code is 201
□ amenities / {amenityId}
└ Get amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 128ms]
GET http://0.0.0.0:3000/amenities/u3456789-01rs-tuvw-01cd-ef0123456789 [200 OK, 302B, 131ms]
√ Response status code is 200
√ Response has the required fields - id and name
√ id is a non-empty string
√ Name should be a non-empty string
└ Update amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 144ms]
PUT http://0.0.0.0:3000/amenities/u3456789-01rs-tuvw-01cd-ef0123456789 [200 OK, 322B, 232ms]
√ Response status code is 200
└ Delete amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 136ms]
DELETE http://0.0.0.0:3000/amenities/u3456789-01rs-tuvw-01cd-ef0123456789 [200 OK, 401B, 199ms]
√ Response status code is 200
□ amenities
└ Get all amenities
POST http://0.0.0.0:3000/login [200 OK, 412B, 134ms]
GET http://0.0.0.0:3000/amenities [200 OK, 796B, 135ms]
√ Response status code is 200
√ Response is an array with at least one element
√ Each element in the response has the required fields - id and name
√ The id must be a non-empty string
√ Name is a non-empty string
└ Create a new amenity
POST http://0.0.0.0:3000/login [200 OK, 412B, 134ms]
POST http://0.0.0.0:3000/amenities [201 Created, 351B, 199ms]
√ Response status code is 201
□ bookings / {bookingId}
└ Get booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 132ms]
GET http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [200 OK, 1.21kB, 183ms]
√ Response status code is 200
√ Id should be a non-empty string
√ userId is a non-empty string
√ propertyId should be a non-empty string
└ Update booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 135ms]
PUT http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [200 OK, 322B, 216ms]
√ Response status code is 200
└ Delete booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 147ms]
DELETE http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [200 OK, 625B, 203ms]
√ Response status code is 200
□ bookings
└ Get all bookings
POST http://0.0.0.0:3000/login [200 OK, 412B, 149ms]
GET http://0.0.0.0:3000/bookings [200 OK, 529B, 151ms]
√ Response status code is 200
√ Response is an array
√ Id should be a non-empty string
√ userId is a non-empty string
└ Create a new booking
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
POST http://0.0.0.0:3000/bookings [201 Created, 534B, 203ms]
√ Response status code is 201
□ reviews / {reviewId}
└ Get review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 125ms]
GET http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [200 OK, 477B, 131ms]
√ Response status code is 200
√ Response has the required fields
√ Id is a non-empty string
√ userId is a non-empty string
√ propertyId is a non-empty string
└ Update review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 136ms]
PUT http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [200 OK, 321B, 216ms]
√ Response status code is 200
└ Delete review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 126ms]
DELETE http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [200 OK, 534B, 184ms]
√ Response status code is 200
□ reviews
└ Get all reviews
POST http://0.0.0.0:3000/login [200 OK, 412B, 138ms]
GET http://0.0.0.0:3000/reviews [200 OK, 898B, 130ms]
√ Response status code is 200
√ Response is an array with at least one element
√ Id is a non-empty string
√ userId is a non-empty string
√ propertyId is a non-empty string
└ Create a new review
POST http://0.0.0.0:3000/login [200 OK, 412B, 137ms]
POST http://0.0.0.0:3000/reviews [201 Created, 572B, 198ms]
√ Response status code is 201
→ User Login
POST http://0.0.0.0:3000/login [200 OK, 412B, 128ms]
POST http://0.0.0.0:3000/login [200 OK, 412B, 135ms]
√ Response status code is 200
√ Response has the required field 'token'
√ Token is a non-empty string
┌─────────────────────────┬────────────────────┬────────────────────┐
│ │ executed │ failed │
├─────────────────────────┼────────────────────┼────────────────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│ requests │ 62 │ 0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│ test-scripts │ 62 │ 0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│ prerequest-scripts │ 31 │ 0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│ assertions │ 61 │ 0 │
├─────────────────────────┴────────────────────┴────────────────────┤
│ total run duration: 13.8s │
├───────────────────────────────────────────────────────────────────┤
│ total data received: 17.11kB (approx) │
├───────────────────────────────────────────────────────────────────┤
│ average response time: 168ms [min: 121ms, max: 356ms, s.d.: 54ms] │
└───────────────────────────────────────────────────────────────────┘
> express-bookings@1.0.0 test-negative
> newman run "./postman/collections/Bookings API Negative.json" -e "./postman/environments/Local.postman_environment.json"
newman
Bookings API Negative
□ users / {userId}
└ Get user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 251ms]
GET http://0.0.0.0:3000/users/:userId [404 Not Found, 286B, 132ms]
√ Response status code is 404
└ Update user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 127ms]
PUT http://0.0.0.0:3000/users/d4567890-12 [404 Not Found, 290B, 169ms]
√ Response status code is 404
└ Delete user by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 131ms]
DELETE http://0.0.0.0:3000/users/d4567890-12ef-01 [404 Not Found, 295B, 154ms]
√ Response status code is 404
□ users
└ Create a new user
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
POST http://0.0.0.0:3000/users [400 Bad Request, 277B, 119ms]
√ Response status code is 400
□ hosts / {hostId}
└ Get host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 139ms]
GET http://0.0.0.0:3000/hosts/:hostId [404 Not Found, 286B, 41ms]
√ Response status code is 404
└ Update host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 133ms]
PUT http://0.0.0.0:3000/hosts/:hostId [404 Not Found, 286B, 169ms]
√ Response status code is 404
└ Delete host by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 129ms]
DELETE http://0.0.0.0:3000/hosts/:hostId [404 Not Found, 286B, 156ms]
√ Response status code is 404
□ hosts
└ Create a new host
POST http://0.0.0.0:3000/login [200 OK, 412B, 136ms]
POST http://0.0.0.0:3000/hosts [400 Bad Request, 277B, 117ms]
√ Response status code is 400
□ properties / {propertyId}
└ Get property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 135ms]
GET http://0.0.0.0:3000/properties/h0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 319B, 36ms]
√ Response status code is 404
└ Update property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 146ms]
PUT http://0.0.0.0:3000/properties/h0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 319B, 167ms]
√ Response status code is 404
└ Delete property by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 126ms]
DELETE http://0.0.0.0:3000/properties/h0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 319B, 164ms]
√ Response status code is 404
□ properties
└ Create a new property
POST http://0.0.0.0:3000/login [200 OK, 412B, 129ms]
POST http://0.0.0.0:3000/properties [400 Bad Request, 280B, 10ms]
√ Response status code is 400
□ amenities / {amenityId}
└ Get amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 145ms]
GET http://0.0.0.0:3000/amenities/t2345678-90qr-stu [404 Not Found, 299B, 133ms]
√ Response status code is 404
└ Update amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 129ms]
PUT http://0.0.0.0:3000/amenities/t2345678-90qr-st [404 Not Found, 298B, 169ms]
√ Response status code is 404
└ Delete amenity by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 146ms]
DELETE http://0.0.0.0:3000/amenities/bc-def012345678 [404 Not Found, 297B, 153ms]
√ Response status code is 404
□ amenities
└ Create a new amenity
POST http://0.0.0.0:3000/login [200 OK, 412B, 129ms]
POST http://0.0.0.0:3000/amenities [400 Bad Request, 379B, 99ms]
√ Response status code is 400
□ bookings / {bookingId}
└ Get booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 132ms]
GET http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [404 Not Found, 318B, 135ms]
√ Response status code is 404
└ Update booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 136ms]
PUT http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [404 Not Found, 318B, 153ms]
√ Response status code is 404
└ Delete booking by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 150ms]
DELETE http://0.0.0.0:3000/bookings/f0123456-78ab-cdef-0123-456789abcdef [404 Not Found, 318B, 167ms]
√ Response status code is 404
□ bookings
└ Create a new booking
POST http://0.0.0.0:3000/login [200 OK, 412B, 130ms]
POST http://0.0.0.0:3000/bookings [400 Bad Request, 309B, 9ms]
√ Response status code is 400
□ reviews / {reviewId}
└ Get review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 142ms]
GET http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 317B, 136ms]
√ Response status code is 404
└ Update review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 134ms]
PUT http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 317B, 167ms]
√ Response status code is 404
└ Delete review by ID
POST http://0.0.0.0:3000/login [200 OK, 412B, 141ms]
DELETE http://0.0.0.0:3000/reviews/j0123456-78f0-1234-5678-9abcdef01234 [404 Not Found, 317B, 150ms]
√ Response status code is 404
□ reviews
└ Create a new review
POST http://0.0.0.0:3000/login [200 OK, 412B, 130ms]
POST http://0.0.0.0:3000/reviews [400 Bad Request, 456B, 117ms]
√ Response status code is 400
→ User Login
POST http://0.0.0.0:3000/login [200 OK, 412B, 132ms]
POST http://0.0.0.0:3000/login [401 Unauthorized, 278B, 132ms]
√ Response status code is 401
┌─────────────────────────┬───────────────────┬───────────────────┐
│ │ executed │ failed │
├─────────────────────────┼───────────────────┼───────────────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼───────────────────┼───────────────────┤
│ requests │ 50 │ 0 │
├─────────────────────────┼───────────────────┼───────────────────┤
│ test-scripts │ 50 │ 0 │
├─────────────────────────┼───────────────────┼───────────────────┤
│ prerequest-scripts │ 25 │ 0 │
├─────────────────────────┼───────────────────┼───────────────────┤
│ assertions │ 25 │ 0 │
├─────────────────────────┴───────────────────┴───────────────────┤
│ total run duration: 9.2s │
├─────────────────────────────────────────────────────────────────┤
│ total data received: 6.07kB (approx) │
├─────────────────────────────────────────────────────────────────┤
│ average response time: 132ms [min: 9ms, max: 251ms, s.d.: 38ms] │
└─────────────────────────────────────────────────────────────────┘
PS C:\Users\aelya\OneDrive\Bureaublad\bed-final-repository>