TE
testsmith-io/api-test-automation-java-testng-restassured
API Test Automation Examples using Java, TestNG, and RestAssured for practicesoftwaretesting.com
API Test Automation with Java, TestNG and Rest Assured
This repository contains example scripts for API test automation using:
- Java
- Rest Assured for API interaction
- TestNG for test execution
Features
- Examples of GET, POST, and Protected API requests.
- Clear demonstration of test automation practices with assertions and chaining requests.
- Fully automated CI pipeline using GitHub Actions.
Test API
All examples in this repository are designed to work with the Practice Software Testing API, a publicly available API for learning and practicing software testing. You can explore the API documentation and endpoints here:
๐ Practice Software Testing API ๐
Examples Included
- GET Request: Fetch a list of brands with
GET /brands. - Login API: Authenticate using
POST /loginwith an email/password payload. - Protected API Request: Authenticate, then use a token to fetch data with
GET /invoices.
Prerequisites
- Java 16+
- Maven
- An IDE like IntelliJ IDEA Community Edition
Setup and Run
- Clone this repository:
git clone https://github.com/testsmith-io/api-test-automation-java-testng-restassured.git
- Navigate to the project directory:
cd api-test-automation-java-testng-restassured - Run the tests:
mvn test
Automated Workflow
The repository includes a GitHub Actions workflow to automatically build and test the project.