pytestifyx is a pytest-based automation testing framework for api, ui, app testing
Project description
PyTestifyx 🚀
基于pytest的现代化自动化测试框架,支持API、UI、APP全场景测试
PyTestifyx 是一个功能强大且易于使用的测试自动化框架,专为现代软件测试需求而设计。它集成了众多优秀的测试工具和库,为测试工程师提供一站式的测试解决方案。
✨ 主要特性
🔧 核心功能
- 多场景支持: API测试、Web UI测试、移动APP测试
- pytest集成: 基于pytest生态,享受丰富的插件系统
- 数据驱动: 内置数据工厂,支持多种测试数据生成策略
- 智能断言: 支持数据库断言、深度对比等高级断言
- 报告系统: 美观的测试报告和日志系统
🛠️ 技术栈
- Web测试: Playwright集成,支持现代浏览器
- API测试: 基于requests,支持RESTful API测试
- 数据库: 支持多种数据库操作和断言
- 协议支持: Dubbo协议支持
- 消息推送: 支持邮件、飞书等通知方式
🌟 独特优势
- 中文友好: 内置中文字符处理优化
- 模块化设计: 灵活的架构,易于扩展
- 工具丰富: 包含Fiddler解析、图片转Base64等实用工具
- 装饰器支持: 提供登录、数据库等常用装饰器
📦 快速安装
pip install pytestifyx
🚀 快速开始
1. 创建项目脚手架
pytestifyx create-project my-test-project
2. 编写第一个API测试
import pytest
from pytestifyx import TestCase
class TestAPI(TestCase):
def test_get_user_info(self):
response = self.api.get("/api/user/1")
assert response.status_code == 200
assert response.json()["id"] == 1
3. 运行测试
pytest tests/ -v
📚 功能模块
| 模块 | 功能描述 | 主要特性 |
|---|---|---|
| Core | 核心测试基类 | 统一的测试入口和配置管理 |
| Driver | 驱动管理 | Web/API驱动的统一管理 |
| Utils | 工具集合 | 日志、数据工厂、装饰器等 |
| Database | 数据库操作 | 数据库连接、断言、用例管理 |
| Data Factory | 数据生成 | 智能测试数据生成和管理 |
| Message Push | 消息通知 | 测试结果推送和通知 |
🔧 配置示例
# pytestifyx.yaml
database:
host: localhost
port: 3306
user: test_user
password: test_pass
api:
base_url: https://api.example.com
timeout: 30
logging:
level: INFO
format: detailed
📈 版本历史
查看 CHANGELOG.md 了解详细的版本更新内容。
最新版本 v0.9.0
- ✅ 全新的模块化架构
- ✅ 增强的数据工厂功能
- ✅ 改进的日志系统
- ✅ 新增Fiddler解析工具
- ✅ 优化中文字符处理
🤝 贡献指南
我们欢迎所有形式的贡献!请查看我们的贡献指南了解如何参与项目开发。
- Fork 项目
- 创建功能分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启 Pull Request
📄 许可证
本项目基于 Apache License 2.0 许可证开源。详见 LICENSE 文件。
🔗 相关链接
🙋♂️ 支持与反馈
如果您在使用过程中遇到问题或有改进建议,请:
⭐ 如果这个项目对您有帮助,请给我们一个星标支持!
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 Distributions
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 pytestifyx-0.9.5-py2.py3-none-any.whl.
File metadata
- Download URL: pytestifyx-0.9.5-py2.py3-none-any.whl
- Upload date:
- Size: 65.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d48761070bcdf092e047c79f25ad2ed892f21466bdf5bd0efd0c2a685a0f03ce
|
|
| MD5 |
a3de3d980fb5e5bac4674f6983683912
|
|
| BLAKE2b-256 |
0ada1cef36c45c8807794d0f4dadcca596858d6e80e90ad8a130f3617d9efe0e
|