A sample API test automation project in Pytest, using Requests, assertpy, and pytest-html.
The API chosen for testing was ReqRes. It simulates how a real application behaves, is highly available and accessible from anywhere. For more information, visit their website here.
The project uses Pytest as the test framework, assertpy as the assertion library, Requests as the HTTP client to perform API requests, and pytest-html to generate HTML reports.
A workflow is set up to install Python, install the required packages, run the tests, and publish the HTML report to GitHub Pages. The report can be viewed here.
- Install Python
- Install the project packages:
pip install -r requirements.txt
- Run the tests and generate the report:
python -m pytest --html=reports/index.html