https://github.com/prashant1507/bdd-restassured-framework
https://github.com/prashant1507/bdd-restassured-framework
allure-report bdd bdd-framework cucumber-jvm java maven parallel-tests rest-api testng
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/prashant1507/bdd-restassured-framework
- Owner: prashant1507
- Created: 2021-05-12T20:32:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-26T16:13:25.000Z (almost 4 years ago)
- Last Synced: 2025-01-09T04:45:52.156Z (4 months ago)
- Topics: allure-report, bdd, bdd-framework, cucumber-jvm, java, maven, parallel-tests, rest-api, testng
- Language: HTML
- Homepage:
- Size: 11.8 MB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
## _BDD RestAssured Automation Framework_
Sample automation project to practice RestApi using:
- Java Cucumber
- TestNG (with parallel test)
- Rest Assured
- Maven
- Allure Reporting### Test Runner
Tests can be executed in parallel using:
- [pom.xml](pom.xml)
- [testng.xml](testng.xml)
- [TestRunner.java](src/test/java/runner/TestRunner.java)
**Note:** Reporting folder `allure-results` will be cleaned before each run. To avoid it comment `FileSystem.deleteOldReports()` in `@BeforeSuite` of [TestRunner.java](src/test/java/runner/TestRunner.java)
### To Deploy Sample JSON Server
- Setup Node
- Install `npm i json-server` or `npm i json-server -g`
- Create a [db.json](src/test/resources/Files/db.json) file
- Run `json-server --watch db.json`
- Access server on `localhost:3000`
[Reference Link](https://www.npmjs.com/package/json-server)
### Note:
- In [Common.java](src/main/java/utilities/Common.java), reusable methods are added using `RequestSpecBuilder` and `RequestSpecification`
- In [servicehelpersPackage](src/main/java/servicehelpers), reusable methods are added using given(), when(), etc### Important Links:
- To generate POJO - [https://www.jsonschema2pojo.org/](https://www.jsonschema2pojo.org/)
- JSON Schema Validation
- [Reference Video](https://www.youtube.com/watch?v=3NiHE311Dbw&list=PL6tu16kXT9PpgqfMbMdzUzDenYgb0gbk0&index=18)
- [Maven Dependency](https://mvnrepository.com/artifact/io.rest-assured/json-schema-validator/4.3.3)
- File Upload and Download using RestAssured
- [Reference Video](https://www.youtube.com/watch?v=_NRgpI48ogQ&list=PL8VbCbavWfeE5aEeEpoXp2xiHi5K_7BMT&index=21)
- Allure Tags
```
@Epic
@Features
@Stories/@Story
@Severity(SeverityLevel.BLOCKER)
@Description("In this cool test we will check cool thing")
@Step
@Attachment
@Link
@Owner
```