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.
- Java
- Serenity BDD
- Maven
- RestAssured
We are using Restful-Booker APIs as the Application Under Test.
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.
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
Run the following command in Terminal to execute tests.
$ mvn clean verify
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
- Github (https://github.com/cvenkatreddy/restassured-serenity-cucumber) with circleci integration(Config.yml)
- GitLab (https://gitlab.com/cvenkatreddy/restassured-serenity-cucumber) with gitlab integration (.gitlab-ci.yml)