API Automation Testing with Javascript

Image for post
Image for post

API testing is extremely important to ensure your application’s business logic or the functionality of the APIs are working properly as well as to ensure they are performant and secure.

  • Early application access: You can start testing the APIs the moment they are built without having to wait for the UI layer to be ready
  • Test speed: API automation testing is a lot quicker and covers more application ground in less time compared to browser testing
  • Easier to maintain: If you’ve worked on browser tests then you probably are aware of with some of the pain points around flaky tests. With API tests, you don’t have to worry about that as tests are a lot more stable and consistent (most of the times)
  • Manual: by using tools like Postman or any other API console
  • Automation: programmatically running your API tests using the programming language of your preference

In this tutorial series, we will walk through both the options but mainly focussing on the latter option (Automation)


Some of the items we will be covering in this series:

  • Basics
    ▹ What is an API?
    ▹ What is REST API?
    ▹ Different types of API Methods
    ▹ What contains in an API Request?
    ▹ What is API testing and the advantages of API testing
    ▹ What technologies we will be using for API testing
  • Installation / Configuration
  • Write API automation tests with Javascript using Mocha, Chai JS, and SuperTest HTTP Library
  • Scale API automation test framework
    ▹ Learn how hooks work and when to use it
    ▹ Write some negative tests to increase our test coverage
  • Generate fake test data to make tests more dynamic
  • Generate HTML reports using Mochawesome reporter
  • Integrate tests with Jenkins
  • and a lot more…

I will be uploading new content every week on each of the above topics, so Subscribe to my YouTube channel to get notified of new videos 👍

Meanwhile, if you are interested in learning WebdriverIO, check out my free tutorial series here 😄 -

Follow @automationbro on Twitter for all the latest updates

SDET Architect | YouTuber | Tech Blogger | Love to explore new tools and technologies. Check out my YouTube channel — https://youtube.com/automationbro

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store