Built a robust automated testing framework for the RESTful Booker API using pytest and requests, employing data-driven testing and pytest-html for detailed reporting and enhanced test coverage.
Link :-https://restful-booker.herokuapp.com/
File Structure
restful-booker-api-testing/
│
├── test_cases/
│ ├── __init__.py
│ ├── test_create_booking.py
│ └── ... (other test case files)
│
├── scripts/
│ └── practice_requests.py
│
├── reports/
│ └── report.html
│
├── pytest.ini
├── conftest.py
├── LICENSE
└── README.md
collections/
: Contains the Postman collection for the RESTful Booker API.test_cases/
: Contains the automated test scripts for various API endpoints.reports/
: Contains the test reports generated after running the tests.scripts/
: Contains examples of how to use the requests library to interact with the RESTful Booker API.README.md
: Project documentation and instructions.requirements.txt
: List of dependencies required for running the tests..gitignore
: Specifies files and directories to be ignored by Git.
-
Clone the repository:
git clone https://github.com/your-username/restful-booker-api-testing.git cd restful-booker-api-testing
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
To run the scripts -
python scripts/practice_requests.py
To run the tests, execute the following command:
pytest test_cases/
This project is licensed under the MIT License. See the LICENSE file for details.