API Test Automation Framework
This project is a zero-code API test automation framework that leverages YAML to define test cases and supports advanced validations.
โจ Key Features
- Data-driven Testing using YAML โข Test cases are written entirely in YAML files, making the framework easily extensible and human-readable. โข No need to write Java code to add or update test cases.
- No-Code Automation โข Users can simply define the test case details such as URI, method, headers, body, and validations in a structured YAML format. โข The framework parses and executes all test logic using Java under the hood.
- Comprehensive Validation Support โข Schema Validation: Uses JSON Schema Draft-04 to validate response structure and types. โข Response Validation with Placeholders: Validates response using JsonNode, supporting smart assertions like $notnull to check for dynamically generated fields.
src
โโโ test
โโโ java
โ โโโ com.gyan.test // TestNG test classes
โ โโโ com.gyan.model // POJOs for test data
โ โโโ com.gyan.validator // Response validators
โ โโโ com.gyan.filter // RestAssured request filter (curl logger)
โ โโโ com.gyan.util // Utilities: YAML loader, schema validator
โโโ resources
โโโ testcases.yaml // Test data in YAML format
- ๐ Data-driven via YAML
- ๐ Schema Validation using JSON Schema
- ๐งช Custom response validations including
$notnull
placeholders - ๐ Test filtering by
testcaseType
(e.g.REGRESSION
,SMOKE
) - ๐ Auto-generated cURL for each request
- ๐ Thread-safe Extent Reports
Tool | Purpose |
---|---|
Rest Assured | API Testing |
TestNG | Test Runner |
Jackson + YAML | YAML Data Loading |
Extent Reports | HTML Reporting |
JSON Schema | Schema Validation |
Maven | Build Management |
mvn clean test
After running tests, open the generated Extent report:
test-output/ExtentReports/ExtentReport.html
mvn clean
Feel free to fork this repository and contribute! Raise issues or feature requests via GitHub issues.