Skip to content

DumisaneDev/Rest_Assured_API_Testing_Automation_framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏗️ The Librarian: A Scalable API Automation Framework

🌟 Introduction

This project is more than just a suite of tests; it is a custom-built API automation framework designed to validate complex RESTful services with a focus on a Book Library API.

The goal was to move beyond simple scripts and create a professional, decoupled architecture that separates Test Logic, Data Management, and Environment Configuration. It ensures that as the API grows, the testing suite remains resilient, readable, and ready for CI/CD integration.


🛠 Technologies & Core Stack

  • API Orchestration: Rest-Assured (Fluent, BDD-style validation)
  • Test Engine: TestNG (Advanced annotations and parallel execution capability)
  • Data Serialization: Jackson Databind (Efficient JSON-to-POJO mapping)
  • Build System: Maven
  • Configuration: Java Properties (For seamless environment switching)
  • Logging: SLF4J / Logback (For high-signal execution tracing)

🧭 The Process: From "Postman Fatigue" to Framework Order

The Narrative: "The Manual Tester's Mid-Life Crisis"

Every developer has that moment of clarity. Mine happened while I was copying and pasting IDs from one Postman request to another for the 50th time. I realized I wasn't testing software; I was doing data entry.

I decided to build a "Librarian"—a framework that actually understands how a library should work.

The Journey involved:

  1. The "405" Wall: Realizing that a pretty JSON body means nothing if the headers aren't perfect. I spent nights debugging RequestSpecifications so the framework could handle them automatically.
  2. The Data Breakup: I broke up with hardcoded strings. I built the JSONDataManager because tests should be told what to test, not how to find the data.
  3. The Insight: A good framework shouldn't just find bugs; it should be a documentation source for how the API is supposed to behave.

🏗️ Framework Architecture (The Main Focus)

The power of this project lies in its Separation of Concerns:

1. The Data Layer (JSONDataManager)

No more hardcoded maps. This layer uses Jackson to dynamically load test data from external .json files. This allows QA teams to add new test cases without touching a single line of Java code.

2. The Configuration Layer (ConfigReader)

By abstracting environment variables (Base URLs, API keys, File paths) into a centralized .properties file, the framework is environment-agnostic. Switching from localhost to production is a one-line change.

3. The Execution Layer (TestNG + Rest-Assured)

Tests are organized using TestNG Priorities and Dependencies. This ensures a logical flow: we don't try to DELETE a book if the POST request to create it failed.

4. The Validation Helper (writeDataHelper)

A custom utility that captures API responses and persists them to the target/ directory. This provides a "black box" recording of exactly what the server returned during a failure.


⚙️ Project Setup

Prerequisites

  • Java 17 (LTS)
  • Maven 3.8+

Installation & Execution

  1. Clone the framework:

    git clone https://github.com/your-username/Librarian-API-Framework.git
    cd Librarian-API-Framework
  2. Run the Full Suite:

    mvn clean test
  3. Check the Reports: Open target/surefire-reports/index.html in your browser to see the execution dashboard.

Architected with ☕ and precision by [Your Name].

About

Professional API automation framework built with Rest-Assured and TestNG. Features a decoupled, data-driven architecture with external JSON management and centralized config. Designed for scalable CRUD validation of a Book Library API, it ensures high-reliability, maintenance-friendly testing for modern engineering teams.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages