Testing Challenge – API Automation Testing Exercise
In today’s testing challenge we cover API testing. I used Cypress and Javascript to complete the API automation testing exercise although it can be done with any API library or tool as you like. If you fee like learning new things you can try something new you haven’t tried yet. The application under test is Restful Booker API which we covered already in API testing challenge for manual testing. This time we are moving our tests to automation suite and as that usually happens some new bugs were noticed which I haven’t seen before. In any case, I’m sure you will be able to see all of them on your own.
The challenge
Read the documentation for the API carefully. See what are the prerequisites for successful API responses. Document the happy paths for each of the tests and then expand the test cases with negative scenarios. Pay specific attention to authentication and what response messages should be received for each of the requests. If you haven’t done the manual testing challenge for Restful Booker I would start there following the basic testing guidelines. When you test the API manually and get familiar with all the test cases, then decide what would you automate. Consider doing a risk analysis and prioritization of the most important requests and cases related to those requests.
The automation framework rules
Make sure you follow the best practice for automation testing. Avoid hard coding the test data, create comprehensive reporting and extract common functions into reusable components. If you have some plugins that make your testing easier, by all means use them. Feel free to share your results and repos in the comments section. My result you can find in this repo. The repo is public and open for cloning. Remember to have fun with this API automation testing exercise.