Skip to content

cvenkatreddy/restassured-serenity-cucumber

Repository files navigation

RestAssuredSerenityCucumber Framework

This is a sample Rest API test solution for sample endpoints available in https://restful-booker.herokuapp.com/apidoc/index.html The published APIs represent a booking system where user can create, update and cancel bookings.

Tests are written using a combination of SerenityBDD, RestAssured, Cucumber, Junit & Maven.

Technology Stack

  • Java
  • Serenity BDD
  • Maven
  • RestAssured

Prerequisites

Application Under Test

We are using Restful-Booker APIs as the Application Under Test.

The project directory structure

The project follows the standard directory structure used in most Serenity projects:

src
  + main
    + java                          
      + env                         methods to get/set env related configs
      + models                      pojos of all endpoints
      + utilities                   utility methods and constants
  + test
    + java                          
      + endpoints                   endpoints of the services
      + runners                     test runner(senerity runner/trigger configurations)
      + stepdefinitions             Step definitions for the BDD feature
      + utils                       Common utility methods
    + resources
      + features                  Feature files
      + properties                AUT properties files
      + logback.xml               for debug logs

Following instructions will help you running the project. First, clone this project locally on your machine from the master branch.

Installation and Test Execution

Open the project in any IDE Eclipse/IntelliJ. Run the following command in Terminal and build the project. It will automatically download all the required dependencies.

$ mvn clean install

Execute Tests

Run the following command in Terminal to execute tests.

$ mvn clean verify

Test Report

You can find the Serenity reports in the following directory of the Project.

\target\site\serenity\

In the serenity directory, open 'index.html' file to view the report.

If we make any push/pull/any change to code, will automatically trigger the builds in both circleci and gitlab, reports are shown here [https://4-338524524-gh.circle-artifacts.com/0/target/site/serenity/index.html] and some results screenshots are attached herewith as well

Alt text Alt text

Finally Source code, Please refer

Alt text Alt text

Releases

No releases published

Packages

No packages published