-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREQRES.IN APIs ITI Project.postman_collection.json
779 lines (779 loc) · 28.7 KB
/
REQRES.IN APIs ITI Project.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
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
{
"info": {
"_postman_id": "a29aaf11-3150-403b-bf00-ffd60be59b92",
"name": "REQRES.IN APIs ITI Project",
"description": "API testing project using Postman for the reqres.in API\n\n**What is an API?**: \nAPI is an acronym and it stands for Application Programming Interface. API is a set of routines, protocols, and tools for building Software Applications. APIs specify how one software program should interact with other software programs.\n\nRoutine: a program that performs a particular task. Routine is also known as procedure, function, or subroutine.\n\nProtocols: A format for transmitting data between two systems.\n\nIn simple words, API stands for Application Programming Interface. API acts as an interface between two software applications and allows the two software applications to communicate with each other. API is a collection of software functions that can be executed by another software program.\n\n**What is Automation Testing?** \nAutomation Testing is a software testing technique that performs using special automated testing software tools to execute a test case suite. On the contrary,Manual Testing is performed by a human sitting in front of a computer carefully executing the test steps. \nThe automation testing software can also enter test data into the System Under Test, compare expected and actual results and generate detailed test reports.Software Test Automation demands considerable investments of money and resources. \nSuccessive development cycles will require execution of same test suite repeatedly. Using a test automation tool, it’s possible to record this test suite and re-play it as required. Once the test suite is automated, no human intervention is required. This improved ROI of Test Automation. The goal of Automation is to reduce the number of test cases to be run manually and not to eliminate Manual Testing altogether.\n\nLet’s see some examples of an API in a more approachable way.\n\nAssume an API as a Waiter at a Restaurant.\n\nAt a restaurant, you give an order based on the items available on the menu. A waiter in the restaurant writes down your order and delivers it to the kitchen who prepares your meal. Once the meal is ready, the waiter picks up your food from the kitchen and serves it to you at your table.\n\nIn this scenario, the waiter’s role is similar to an API. As a waiter, the API takes a request from a source, takes that request to the database, fetches the requested data from the database, and returns a response to the source.\n\nNow let’s see another example.\n\nIf you are using a flight service engine say Expedia, where you search for flights on a specific date. Once you pass the data such as Source, Destination, Onward Date, and Return Date and click on search. Expedia sends a request to airlines through an API as per your search details. The API then takes the airline’s response to your request and delivers it right back to Expedia.\n\n**What is API Testing?** \nAPI testing is a type of software testing that involves testing APIs directly and also as a part of integration testing to check whether the API meets expectations in terms of functionality, reliability, performance, and security of an application. In API Testing our main focus will be on a Business logic layer of the software architecture. API testing can be performed on any software system which contains multiple APIs. API testing won’t concentrate on the look and feel of the application. API testing is entirely different from GUI Testing.\n\n**API Testing Types?** \nAPI testing typically involves the following practices:\n\n- Unit testing: To test the functionality of individual operation\n \n- Functional testing: To test the functionality of broader scenarios by using a block of unit test results tested together\n \n- Load testing: To test the functionality and performance under load\n \n- Runtime/Error Detection: To monitor an application to identify problems such as exceptions and resource leaks\n \n- Security testing: To ensure that the implementation of the API is secure from external threats\n \n- UI testing: It is performed as part of end-to-end integration tests to make sure every aspect of the user interface functions as expected\n \n- Interoperability and WS Compliance testing: Interoperability and WS Compliance Testing is a type of testing that applies to SOAP APIs. Interoperability between SOAP APIs is checked by ensuring conformance to the Web Services Interoperability profiles. WS-\\* compliance is tested to ensure standards such as WS-Addressing, WS-Discovery, WS-Federation, WS-Policy, WS-Security, and WS-Trust are properly implemented and utilized\n \n- Penetration testing: To find vulnerabilities of an application from attackers\n \n- Fuzz testing: To test the API by forcibly input into the system in order to attempt a forced crash\n \n\n**Common tests on APIs:** \nSome of the common tests we perform on APIs are as follows.\n\n- To verify whether the return value is based on the input condition. The response of the APIs should be verified based on the request.\n \n- To verify whether the system is authenticating the outcome when the API is updating any data structure\n \n- To verify whether the API triggers some other event or request another API\n \n- To verify the behavior of the API when there is no return value\n \n\n**Advantages of API Testing:**\n\n- API Testing is time effective when compared to GUI Testing. API test automation requires less code so it can provide faster and better test coverage.\n \n- API Testing helps us to reduce the testing cost. With API Testing we can find minor bugs before the GUI Testing. These minor bugs will become bigger during GUI Testing. So finding those bugs in the API Testing will be cost-effective to the Company.\n \n- API Testing is language independent.\n \n- API Testing is quite helpful in testing Core Functionality. We can test the APIs without a user interface. In - GUI Testing, we need to wait until the application is available to test the core functionalities.\n \n- API Testing helps us to reduce the risks.\n \n\n**What exactly needs to be verified in API Testing?**: \nBasically, on API Testing, we send a request to the API with the known data and we analyze the response.\n\n- Data accuracy\n \n- HTTP status codes\n \n- Response time\n \n- Error codes in case API return any errors\n \n- Authorization checks\n \n- Non-functional testing such as performance testing, security testing\n \n\n**Tools used for API Testing:**:\n\n- _Postman_ Selected tool in this project\n \n- Katalon Studio\n \n- SoapUI\n \n- Assertible\n \n- Tricentis Tosca\n \n- Apigee\n \n- JMeter\n \n- Rest-Assured\n \n- Karate DSL\n \n- API Fortress\n \n- API Science\n \n- APIary Inspector\n \n\n**Difference between API testing and Unit Testing?** \n| UNIT TESTING | API TESTING | \n| ---- | ---- | \n| Unit testing is conducted by the Development Team | API testing is conducted by QA Team | \n| Unit testing is a form of White box testing | API testing is a form of Black box testing | \n| Unit testing is conducted prior to the process of including the code in the build | API testing is conducted after the build is ready for testing | \n| Source code is involved in Unit testing | Source code is not involved in API testing | \n| In unit testing, the scope of testing is limited, so only basic functionalities are considered for testing | In API testing, the scope of testing is wide, so all the issues that are functional are considered for testing |\n\n**What is Postman?** \nPostman is a API testing tool used by more than 20 million users. It has gained a immense popularity in the IT industry among the developers and testers. The simple and user-friendly interface helps when it comes to documenting, designing, and testing APIs. You can create requests to API endpoints, send various types of data, and examine responses effortlessly with Postman. Its simple and informative graphical user interface makes it easy for even a less experienced beginner to interact with APIs without digging into complex code. \n**How Beneficial is Postman for API Testing?**\n\n- Quality assurance: API testing maintains trust and reputation by ensuring reliable performance.\n \n- Early issue detection: Shift-left API testing finds and resolves defects promptly.\n \n- Resource conservation: Automated API testing saves time and boosts innovation.\n \n- Rapid iteration: API tests in CI/CD pipelines enable frequent bug-free releases.\n \n- Efficient Test Organization: Postman’s interface supports the creation of reusable collections, enhancing test organization and sharing.\n \n- Seamless CI Integration: Postman seamlessly integrates with leading CI tools, providing visibility into API builds alongside testing and development.\n \n- Machine-Readable Documentation: Postman’s machine-readable documentation fosters clear communication and comprehension of APIs for team members and stakeholders.\n \n- Real-Time Collaboration: Postman’s version control and collaboration capabilities promote real-time sharing and teamwork, reducing development cycle durations.\n \n- Design and Mocking: Postman’s design and mocking features eliminate the need for initial backend server setup, expediting API development\n \n\n**what is Newman?** \nNewman is a command-line collection runner for Postman. It allows you to effortlessly run and test a Postman collection directly from the command-line. It is built with extensibility in mind so that you can easily integrate it with your continuous integration servers and build systems.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "33585477"
},
"item": [
{
"name": "LIST USERS",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for Reqres users is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"verify page\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.page).to.eql(1);\r",
"});\r",
"pm.test(\"total_pages is 2\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.total_pages).to.eql(2);\r",
"});\r",
"pm.test(\"Response has expected structure\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData).to.have.property('page');\r",
" pm.expect(jsonData).to.have.property('per_page');\r",
" pm.expect(jsonData).to.have.property('total');\r",
" pm.expect(jsonData).to.have.property('total_pages');\r",
" pm.expect(jsonData).to.have.property('data');\r",
" pm.expect(jsonData).to.have.property('support');\r",
"});\r",
"pm.test(\"per_page is 6\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.per_page).to.eql(6);\r",
"});\r",
"\r",
"\r",
"\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/users?page=1",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users"
],
"query": [
{
"key": "page",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "SINGLE USER",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for Reqres user only is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Response has expected structure\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.expect(jsonData).to.have.property('data');\r",
" pm.expect(jsonData.data).to.have.property('id', 2);\r",
" pm.expect(jsonData.data).to.have.property('email', 'janet.weaver@reqres.in');\r",
" pm.expect(jsonData.data).to.have.property('first_name', 'Janet');\r",
" pm.expect(jsonData.data).to.have.property('last_name', 'Weaver');\r",
" pm.expect(jsonData.data).to.have.property('avatar', 'https://reqres.in/img/faces/2-image.jpg');\r",
" \r",
" pm.expect(jsonData).to.have.property('support');\r",
" pm.expect(jsonData.support).to.have.property('url', 'https://reqres.in/#support-heading');\r",
" pm.expect(jsonData.support).to.have.property('text', 'To keep ReqRes free, contributions towards server costs are appreciated!');\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/users?id=2",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users"
],
"query": [
{
"key": "id",
"value": "2"
}
]
}
},
"response": []
},
{
"name": "SINGLE USER NOT FOUND",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 404\", function () {\r",
" pm.response.to.have.status(404);\r",
"});\r",
"pm.test(\"Response time for Reqres users NOT FOUND is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Data empty\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData).to.empty;\r",
"});\r",
"pm.test(\"Response is empty\", function () {\r",
" pm.expect(pm.response.text()).to.eql('{}');\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/users/23",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users",
"23"
]
}
},
"response": []
},
{
"name": "LIST <RESOURCE>",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for unknown lists reqres is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"verify total_pages\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.total_pages).to.eql(2);\r",
"})\r",
"pm.test(\"Response structure is correct\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.expect(jsonData).to.have.property('page');\r",
" pm.expect(jsonData).to.have.property('per_page');\r",
" pm.expect(jsonData).to.have.property('total');\r",
" pm.expect(jsonData).to.have.property('total_pages');\r",
" pm.expect(jsonData).to.have.property('data');\r",
" pm.expect(jsonData).to.have.property('support');\r",
" \r",
" pm.expect(jsonData.data).to.be.an('array');\r",
" pm.expect(jsonData.data.length).to.eql(6);\r",
" \r",
" jsonData.data.forEach(function(item, index) {\r",
" pm.expect(item).to.have.property('id');\r",
" pm.expect(item).to.have.property('name');\r",
" pm.expect(item).to.have.property('year');\r",
" pm.expect(item).to.have.property('color');\r",
" pm.expect(item).to.have.property('pantone_value');\r",
" });\r",
" \r",
" pm.expect(jsonData.support).to.have.property('url');\r",
" pm.expect(jsonData.support).to.have.property('text');\r",
"});\r",
"pm.test(\"Content-Type is present\", function () {\r",
" pm.response.to.have.header(\"Content-Type\");\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/unknown",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"unknown"
]
}
},
"response": []
},
{
"name": "SINGLE <RESOURCE>",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for unknown single reqres is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/unknown/2",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"unknown",
"2"
]
}
},
"response": []
},
{
"name": "SINGLE <RESOURCE> NOT FOUND",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 404\", function () {\r",
" pm.response.to.have.status(404);\r",
"});\r",
"pm.test(\"Response time for Reqres resource NOT FOUND is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Data empty\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData).to.empty;\r",
"});\r",
"pm.test(\"Response is empty\", function () {\r",
" pm.expect(pm.response.text()).to.eql('{}');\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/unknown/23",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"unknown",
"23"
]
}
},
"response": []
},
{
"name": "CREATE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 201\", function () {\r",
" pm.response.to.have.status(201);\r",
"});\r",
"pm.test(\"Response time for create users is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Successful POST request\", function () {\r",
" pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"Tahani\",\r\n \"job\": \"Engineer\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/users",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users"
]
}
},
"response": []
},
{
"name": "UPDATE with PUT",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for put update users is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Response structure is correct\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.expect(jsonData).to.have.property('name');\r",
" pm.expect(jsonData).to.have.property('job');\r",
" pm.expect(jsonData).to.have.property('updatedAt'); \r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"morpheus\",\r\n \"job\": \"zion resident\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/users/2",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users",
"2"
]
}
},
"response": []
},
{
"name": "UPDATE with PATCH",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for patch user is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"morpheus\",\r\n \"job\": \"zion resident\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/users/2",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users",
"2"
]
}
},
"response": []
},
{
"name": "DELETE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 204\", function () {\r",
" pm.response.to.have.status(204);\r",
"});\r",
"pm.test(\"Response time for DELETE USER is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Response body is empty\", function () {\r",
" pm.expect(pm.response.text()).to.eql('');\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "https://reqres.in/api/users/2",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users",
"2"
]
}
},
"response": []
},
{
"name": "REGISTER - SUCCESSFUL",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for REGISTER - SUCCESSFUL is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"token register\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.token).to.eql(\"QpwL5tke4Pnpja7X4\");\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"eve.holt@reqres.in\",\r\n \"password\": \"pistol\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/register",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"register"
]
}
},
"response": []
},
{
"name": "REGISTER - UNSUCCESSFUL",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 400\", function () {\r",
" pm.response.to.have.status(400);\r",
"});\r",
"pm.test(\"Response time for REGISTER - UNSUCCESSFUL is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Response contains expected error message\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.expect(jsonData).to.have.property('error');\r",
" pm.expect(jsonData.error).to.eql('Missing password');\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"sydney@fife\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/register",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"register"
]
}
},
"response": []
},
{
"name": "LOGIN - SUCCESSFUL",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for LOGIN - SUCCESSFUL is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"token login\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.token).to.eql(\"QpwL5tke4Pnpja7X4\");\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"eve.holt@reqres.in\",\r\n \"password\": \"cityslicka\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/login",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"login"
]
}
},
"response": []
},
{
"name": "LOGIN - UNSUCCESSFUL",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 400\", function () {\r",
" pm.response.to.have.status(400);\r",
"});\r",
"pm.test(\"Response time for LOGIN - UNSUCCESSFUL is less than 1000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(1000);\r",
"});\r",
"pm.test(\"Response contains expected error message\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.expect(jsonData).to.have.property('error');\r",
" pm.expect(jsonData.error).to.eql('Missing password');\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"peter@klaven\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://reqres.in/api/login",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"login"
]
}
},
"response": []
},
{
"name": "DELAYED RESPONSE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"pm.test(\"Response time for DELAYED RESPONSE is less than 4000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(4000);\r",
"});\r",
"pm.test(\"Verify support text\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.expect(jsonData.support.text).to.eql(\"To keep ReqRes free, contributions towards server costs are appreciated!\");\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://reqres.in/api/users?delay=3",
"protocol": "https",
"host": [
"reqres",
"in"
],
"path": [
"api",
"users"
],
"query": [
{
"key": "delay",
"value": "3"
}
]
}
},
"response": []
}
]
}