This project implements automated tests for the API Course Test Server. The tests are written using Python, Pytest, Allure, Pydantic, Faker and HTTPX. The test application’s source code is available on GitHub.
The goal of this project is to automate the testing of the API Course server, focusing on REST API testing. The automated tests verify various functionalities of the application to ensure its stability and correctness.
This project is specifically designed for API autotests, incorporating best practices such as:
- API Clients for structured interaction with endpoints,
- Pytest fixtures for reusable and maintainable test setups,
- Pydantic models for strict data validation,
- Schema validation to ensure API contract correctness,
- Fake data generation to simulate real-world scenarios,
- And more advanced techniques to improve test efficiency and reliability.
- The project structure follows industry standards to ensure clarity, maintainability, and scalability of the test code.
To get started, clone the project repository using Git:
git clone https://github.com/Kami-Leon/autotests-api
cd autotests-apiIt's recommended to use a virtual environment to manage project dependencies. Follow the instructions for your operating system:
python3 -m venv venv
source venv/bin/activatepython -m venv venv
venv\Scripts\activateOnce the virtual environment is activated, install the project dependencies listed in requirements.txt:
pip install -r requirements.txtTo run the tests and generate an Allure report, use the following command:
pytest -m "regression" --alluredir=./allure-resultsThis will execute all tests in the project and display the results in the terminal.
After the tests have been executed, you can generate and view the Allure report with:
allure serve allure-resultsThis command will open the Allure report in your default web browser.