Generating BDD tests with HttpRider

In this post, we’ll see how we can easily generate BDD tests with HttpRider.

Instead of writing the code behind the REST api calls, we’ll use an open source framework called Apickli to do the heavy lifting. Apickli is based on cucumber.js and defines a number of pre-built Gherkin expressions.

I’ve also created a sample project using Apicki framework to make it easy to get it up and running.

Let’s start with a few API calls using the sample database provided with source. Once it is loaded, please make sure that you run all the APIs at least once as some of the exporters use the response to generate code.

Now, click on Export/Export All to open up code generator.

Select Apickli Tests from the drop down menu to see the BDD generated code.

If you don’t have a project setup, then you can clone the test project and replace the contents of Functional.feature file with the exported code.

Run npm i to install the dependencies and then npm run all to run all the included scenarios.

You can also view the generated report by running npm run report which should generate the HTML report in the report folder.

HttpRider is an open source cross platform desktop client for working with JSON APIs. Please checkout the features on Github.

See the demo video to generate BDD tests using HttpRider and Apickli.