This repository contains an API test automation framework built with Karate DSL, Cucumber, JUnit, and Java to validate end-to-end scenarios for a Booking API.
The framework covers the main CRUD operations for booking management, including Create, Read, Update, and Delete flows. It also includes authentication handling, response validation, JSON schema validation, random test data generation, and Cucumber report generation.
- Java 8+
- Maven
- Karate DSL
- Cucumber
- JUnit
- JavaFaker
- Git
- End-to-end API test automation
- CRUD operation validation
- Authentication management
- Happy path, alternate flow, and negative test scenarios
- JSON schema validation
- Random test data generation with JavaFaker
- Parallel test execution
- Cucumber HTML report generation
Before running the project, make sure you have the following installed:
- JDK 8 or higher
- Maven 3.6.0 or higher
- Git
You can verify your local setup with:
java -version
mvn -version
git --versionClone the repository:
git clone https://github.com/Alez-Estacio/booking_api_testing.gitNavigate to the project directory:
cd booking_api_testingInstall dependencies and build the project:
mvn clean installbooking_api_testing/
├── src/
│ └── test/
│ ├── java/
│ │ └── bookings/
│ │ ├── authentication/ # Authentication test scenarios
│ │ ├── createBookings/ # Booking creation test scenarios
│ │ ├── getBookings/ # Booking retrieval test scenarios
│ │ ├── updateBookings/ # Booking update test scenarios
│ │ └── deleteBookings/ # Booking deletion test scenarios
│ └── resources/
│ └── bookings/ # Request and response JSON files
├── pom.xml # Maven configuration
└── README.md # Project documentation
Run the complete test suite:
mvn testRun a specific feature file:
mvn test -Dtest=RunnerTest -Dkarate.options="classpath:bookings/createBookings/createBooking.feature"- Successful booking creation
- Required field validation
- Invalid data handling
- Response body validation
- Random booking data generation with JavaFaker
- Retrieve all bookings
- Search booking by ID
- Invalid ID handling
- Header validation
- Full booking update
- Partial booking update
- Authentication validation
- Updated data validation
- Random booking update data generation with JavaFaker
- Successful booking deletion
- Authentication validation
- Non-existing ID handling
- Response validation
Cucumber reports are generated automatically after test execution.
Report location:
target/cucumber-reports/overview-features.html
Open the report in your browser after running the tests to review execution results, scenarios, and evidence.
This framework is organized by API domain and operation type to improve maintainability, scalability, and readability.
Karate feature files and JSON resources are grouped by business flow, making it easier to extend the test suite with new scenarios or additional endpoints.
Alezander Estacio
QA Automation Engineer