Sample RestAssured Project
Prerequisites
- Java 8+
- Maven 3+
Tools
- TestNG for running tests
- RestAssured for performing API tests
Running tests on local environment
- Make sure that you have JDK 1.8 or greater and Maven 3 installed.
- Put your GitHub username and token into GITHUB_USER and GITHUB_TOKEN env variables
- Run tests with
mvn clean test
Running tests with Docker
If you have Docker installed, you may run tests in Docker containers. Don't forget to update GITHUB_USER and GITHUB_TOKEN env variables
docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven -e GITHUB_TOKEN=${GITHUB_TOKEN} -e GITHUB_USER=${GITHUB_USER} maven:3.3-jdk-8 mvn clean test
Getting test run report
The project uses Allure reporting tool.
- Build the reports to temp folder and view:
mvn allure:serve
- Build reports and save to target/site
mvn allure:report
Also, you may use Allure commandline tool.
The report files will be placed to target/allure-results
forlder
Improvements
Some checks might be excessive for assessment, however, they should be mentioned:
- Add JSON Schema validation