This repository contains automated tests for the Restful Booker API. The tests are written using Postman and executed with Newman.
The Restful Booker API provides a set of endpoints for managing bookings, including creating, updating, retrieving, and deleting bookings. This project automates the testing of these endpoints to ensure their correctness and reliability.
The following API endpoints are covered in the automation:
-
Auth
POST /auth
: Create a new authentication token.
-
Booking
GET /booking
: Retrieve a list of booking IDs.GET /booking/:id
: Retrieve the details of a specific booking.POST /booking
: Create a new booking.PUT /booking/:id
: Update an existing booking.PATCH /booking/:id
: Partially update an existing booking.DELETE /booking/:id
: Delete a booking.
- Node.js installed on your machine.
- Newman installed globally:
npm install -g newman
- Postman installed for running and modifying the collections.
Clone this repository to your local machine:
git clone https://github.com/sadmanpieal/Restfull-Booker-API-.git
cd Restfull-Booker-API-
To run the tests using Newman, use the following command:
newman run Restful-booker.postman_collection.json
or
newman run Restful-booker.postman_collection.json --env-var "variable_name=variable_value"
- If your collection requires environment variables but you don't want to use an environment file, you can pass individual variables directly in the command line using the --env-var option:
If you wish to generate an HTML report after running the tests, use:
node .\reports.js
- before that delete the report.html file from Reports folder
- The report will be saved as
report.html
. - Report will look like this
If you would like to contribute to this project, please fork the repository and submit a pull request. All contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.