This repository contains a sample API testing framework in Python for testing the Reqres API. The framework is designed to demonstrate how to perform automated API testing using popular libraries and tools.
To run this project, you need to have the following installed on your system:
- Python 3.x
- pip (Python package manager)
-
Clone this repository to your local machine:
git clone https://github.com/absiddik7/API_Testing_Python
-
Navigate to the project directory:
cd API_Testing_Python -
Install the required dependencies:
pip install -r requirements.txt
This project uses Pytest for writing and running test cases. The test cases are written in Python and can be found under the 'test' directory.
To run all the test cases, use the following command:
pytestTo run a specific test cases, use the following command (ex: pytest test_folder/test_file_name.py):
pytest test/test_create_user.pyTo run and generate full HTML details report of all the executed test, you can simply write the following commands on Terminal: Install Pytest-HTML by writing the following command on Terminal
pip install pytest-htmlThen write the following command on Terminal
pytest --html==YOUR_REPORT_FILE_NAME.htmlFor this project we generate the report file as below
pytest --html==report.htmlTo see the reports, open the Project window, and then right-click report.html to open the file on a browser.
