It is a complete framework for automating API testing using Python and Pytest. This framework is used in the "Send Request" API.
- CRUD methods (GET, POST, PUT and DELETE) are supported
- Continuous testing with GitHub Actions
api-testing-framework/
โโ .github/
โ โโ workflows/
โ โ โโ run.yml
โโ api
โ โโ sendrequest_api/
โ | โโ auth_client.py
โ | โโ companies_client.py
โ | โโ issues_client.py
โ | โโ users_client.py
โ โโ api_client.py
โ โโ routes.py
โโ fixtures
โ โโ auth_fixture.py
โ โโ companies_fixture.py
โ โโ issues_fixture.py
โ โโ users_fixture.py
โโ tests/
โ โโ __init__.py
โ โโ test_auth.py
โ โโ test_companies.py
โ โโ test_issues.py
โ โโ test_users.py
โโ utils
โ โโ data/
โ | โโ load.py
โ โโ models/
โ | โโ auth_model.py
โ | โโ companies_model.py
โ | โโ users_model.py
โ โโ asserts.py
โ โโ logger.py
โ โโ parser.py
โโ .env
โโ .gitignore
โโ .pylintrc
โโ conftest.py
โโ docker-compose.yml
โโ Dockerfile
โโ LICENSE
โโ pytest.ini
โโ README.md
โโ requirements.txt
โโ settings.py
# Clone repository
git clone https://github.com/vypiemzalyubov/api-testing-framework.git
# Install virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run all tests
pytest tests/
# Run positive test cases
pytest -m "positive"
# Run negative test cases
pytest -m "negative"
Default startup options in
pytest.ini
:addopts = -s -v --tb=short --alluredir=allure-results
-
Install Allure from the official website
-
Generate Allure report
allure serve
# Build an image named "api-testing-runner"
docker build -t api-testing-runner .
# Launch the container
docker run api-testing-runner
# Running with Docker Compose
docker-compose up --build
-
Go to "Run workflow" in GitHub Actions
# Options in workflow - all_tests - positive_tests - negative_tests
-
View Allure test results after completing the GitHub Actions workflow