🛰️ SputnikQA — Test Automation Framework
SputnikQA — это современный, типизированный и расширяемый фреймворк для написания автотестов на Python.
Идеально подходит для команд, которые хотят писать читаемые, надёжные и поддерживаемые автотесты.
Установка
# Основной пакет
pip install sputnikqa
# С интеграцией Allure
pip install sputnikqa[allure]
# С поддержкой httpx
pip install sputnikqa[httpx]
# С полной функциональностью (рекомендуется)
pip install sputnikqa[allure,httpx]
Основные возможности
-
restapi booster
- Типизированные модели ответов через
Pydantic - Автоматическая валидация статуса и тела ответа
- Декларативные секции API (
BaseApiSection) — по аналогии с Page Object - Билдеры запросов — для удобного формирования тел и multipart-загрузок
- Поддержка middleware — логирование, авторизация, retry и др.
- Встроенная интеграция с Allure:
- шаги с
@allure.step - прикрепление cURL, статуса и тела ответа
- шаги с
- Гибкий HTTP-клиент — поддержка
httpx* и кастомных реализаций - Поддержка async/await через
AsyncApiClient
*Для использования
httpxтребуется установка дополнительной зависимости:pip install sputnikqa[httpx] - Типизированные модели ответов через
Пример использования
1. Определите модель ответа
from sputnikqa.boosters.restapi.response_models import JsonResponse
class Pet(JsonResponse):
id: int | None = None
name: str
status: str
2. Создайте секцию API
from sputnikqa.boosters.restapi.sections.base import BaseApiSection
class PetSection(BaseApiSection):
base_url = "https://petstore.swagger.io/v2"
def get_pet_by_id(self, pet_id: int):
response = self.client.get(self.url_join(f"/pet/{pet_id}"))
return (
self.validator(response)
.validate_status(200)
.validate_response_model({200: Pet})
)
3. Напишите тест
def test_get_pet(pet_section):
pet = pet_section.get_pet_by_id(1).get_validated_model()
assert pet.name == "doggie"
assert pet.status == "available"
Архитектура
sputnikqa/
├── boosters/
│ └── restapi/
│ ├── clients/ # HTTP-клиенты (httpx* и др.)
│ ├── middleware/ # Middleware (логирование, авторизация)
│ ├── request_builders/ # Билдеры (тело, файлы)
│ ├── response_models/ # Базовые модели ответов
│ ├── sections/ # Базовый класс секций
│ └── validators/ # Валидаторы ответов
└── integrations/
└── allure/ # Интеграция с Allure
> *Клиент httpx доступен после установки: `pip install sputnikqa[httpx]`
Интеграции
Allure
Автоматически прикрепляет к отчёту:
- cURL-команду запроса
- HTTP-статус
- тело ответа
from sputnikqa.integrations.allure.client import ApiClientAllure
from sputnikqa.integrations.allure.middleware import AllureMiddleware
from sputnikqa.boosters.restapi.clients.httpx_client import HttpxClient
client = ApiClientAllure(HttpxClient(), middlewares=[AllureMiddleware()])
Требуется:
pip install sputnikqa[allure,httpx]
Для разработчиков
Хотите расширить фреймворк?
- Реализуйте свой
BaseHttpClientдля кастомного HTTP-стека. - Напишите middleware для авторизации, retry или трассировки.
- Используйте
PrimitiveResponseдля обёртки примитивов (str,int,dict).
Лицензия
Distributed under the MIT License. See LICENSE for more information.
SputnikQA — ваш надёжный спутник в мире автоматизации тестирования.
📌 PyPI: https://pypi.org/project/sputnikqa/
📌 GitVerse: https://gitverse.ru/crenom/SputnikQA
Metadata
Release files for sputnikqa 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sputnikqa-0.0.10.tar.gz | 59.0 kB | Without provenance | Details for sputnikqa-0.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sputnikqa-0.0.10-py3-none-any.whl | Python 3 | none | any | Details for sputnikqa-0.0.10-py3-none-any.whl |
Total release size: 157.5 kB
Release files / sputnikqa-0.0.10.tar.gz
| Download URL | sputnikqa-0.0.10.tar.gz |
|---|---|
| Size | 59.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acbbfe5dc9e66b0ff344804cdaded223b1d9e1a020b30f1096723faa08db6fcb
|
|
BLAKE2b-256 checksum How to use checksums |
f90ed3033d78edd5a05c85c8c8f4a2b8434ab176ecf00d0e4ff8b97778d3966b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.16 Linux/5.15.0-144-generic
|
Release files / sputnikqa-0.0.10-py3-none-any.whl
| Download URL | sputnikqa-0.0.10-py3-none-any.whl |
|---|---|
| Size | 98.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f7d5f822ddfa70f571f8a6f22717f7217c8c348c09f4bf01f650326855386e4
|
|
BLAKE2b-256 checksum How to use checksums |
186ffd11f7cf8406394f5783736856a5a9a6b9e61dad79187c502890762e872a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.16 Linux/5.15.0-144-generic
|
Security for sputnikqa 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.