1 00:00:00,109 --> 00:00:02,250 Okay I think it's time for another 2 00:00:02,250 --> 00:00:04,350 challenge. In this video we'll do a 3 00:00:04,350 --> 00:00:07,470 challenge called find the 500, and for 4 00:00:07,470 --> 00:00:08,879 this challenge it's going to put 5 00:00:08,879 --> 00:00:10,139 together a lot of what we've been 6 00:00:10,139 --> 00:00:11,940 learning. We've learned a lot about API 7 00:00:11,940 --> 00:00:14,280 testing over the last few videos, and so 8 00:00:14,280 --> 00:00:15,749 now we're gonna take a few minutes and 9 00:00:15,749 --> 00:00:18,210 try and put into action. So for this 10 00:00:18,210 --> 00:00:21,180 challenge we call the finding the 500, 11 00:00:21,180 --> 00:00:23,850 and what we mean by that is find the 500 12 00:00:23,850 --> 00:00:26,610 error. So I have an API, a sample API, 13 00:00:26,610 --> 00:00:28,860 which if you followed the setup and 14 00:00:28,860 --> 00:00:30,300 install instructions you should have 15 00:00:30,300 --> 00:00:32,579 available for you already. And in this 16 00:00:32,579 --> 00:00:35,219 API there are at least two 500 errors 17 00:00:35,219 --> 00:00:37,859 hidden in there. To successfully solve 18 00:00:37,859 --> 00:00:38,940 this challenge you're going to need to 19 00:00:38,940 --> 00:00:40,710 use all the testing knowledge that 20 00:00:40,710 --> 00:00:41,940 you've learned so far, you're gonna need 21 00:00:41,940 --> 00:00:44,819 to use POST, and PUT, and GET calls as you 22 00:00:44,819 --> 00:00:46,829 investigate this. So there should be a 23 00:00:46,829 --> 00:00:48,179 way to help you put into practice 24 00:00:48,179 --> 00:00:49,620 everything we've been talking about so 25 00:00:49,620 --> 00:00:52,409 far. So let's take a look at this. I'm in 26 00:00:52,409 --> 00:00:54,149 the folder here where I've got the 27 00:00:54,149 --> 00:00:56,010 challenges checked out, which if you 28 00:00:56,010 --> 00:00:57,659 followed along the install video you 29 00:00:57,659 --> 00:01:00,149 should have as well. And then I can start 30 00:01:00,149 --> 00:01:03,899 up the server by calling node, and then 31 00:01:03,899 --> 00:01:11,460 find the 500 server ojs. So we'll start 32 00:01:11,460 --> 00:01:13,500 that server up, and we can see that 33 00:01:13,500 --> 00:01:15,539 request can be accessed here. So let's 34 00:01:15,539 --> 00:01:19,860 just copy that, and take it over to 35 00:01:19,860 --> 00:01:23,250 Postman. So we'll put this here in 36 00:01:23,250 --> 00:01:27,450 Postman, and let's here's one of our URLs. 37 00:01:27,450 --> 00:01:31,710 So we'll say blog posts, and let's just 38 00:01:31,710 --> 00:01:33,149 send a GET call here make sure 39 00:01:33,149 --> 00:01:34,469 everything's set up and working, and 40 00:01:34,469 --> 00:01:36,180 there you can see we've got a couple of 41 00:01:36,180 --> 00:01:40,380 blog posts in this. So the schema or the 42 00:01:40,380 --> 00:01:42,119 structure of this data in the in this 43 00:01:42,119 --> 00:01:43,890 challenge is similar to kinds of data 44 00:01:43,890 --> 00:01:45,539 that we've looked at in previous videos, 45 00:01:45,539 --> 00:01:47,219 so hopefully this is something you can 46 00:01:47,219 --> 00:01:49,229 figure out fairly quickly. As before 47 00:01:49,229 --> 00:01:51,539 there's also documentation available on 48 00:01:51,539 --> 00:01:54,719 GitHub. So you can see here this is on my 49 00:01:54,719 --> 00:01:56,549 profile, the same place that you 50 00:01:56,549 --> 00:01:58,140 downloaded this from when you set things 51 00:01:58,140 --> 00:02:00,960 up, the API testing challenges. And then 52 00:02:00,960 --> 00:02:04,200 if we go down here to find the 500, we 53 00:02:04,200 --> 00:02:07,590 can see the ropes that are available for 54 00:02:07,590 --> 00:02:10,199 this challenge, and then the POST and PUT 55 00:02:10,199 --> 00:02:12,000 commands that are available as well. And 56 00:02:12,000 --> 00:02:13,590 to get the 57 00:02:13,590 --> 00:02:15,239 data that you want for these POST and 58 00:02:15,239 --> 00:02:17,069 PUT commands you can do what we just did 59 00:02:17,069 --> 00:02:19,170 here we did it GET, and we can just copy 60 00:02:19,170 --> 00:02:23,010 this structure. So we need the parameters 61 00:02:23,010 --> 00:02:25,230 that it needs are an ID, a tight little, 62 00:02:25,230 --> 00:02:27,690 body, and a profile, the idea actually is 63 00:02:27,690 --> 00:02:30,860 optional. And you would copy that 64 00:02:30,860 --> 00:02:33,750 structure and use that structure as your 65 00:02:33,750 --> 00:02:35,610 parameters, you could use it as keys here 66 00:02:35,610 --> 00:02:39,690 or in the body of it as the JSON data as 67 00:02:39,690 --> 00:02:41,489 well, as we've shown in previous videos. 68 00:02:41,489 --> 00:02:43,860 So this challenge will probably stretch 69 00:02:43,860 --> 00:02:45,180 you a bit, and I would encourage you to 70 00:02:45,180 --> 00:02:46,860 let it do that. Struggle with it for a 71 00:02:46,860 --> 00:02:48,510 bit, see what you can figure out on your 72 00:02:48,510 --> 00:02:50,760 own, it really is one of the best ways to 73 00:02:50,760 --> 00:02:52,980 learn something. As challenging as API 74 00:02:52,980 --> 00:02:55,349 testing is, you have to kind of struggle 75 00:02:55,349 --> 00:02:56,930 with it a little bit to really get it. So 76 00:02:56,930 --> 00:03:00,360 one note as well, this service is 77 00:03:00,360 --> 00:03:02,040 designed to have some bugs in it, and so 78 00:03:02,040 --> 00:03:03,660 you might run into issues while testing 79 00:03:03,660 --> 00:03:05,730 it. So if you do kind of get stuck and 80 00:03:05,730 --> 00:03:08,280 you think that maybe something just went 81 00:03:08,280 --> 00:03:11,340 wrong, you can reset it. And the easiest 82 00:03:11,340 --> 00:03:13,500 way to do that would be to go to your 83 00:03:13,500 --> 00:03:16,530 git so here I've got GitHub desktop, and 84 00:03:16,530 --> 00:03:18,930 you can see I've you know added 85 00:03:18,930 --> 00:03:22,019 something to my database. So I did a POST 86 00:03:22,019 --> 00:03:23,910 call and added something to it. If I 87 00:03:23,910 --> 00:03:26,700 wanted to reset this, I can just do a 88 00:03:26,700 --> 00:03:29,730 reset and get. So here I can just say 89 00:03:29,730 --> 00:03:33,450 discard all changes. So if I do that, say 90 00:03:33,450 --> 00:03:35,910 yes I do want to discard those changes, 91 00:03:35,910 --> 00:03:38,639 and now those the everything has been 92 00:03:38,639 --> 00:03:41,220 reset. So if you do that you will then 93 00:03:41,220 --> 00:03:43,019 want go over to where you have your 94 00:03:43,019 --> 00:03:45,870 server running, just do ctrl C to kill it, 95 00:03:45,870 --> 00:03:48,630 and then you can do up arrow probably in 96 00:03:48,630 --> 00:03:53,609 your command prompt, and enter to run the 97 00:03:53,609 --> 00:03:56,250 server again and to restart it. So also 98 00:03:56,250 --> 00:03:58,079 if you get stuck you can turn to the 99 00:03:58,079 --> 00:03:59,489 solution video and get some hints, but I 100 00:03:59,489 --> 00:04:00,930 hope you have some fun figuring out on 101 00:04:00,930 --> 00:04:03,180 your own. Happy testing and hope to see 102 00:04:03,180 --> 00:04:08,180 you in the solution video soon.