Instant Testing of RESTful API with BDDfire and Cucumber

BDDfire2.0.1 + REST API Testing

Glad to announce support for the API testing to BDDfire as we can now use pre-defined steps to perform API testing using combination of Cucumber and RestClientBDDFire is a wholesale Ruby-Cucumber framework where you can setup Web, Mobile, Accessibility, Load, Performance and now REST API testing.

BDDfire  + RestClient

BDDfire uses RestClient to perform HTTP requests to URI and check response. We can use it for checking JSON and XML response.

There are following pre-defined steps we can use to check JSON response.

 

There are few to check XML response as well

 

Here is how you can get API tests up and running in few minutes with BDDfire. Fire up your terminal/iTerm and execute following commands to get the project setup

Now that you have all the project setup and you should have project like this :

bddfire_project

 

You can see that there is a example feature located ‘features/api.feature’ which tests for the GitHub Api. We can write a similar cucumber scenarios/steps for our own application. Now we can run to run this api tests.

Here is how we can execute our REST API test

api

 Additional Config

On top of pre-defined API Steps, you can use full power of RestClient  to configure your API environment with

  • Certificates
  • Proxy
  • Username and Password Credentials.

Please have a look at README file for the RestClient and we can achieve anything we want.

Additionally, I haven’t tested XML response well so feel free to create issue on BDDfire GitHub

https://github.com/Shashikant86/bddfire

 

HAPPY BDD and HAPPY RESTFul Testing !!