Sample automation project to practice RestApi using:
- Java Cucumber
- TestNG (with parallel test)
- Rest Assured
- Maven
- Allure Reporting
Tests can be executed in parallel using:
- pom.xml
- testng.xml
- TestRunner.java
Note: Reporting folderallure-results
will be cleaned before each run. To avoid it commentFileSystem.deleteOldReports()
in@BeforeSuite
of TestRunner.java
- Setup Node
- Install
npm i json-server
ornpm i json-server -g
- Create a db.json file
- Run
json-server --watch db.json
- Access server on
localhost:3000
Reference Link
- In Common.java, reusable methods are added using
RequestSpecBuilder
andRequestSpecification
- In servicehelpersPackage, reusable methods are added using given(), when(), etc
- To generate POJO - https://www.jsonschema2pojo.org/
- JSON Schema Validation
- File Upload and Download using RestAssured
- Allure Tags
@Epic @Features @Stories/@Story @Severity(SeverityLevel.BLOCKER) @Description("In this cool test we will check cool thing") @Step @Attachment @Link @Owner