REST API Testing Framework
As we know, UI is the part that users see when they open an app or visit a website but there are lots of things going on behind the scenes. Most people think that testing is only about checking UI but these tests are the last stage of testing processes.
Why APIs need to be tested and automated ?
Since no one wants to see a perfect UI with the 500 errors popping up everywhere, it is very important to test services beforehand. (Again, follow test pyramid mentioned above.)
There might be lots of bugs hiding in APIs and we need to find them fast before they are deployed. Although, we can check service calls manually, it is really time consuming since there will be hundreds of API’s behind UI operation. You can miss so much thing when you dive in complicated structures and request/response flows. So automation is always here to reduce test effort and increase coverage for us.
Why JavaScript for API Automation ?
These days our web applications tend to have a lot of integrations with other services, whether it be interacting with a REST service like Twitter, or downloading images from Flickr. Using Node/JavaScript is one of the most popular languages to handle applications like this. Either way, you’ll be making a lot of HTTP requests, which means you’ll need a solid module to make writing the code much more bearable.
The request module is by far the most popular (non-standard) Node package for making HTTP requests. Actually, it is really just a wrapper around Node’s built in http module, so you can achieve all of the same functionality on your own with http, but request just makes it a whole lot easier.
This framework will enable the team to achieve automated testing of the application from the user’s perspective. REST-ATF (REST services Automation Test Framework), a Node.js/JavaScript based REST API testing framework designed to perform end to end tests automation on JSON REST endpoints.
For more information about the framework visit, rest-atf.
We encourage our readers to treat each other respectfully and constructively. Thank you for taking the time to read this blog post to the end. We look forward to your contributions. Let’s make something great together! What do you think? Please vote and post your comments.