Comprehensive Python framework for automated testing of web applications
Project description
py-web-automation
A comprehensive Python framework for automated testing of web applications, providing clients for API testing (REST, GraphQL, gRPC, SOAP), WebSocket communication, UI testing, and database operations.
Features
- Multiple API Protocols: REST, GraphQL, gRPC, SOAP, and WebSocket support
- Browser Automation: Playwright-based UI testing
- Database Testing: Support for PostgreSQL, MySQL, and SQLite with adapter pattern
- Type Safety: Complete type annotations with 100% coverage
- Async-First: Built on async/await for high performance
- Request Builder: Fluent API for constructing complex HTTP requests
- Response Validation: Fast schema validation using msgspec
- Error Handling: Structured exception hierarchy
- Configuration Management: Flexible configuration with environment variables and YAML support
Installation
# Using uv (recommended)
uv add py-web-automation
# Or using pip
pip install py-web-automation
Quick Start
API Testing
import asyncio
from py_web_automation import ApiClient, Config
async def main():
config = Config(timeout=30)
async with ApiClient("https://api.example.com", config) as api:
result = await api.make_request("/users/1", method="GET")
print(f"Status: {result.status_code}, Success: {result.success}")
asyncio.run(main())
UI Testing
import asyncio
from py_web_automation import UiClient, Config
async def main():
config = Config(timeout=30)
async with UiClient("https://example.com", config) as ui:
await ui.setup_browser()
await ui.page.goto("https://example.com")
await ui.click_element("#button")
await ui.take_screenshot("result.png")
asyncio.run(main())
Database Testing
import asyncio
from py_web_automation import DBClient, Config
async def main():
config = Config()
db = await DBClient.create(
"https://example.com",
config,
db_type="postgresql",
connection_string="postgresql://user:pass@localhost/db"
)
async with db:
results = await db.execute_query("SELECT * FROM users WHERE id = :id", {"id": 1})
print(results)
asyncio.run(main())
Available Clients
- ApiClient: HTTP REST API testing
- GraphQLClient: GraphQL API testing
- GrpcClient: gRPC API testing
- SoapClient: SOAP API testing
- WebSocketClient: WebSocket communication
- UiClient: Browser automation with Playwright
- DBClient: Database operations with multiple backend support
Documentation
- Comprehensive Guide - Полное руководство по всему функционалу ⭐
- Quick Start Guide
- API Reference
- Architecture
- Examples
- Testing Guide
- Troubleshooting
Requirements
- Python >= 3.13
- See
pyproject.tomlfor dependencies
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Changelog
See CHANGELOG.md for a list of changes and version history.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_web_automation-1.0.0.tar.gz.
File metadata
- Download URL: py_web_automation-1.0.0.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec3382ae11f26b387f4718b602718d08123cbd41b8c383a38703608fe4c070ad
|
|
| MD5 |
2360d98dcf39f0d59b17bdf254636093
|
|
| BLAKE2b-256 |
6688bb3223df2c6642ea15e2de28ff16571e79b14ab9a25efa630ead48d03b9d
|
File details
Details for the file py_web_automation-1.0.0-py3-none-any.whl.
File metadata
- Download URL: py_web_automation-1.0.0-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdefa29a851b74ef3ea1fbb543783567c38fe141c1b3389d6a314f78011e48ad
|
|
| MD5 |
8c3a9e18c5a797cd8ce8ceb261867ccc
|
|
| BLAKE2b-256 |
cce94c77883ca2a94eabd5f2f78fa134f2e98ca94fd8aa16c98cd30261c5d644
|