This project uses Rest Assured with Allure reporting to automate API tests against the DummyJSON API.
We cover the following endpoints:
- GET /test – health check endpoint
- GET /users – retrieve paginated list of users
- POST /auth/login – authenticate a user and receive tokens
- GET /auth/products – retrieve authenticated products list
- POST /products/add – create a new product
- GET /products – retrieve paginated list of products
- GET /products/{id} – retrieve a single product by ID
qa-api-tests/
├── src/
│ ├── main/
│ │ └── java/com/dummyjson/rest/client # Rest Assured client classes
│ └── test/
│ └── java/com/dummyjson/rest/tests # Test classes by feature
├── schemas/ # JSON Schema files for validation
├── allure-results/ # Allure raw results (gitignored)
├── allure-report/ # Generated Allure report
├── pom.xml # Maven configuration
└── README.md # Project documentation
- Java 11 or higher
- Maven 3.6+
- Internet access to
https://dummyjson.com
-
Clone the repository and switch to
mainbranch:git clone git@gitlab.com:yourgroup/qa-api-tests.git cd qa-api-tests git checkout main -
The
pom.xmldefines dependencies for Rest Assured and Allure reporting. -
(Optional) Set
BASE_URIvia environment variable if overriding default:export API_BASE_URL=https://dummyjson.com
Run tests with Maven:
mvn clean testGenerate and open Allure report:
mvn allure:serveThis will compile results into allure-report/ and open it in your default browser.
-
Scope: Cover functional and negative scenarios for all listed endpoints.
-
Architecture:
- Clients encapsulate Rest Assured requests and common specifications (logging, filters).
- Factories generate valid and invalid DTOs for data-driven tests.
-
Test Categories:
- Health Check (
GET /test) - User flows (
GET /users) - Authentication (
POST /auth/login) - Product operations (
GET /auth/products,POST /products/add,GET /products,GET /products/{id})
- Health Check (
-
Validation:
- Schema validation with JSON Schema files in
/schemas - Response body and status code assertions
- Negative tests for error status codes and messages
- Schema validation with JSON Schema files in
-
Bugs Identified:
- None in DummyJSON (mock service) but tests include negative scenarios to simulate failures.
-
Suggested Improvements:
- Add parameterized boundary tests for product price and rating.
- Enhance concurrency tests for bulk product creation.
- Integrate CI pipeline to run
mvn clean testand publish Allure report on merge tomain.
- Allure Results are stored in
allure-results/(ignored by Git). - Allure Report can be generated via
mvn allure:reportand published as pipeline artifact.
Last updated: May 26, 2025