This repository contains a professional-grade API automation framework designed for the Online Bookstore system.
Developed by Ata Pourfarivarnezhad, a Software Developer & SDET, this project demonstrates advanced API test automation practices using Java 21, Rest-Assured, and TestNG.
The framework is built with scalability, maintainability, and real-world project standards in mind.
This project is fully integrated with GitHub Actions and GitHub Pages for seamless delivery and monitoring.
You can access the real-time execution dashboard without running any code locally.
The report includes:
- Full Request / Response logs
- Detailed execution timelines
π View Live Allure Report https://atafarivar.github.io/api-automation-assessment/
You can trigger a fresh test run directly from the GitHub interface:
- Navigate to the Actions tab
- Select the API Automation CI workflow
- Click Run workflow
The pipeline will:
- Build the Docker environment
- Execute all 20 automated tests
- Publish the updated Allure report
Note
Deployment Time: While the tests execute in seconds, GitHub Pages may take 8-10 minutes to process the new Allure data and update the live link. Please monitor the pages-build-deployment job in the Actions tab to confirm when the latest report is live.
The framework follows a decoupled, modular architecture to ensure long-term maintainability.
-
clients
Abstraction layer for API endpoints (BookClient,AuthorClient)- Uses Allure
@Stepannotations for readable execution logs
- Uses Allure
-
models
POJOs forBookandAuthorentities- Jackson-based serialization / deserialization
-
specs
CentralizedSpecFactory- Global headers
- Base URI
- Allure request/response filters
-
tests
Organized test suites covering:- CRUD operations
- Performance validation
- Negative and resilience scenarios
To meet enterprise-grade expectations, the following strategic decisions were implemented:
-
Environment Resilience (Constructor vs Builder)
Although Lombok is used in the project, test data creation intentionally relies on Constructor / Setter patterns.
This avoids IDE-dependent annotation processing issues and guarantees 100% stability in CI and Docker environments. -
Contract Validation
Every Happy Path test validates theContent-Typeheader to ensure strict adherence to the JSON response contract. -
Fail-Fast Debugging
Client requests include.log().ifValidationFails()to keep console output clean while still providing actionable logs on failure. -
Performance SLA Tracking
Hamcrest matchers assert that API response times remain within business SLA limits (< 2 seconds).
The framework contains 20 high-impact automated test cases with a 100% pass rate.
Happy Path
- Full CRUD operations (Create, Read, Update, Delete)
Performance
- Response time verification for global books list
Negative & Edge Scenarios
- Mass deletion protection (
DELETEon base URL forbidden) - Boundary validation for ID
0β404 Not Found - Payload validation for empty title values
Business Logic
- Comprehensive CRUD coverage for author entities
Performance
- SLA monitoring for author data retrieval
Edge Cases
- Non-existing ID handling (
404 Validation) - Input validation for empty author name fields
The framework is fully containerized to guarantee consistent execution across environments.
docker build -t bookstore-automation-ata .sudo rm -rf allure-results && docker run --rm -v "$(pwd)/allure-results:/app/target/allure-results" bookstore-automation-atard /s /q allure-results & docker run --rm -v "%cd%/allure-results:/app/target/allure-results" bookstore-automation-ataView the report locally using Allure:
allure serve allure-results- Language: Java 21
- API Library: Rest-Assured 5.5.x
- Test Engine: TestNG 7.x
- Infrastructure: Docker & GitHub Actions
This project is intentionally designed to reflect how API automation is built and maintained in real production teams,
not simplified demo examples.