Table of Contents
The objective of this project is to develop an Integration Test Suite for a REST API application using the Pytest and Requests libraries from Python, with the goal of establishing a simple testing framework with logs and reports.
REST API testing frameworks help ensure the functionality, reliability, security, and performance of the APIs. This framework includes functionalities for initiating HTTP requests, validating responses, and conducting functional testing.
But why do this with Python?
- Rich functionality
- Clear documentation
- Cleaner tests
- Scalable
- It's FREE!
1. Create a todo task:
- Create, read, verify
2. Update a todo task:
- Create, update, read, verify
3. List created tasks:
- Create, list, verify
4. Delete a specific task:
- Create, delete, read, verify
Each test case is executed independently.
API Endpoint: https://todo.pixegami.io
Documentation: https://todo.pixegami.io/docs
-
To use the Script:
-
To access the Reports
- Clone the repo.
git clone https://github.com/sschuckk/py-test-api-todotask
- Install the packages according to the configuration file 'requirements.txt'.
pip install -r requirements.txt
The project can be run by a terminal or directly in your IDE.
In your terminal go to the project folder and run:
-
For a simples execution:
pytest -v
-
To enable and show the logs on terminal:
pytest -v --log-cli-level=INFO
-
To execute with reports by Allure plugin:
pytest -v --alluredir=py_test_api/reports
To show the reports:
allure serve py_test_api/reports
The test Log and Reports serves to offer a historical record of the testing process which can be used by the testing, development, product team, and other stakeholders.
Each execution of this framework will generate a log that will be stored inside the folder 'py_test_api/logs'.
They are incremental and will be stored day by day:
This framework supports the Allure plugin which has everything you need to create, customize, and understand your test reports.
The reports can be stored and accessed inside the folder 'py_test_api/reports.'
Example of a report after simulating a fail result:
Go to Usage topic to learn how to execute and display the tests with reports.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project (
https://github.com/sschuckk/py-test-api-todotask/fork) - Create your Feature Branch (
git checkout -b feature/NewFeature) - Commit your Changes (
git commit -m 'Add some new feature') - Push to the Branch (
git push origin feature/NewFeature) - Open a Pull Request
Distributed under the MIT License. It’s free, no legal restrictions, why not try it out?





