zato-apitest, a spin-off from the main Zato project lets one test APIs in a convenient way using assertions written in plain English, such as below:

Feature: My API Test

Scenario: Check connection and hello

    Given address "http://my.address"
    Given URL path "/my/path"
    Given format "JSON"
    Given JSON Pointer "/customer" in request is "My name"

    When the URL is invoked

    Then header "Connection" starts with "keep-"
    And JSON Pointer "/hello" is one of "a,b,c"

APIs include HTTP endpoints and 100+ types of assertions that can check headers, payload, JSON, XML, JSON Pointers, XPath as well as obtain test data from environment, SQL, CSV or Cassandra.

This post with guide you through the installation on Ubuntu 14.04 up to the point of executing the tool’s built-in demo.

The steps are:

  • Install prerequisites
  • Install zato-apitest
  • Run demo

Install prerequisites

Run the commands below:

$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install python-pip postgresql-server-dev-all
$ sudo apt-get install python-dev libxml2-dev libxslt1-dev
$ sudo pip install --upgrade pip

Install zato-apitest

$ sudo pip install zato-apitest

Run demo

This will set up a sample project and run a set of assertions against sample live APIs:

$ apitest demo
API testing demo

And that’s it for now - stay tuned for upcoming instalments that will go through configuring scenarios connecting to a variety of APIs.