Saturday, October 6, 2018

Chakram: A Rest API testing framework for JavaScript

Rest API test automation is becoming popular day by day. As Jenkins makes our CI/CD life easier, automation testers are now showing their tendency to automate their rest APIs. When some features changes in an API, they have to test all the related APIs. In microservice arena, number of services are increasing day by day. Postman, Insomnia, SoapUI, Fiddler, JMeter etc. are still a first choice of our testers but I am googling a JavaScript based framework where I can write my test using JavaScript and I got Chakram.

Chakram is an API testing framework that can perform end to end tests on JSON REST endpoints.

Features:

  • Chakram can perform a BDD style testing.
  • It support JavaScript promises.
  • Tests are simple, clear and expressive.
  • It is built on node.js, mocha and chai.
  • It extends Chai.js, adding HTTP specific assertions.
  • It allows simple verification of returned status codes, the compression used, cookies, headers.
  • It also returns JSON objects and the schema of the JSON response and response times.
  • It uses BDD formatting and hooks so that complex tests can be constructed with the necessary setup and tear down operations.
  • It allows new assertions to be added to the framework.
  • It supports Plugin and Debugging.
  • It exports results in a variety of formats.

That’s all for now. In the next post, I will explain how to write Chakram test and run through command line.