Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Booking API Test Automation Framework

Overview

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.

Tech Stack

  • Java 8+
  • Maven
  • Karate DSL
  • Cucumber
  • JUnit
  • JavaFaker
  • Git

Key Features

  • 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

Prerequisites

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 --version

Installation

Clone the repository:

git clone https://github.com/Alez-Estacio/booking_api_testing.git

Navigate to the project directory:

cd booking_api_testing

Install dependencies and build the project:

mvn clean install

Project Structure

booking_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

Running Tests

Run the complete test suite:

mvn test

Run a specific feature file:

mvn test -Dtest=RunnerTest -Dkarate.options="classpath:bookings/createBookings/createBooking.feature"

Test Coverage

Booking Creation

  • Successful booking creation
  • Required field validation
  • Invalid data handling
  • Response body validation
  • Random booking data generation with JavaFaker

Booking Retrieval

  • Retrieve all bookings
  • Search booking by ID
  • Invalid ID handling
  • Header validation

Booking Update

  • Full booking update
  • Partial booking update
  • Authentication validation
  • Updated data validation
  • Random booking update data generation with JavaFaker

Booking Deletion

  • Successful booking deletion
  • Authentication validation
  • Non-existing ID handling
  • Response validation

Reports

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.

Notes

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.

Author

Alezander Estacio

QA Automation Engineer

About

API automation framework for Booking endpoints using Karate DSL, Java, Cucumber and schema validation for CRUD testing.

Topics

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages