API automation using Serenity, Rest Assured and Cucumber for the Books endpoint of New York Times.
These should be installed in your local machine.
* Java 11
* Gradle 7
- Clone the project using git into your local directory
git clone https://gitlab.com/sreesl/automation-serenity
Go to the project's root directory(automation-serenity) and Run
gradle build -x test
Run the tests using the command as below or use 'Run' function in your IDE on testapi.feature
gradle test
Inorder to generate report, run the command and respective report will be available in target/site/serenity/ as index.html and serenity-summary.html
gradle report
-
The tests are set to run in the pipeline in GitLab for every checkin.
-
Add Gitlab config file
.gitlab-ci.yml
- Add task to run your build script
- Add task to run your test
- Add task to generate report
-
You can trigger the pipeline by clicking on "Run Pipeline" in the UI.
-
HTML reports are saved as artifacts in the gitlab.com/{username}/automation-serenity/-/jobs/{job_number}/artifacts/browse for each job run.
Refer Sample INDEX HTML Report.
- Add new test scenarios in the feature file testapi.feature
- Add corresponding steps for the new scenarios in the stepDefinitions file stepDefinition
Refer further Cucumber Documentation