This Project API Automation Testing Using Rest Assured, Cucumber, JUnit and Serenity BDD for Reporting
-
Download Java OpenJDK 11 Tutorial Installation Java in Windows
-
Download Maven
*If your computer already installed Java and Maven, you can skip step number 1 and 2.
In order to added some Scenario BDD, we can create new file feature in directory src/test/resources/features
In order to translate the steps from Scenario BDD into executable actions, we write Java classes called Step Definitions
in directory src/test/java/steps
This project uses an x-api-key
header for API authentication. Ensure you include this header in each request.
There is a limit of 100 API requests per day per API key. This limitation is due to the restrictions applied to the x-api-key header.
If the limit is exceeded, the server will respond with:
HTTP 429 - Too Many Requests
The API key is stored in a serenity config
file located at:
src/test/resources/serenity.conf
Example content:
environments {
default {
api.key = "your_api_key_here"
}
sit {
api.key = "your_api_key_here"
}
prod {
api.key = "your_api_key_here"
}
}
mvn clean verify
file serenity.conf
located in folder src/test/resources
mvn clean verify -Denvironment=value
- file report located in
target/site/serenity/index.html
- Specific Test Details