![]() Also, think about how much time this will reduce, plus the higher level of confidence that the process will run successfully every time you run it. When it comes to automation, it will require a proper setup and some effort to get things ready to go, however, you won’t ever need to run your tests or regression suite manually again. The term ‘API Testing’ is often used, but most of the time this kind of testing is done manually. Delving into this consideration to automate or not would require multiple factors. Although automation itself has a cost, you can calculate your ROI and validate if it’s suitable for your situation or not. What about the cost? Reducing human effort, resources, and time can definitely generate a more favourable return. Lesser amounts of human interaction required and less time taken to get processes completed are examples of many factors being affected by automation. The reduction of effort can come in many shapes. By automating these processes, you are reducing the amount of effort required, compared to when they were manually performed. From that, you can clearly see why we do automation and its benefits. We will give a quick brief surrounding each topic and provide some resources for your reference.Īs the name itself suggests, automation is the process of transforming something that was previously manually performed, into something that is automatically performed. If you aren’t familiar with any of the mentioned topics, don’t worry. Additionally, we will use Postman when we begin working on the demo. In this blog, we will be talking about API automation within the field of testing. There are so many types of automation, and there are also many fields where automation is involved. P.S You still need to run some test in your controller etc but with the Runner of Postman + the test etc that give you just much more confirmation.Nowadays, you would hear a lot about automation and how it’s heavily involved in all aspects of software development now. Hope you like this little tutorial and you learn something new today. Now I start to export it in my postman folder inside my server so I can import it if I delete mine on my GUI. After the other dev just need to import it and he gets all your route. Last thing you can also export all your route if you click it in your collection. You can also import your test run and give that to another dev in your team. ![]() Select your collection in the dropdown.Īs you can see I add some new test for show how awesome this tool can be. In the top left you can see the button Runner if you click it Postman open a new window. Now in the top left, you can see a big Save button. Now an example of a complete test for this routes. Now add the Response body: JSON value check again in your right snippets. If you click send now we can see the test pass 1/1. We can select one already Status code: Code is 200. First thing in the right you can see a select menu with test already create by Postman. If you click on Test right below the URL container you gonna see this. Perfect the route is working and the controller + model do their job. For me, I add cause I have already created a fake post. With that collection, we make our life much easier to test route already create.Īdd the route and the GET method in the main area. ![]() If you click there you can now create a collection. In your left, you gonna see a little folder with a plus sign. Routes.route( '/posts/:id').get(PostController.fetchPostById) Import * as PostController from './controller' ![]() **/ export const fetchPostById = async (req, res) => from 'express' posts/controller.js import Post from './model' Create your first Simple Testįirst thing this is a simple controller in your app where you can fetch a unique post with is ID as params. This is not wrong but you can get much better productivity with if you use some of Postman features. But I see a lot of people just using it as a manual tester. This is a super useful tool for test your API and looks at the response you get from your server. I'm sure you already know the famous tool call Postman.
0 Comments
Leave a Reply. |