- Create automated tests to verify functionality of multiple operations exposed by Booking Api.
- Programming Language - Kotlin
- Build Tool - Maven
- Test Framework - Junit5
- Api automation tool - RestAssured
- Reports - Surefire reports
- BaseApi includes helper methods All extending classes can extend BaseApi to make API calls.
- BookingApi Responsible for making API calls for all Booking Api operations and returning appropriate response.
- AuthApi Responsible for generating access token
- BookingFixture Supplies input data to BookingApi tests.
- BookingApiTest Contains BookingApi tests. Responsible for calling BookingApi methods and performing assertions on received response.
- Used Serialization and De-Serialization for generating API requests and parsing responses.
- Environment Variables such as URI, Username and Password are accessed via Properties file and can be overridden by command line. See ConfigManager
- Download this project on your local machine
git clone https://github.com/akshat55narang/restful-booker-automated-tests.git
- From the restful-booker-tests directory
- Default configuration
mvn clean test
- Override default configuration
mvn clean test -DdefaultUsername=admin -DdefaultPassword=password123
- Run tests and generate surefire HTML report
mvn clean surefire-report:report -DdefaultUsername=admin -DdefaultPassword=password123
Environment variables are located in default.properties
The default values can be overridden from the command line, for example,
getBaseUri() method present in ConfigManager
will return the value from default.properties unless the value is supplied
via command line - -DbaseUri
fun getBaseUri(): String { return getParameterValue("baseUri", getConfig(BASE_URI)) }
- Report - target/surefire-reports/BookingApiTest.txt
- Html Report ( only generated when using
mvn clean surefire-report:report
) - target/site/surefire-report.html