|
1 | 1 | # API Automation Using Rest Assured & TestNG
|
2 | 2 |
|
3 |
| -This project serves as a boilerplate for automating REST APIs across various environments using TestNG and the Rest Assured library. |
| 3 | +This project provides a template for automating REST API testing across multiple environments using TestNG and the Rest Assured library. |
4 | 4 |
|
5 | 5 | [](https://github.com/osandadeshan/rest-assured-java-api-automation-demo/actions/workflows/rest-assured-java-ci.yml)
|
6 | 6 |
|
7 | 7 | ## Prerequisites
|
8 | 8 | 1. Java
|
9 | 9 | 2. Maven
|
10 |
| -3. NodeJS |
| 10 | +3. IntelliJ IDEA |
| 11 | + |
| 12 | +## Project structure |
| 13 | + |
| 14 | +``` |
| 15 | +.github/ # GitHub-specific configurations |
| 16 | +logs/ # Log4j log files are stored here |
| 17 | +reports/ # Extent report files are generated in this location |
| 18 | +src/ |
| 19 | +├── main/ |
| 20 | +│ ├── java/ |
| 21 | +│ │ └── com/ |
| 22 | +│ │ └── restassured/ |
| 23 | +│ │ └── example/ |
| 24 | +│ │ ├── Category.java |
| 25 | +│ │ ├── HttpMethod.java |
| 26 | +│ │ ├── constant/ # Application-wide constants |
| 27 | +│ │ │ ├── ApplicationConstant.java |
| 28 | +│ │ │ ├── AuthenticationConstant.java |
| 29 | +│ │ │ ├── CommonConstant.java |
| 30 | +│ │ │ └── ReporterConstant.java |
| 31 | +│ │ ├── service/ |
| 32 | +│ │ │ ├── ExtentReportService.java # Extent report setup services |
| 33 | +│ │ │ └── app/ # Application service classes |
| 34 | +│ │ │ ├── AuthenticationService.java |
| 35 | +│ │ │ └── UserService.java |
| 36 | +│ │ └── util/ # Utility methods |
| 37 | +│ │ ├── AnnotationReader.java |
| 38 | +│ │ └── FileReader.java |
| 39 | +│ │ └── JsonFormatter.java |
| 40 | +│ │ └── Log4jFilter.java |
| 41 | +│ │ └── RestClient.java |
| 42 | +│ │ └── TestListener.java |
| 43 | +│ └── resources/ # Resource files for logging and reporting |
| 44 | +│ ├── log4j2.xml |
| 45 | +│ └── test-reporter.properties |
| 46 | +├── test/ |
| 47 | +│ ├── java/ |
| 48 | +│ │ └── com/ |
| 49 | +│ │ └── restassured/ |
| 50 | +│ │ └── example/ |
| 51 | +│ │ └── test/ |
| 52 | +│ │ ├── constant/ # Test constants (e.g., status, categories) |
| 53 | +│ │ │ ├── Gender.java |
| 54 | +│ │ │ ├── Status.java |
| 55 | +│ │ │ └── TestCategory.java |
| 56 | +│ │ ├── AuthTest.java # Authentication tests |
| 57 | +│ │ ├── BaseTest.java # Base test class setup |
| 58 | +│ │ ├── CreateUserTest.java # API test for creating a user |
| 59 | +│ │ ├── DeleteUserTest.java # API test for deleting a user |
| 60 | +│ │ ├── GetAllUsersTest.java # API test for fetching all users |
| 61 | +│ │ └── UpdateUserTest.java # API test for updating a user |
| 62 | +│ └── resources/ |
| 63 | +│ └── env/ # Environment configurations |
| 64 | +│ ├── dev.properties |
| 65 | +│ ├── pre-prod.properties |
| 66 | +│ ├── prod.properties |
| 67 | +│ ├── qa.properties |
| 68 | +│ └── uat.properties |
| 69 | +│ └── regression-suite.xml # TestNG test suites configuration |
| 70 | +│ └── smoke-suite.xml |
| 71 | +target/ # Compiled code and build artifacts are stored here |
| 72 | +.gitignore # Specifies files and directories to be ignored by Git |
| 73 | +LICENSE # License information for the project |
| 74 | +pom.xml # Maven configuration file for dependencies and build settings |
| 75 | +README.md # Repository overview and instructions (This file) |
| 76 | +``` |
11 | 77 |
|
12 | 78 | ## How to run tests
|
13 | 79 | 1. Using IntelliJ IDEA
|
|
0 commit comments