Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 2.12 KB

README.md

File metadata and controls

53 lines (40 loc) · 2.12 KB

Automating NYTimes Books API Validation

API automation using Serenity, Rest Assured and Cucumber for the Books endpoint of New York Times.

📦 How do I set up

Pre-requisite:

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

🏗 Build

Go to the project's root directory(automation-serenity) and Run

gradle build -x test

✅ Test

Run the tests using the command as below or use 'Run' function in your IDE on testapi.feature

gradle test

📈 Reports

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

💚 Gitlab Integration

  • 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.

    Refer Sample Single Page HTML Report.

🥒 Extending Tests

  • 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