Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ozandonder/rest-assured-java-cucumber-json-server-api-test
Java, Rest Assured, Junit5, Cucumber, Json-server
https://github.com/ozandonder/rest-assured-java-cucumber-json-server-api-test
cucumber cucumber-java java json-server junit5 lombok maven page-object-model rest-assured
Last synced: about 1 month ago
JSON representation
Java, Rest Assured, Junit5, Cucumber, Json-server
- Host: GitHub
- URL: https://github.com/ozandonder/rest-assured-java-cucumber-json-server-api-test
- Owner: ozandonder
- Created: 2024-05-01T23:38:26.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-05-11T23:49:59.000Z (6 months ago)
- Last Synced: 2024-09-27T11:41:03.175Z (about 2 months ago)
- Topics: cucumber, cucumber-java, java, json-server, junit5, lombok, maven, page-object-model, rest-assured
- Language: Java
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Api Test Automation with Rest Assured-Cucumber
## Tools
* **Java17** - Lang
* **Intellij IDE** - IDE
* **Rest Assured** - API
* **Cucumber7** - Gherkin Lang Framework
* **Junit5** - Assertion & Validation Framework
* **Allure** - Raporting
* **Logback** - Logging
* **Json-server** - Database## Json Server Setup
* Installing JSON Server: https://www.digitalocean.com/community/tutorials/json-server
* Go to project path on terminal and run command
* Version 0.17.4 must be installed `npm install -g [email protected]````
json-server --port 7000 --routes routes.json --watch db.json
```## Test Run
1. It can be run based on scenario or feature by pressing the green RUN button on the IDE
2. Run with mvn command
> **Note:** allure must be setup
* Run with tags
```
mvn clean test -Dtest="CucumberRunnerTest" -D"cucumber.filter.tags=@verify_user_deleted" -DthreadCount=1
```
* Run with groups```
mvn clean test -Dgroups="smoke"
```
* System env```
mvn clean test -Denv="local"
```## Allure
* Run command
`allure serve target/allure-results `
## Project Structure
```
├── src
│ ├── test
│ │ ├── java
│ │ │ ├── api
│ │ │ │ ├──callers
│ │ │ │ └── user
│ │ │ │ ├── models
│ │ │ │ └── user
│ │ │ │ ├── requests
│ │ │ ├── configs
│ │ │ ├── globals
│ │ │ ├── steps
│ │ │ │ └── user
│ │ │ ├── utils
│ │ │ └── CucumberRunnerTest
│ │ ├── resources
│ │ │ ├── features
│ │ │ │ └── user
│ │ │ │ └── create_user.feature
│ │ │ ├── allure.properties
│ │ │ ├── logback.xml
├── db.json
├── routes.json
├── pom.xml
└── README.md
```## Naming Convention
```
package name = my_packagefile name = MyFile
feature file name = my_feature_file.feature
class name = MyClass
method name = myMethodName
variable name = myVariable
enum = ALL_CAPITAL
tag name = @my_tag
api caller class = MyClassApiCaller
api request class = MyClassApiRequest
api request model json = myModel.json
```## Tagging
* When tagging scenarios snake_case should be used
```
@smoke = A scenario/feature which is expected to run in the smoke scope
@prod = Scenarios to be run on prod environment
@regression = Cases to be run during regression
@feature_tag = Tag name to be given to each feature file. Example: @feature_login
@scenario_tag = The unique tag to be given to each scenario. Example: @success_login
```