A modern, pytest-based universal backend testing framework that supports testing Java, Go, Python and other Web systems. Features layered architecture design, flexible configuration management, comprehensive logging, and database integration.
- 🏗️ Layered Architecture: Clear separation of concerns with core, API, business, and test layers
- 🔧 Flexible Configuration: YAML-based configuration supporting multiple environments and IDCs
- 📊 Comprehensive Logging: Automatic LogID generation with end-to-end tracing
- 🗄️ Database Integration: Complete database testing support with connection pooling
- ⚡ Parallel Testing: Built-in support for parallel test execution
- 📈 Rich Reporting: Allure reports and code coverage analysis
- 🎯 Test Classification: Separation of framework demo and business case tests
- 🛠️ Command Line Interface: Easy-to-use
ptecommand for test execution
- Quick Start Guide - Get up and running in minutes
- User Guide - Comprehensive usage instructions
- Architecture Guide - Design principles and system architecture
- Installation Guide - Detailed installation instructions
The PTE Framework follows a clear layered architecture design:
┌─────────────────────────────────────────────────────────────┐
│ Test Layer (test/) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Business Logic Layer (biz/) │ │
│ │ ┌─────────────────────────────────────────────┐ │ │
│ │ │ API Interface Layer (api/) │ │ │
│ │ │ ┌─────────────────────────────────────┐ │ │ │
│ │ │ │ Core Framework Layer │ │ │ │
│ │ │ │ (core/) │ │ │ │
│ │ │ └─────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Core Layer (
core/): Universal framework functionality, data validation, logging, database operations - API Layer (
api/): HTTP client wrapper with LogID support and request/response handling - Business Layer (
biz/): Business logic operations and database integration - Test Layer (
test/): Test case writing using business layer functionality
pte/
├── config/ # Configuration management
│ ├── env.yaml # Environment management
│ ├── common.yaml # Common settings
│ ├── local_test.yaml # Local environment
│ └── settings.py # Configuration manager
├── core/ # Core framework layer
│ ├── checker.py # Universal data validator
│ ├── logger.py # Logging system
│ ├── db_checker.py # Database operations
│ └── fixtures.py # Test fixtures
├── api/ # API interface layer
│ ├── client.py # HTTP client wrapper
│ └── config.py # API configuration
├── biz/ # Business logic layer
│ └── department/ # Business modules
├── test/ # Test case layer
│ └── department/ # Test modules
├── scripts/ # Utility scripts
└── docs/ # Documentation
Test Case → Business Operations → API Client → HTTP Request → Target System
↓ ↓ ↓ ↓ ↓
Logging → Business Logging → API Logging → Request Logging → Response Logging
Environment Variables → Config Manager → IDC Config → Common Config → Default Values
↓ ↓ ↓ ↓ ↓
Override Values → Merged Configuration → Framework Components
Test Execution → Log Class → File Logger → Allure Reporter → Console Output
↓ ↓ ↓ ↓ ↓
LogID → Structured Log → File Output → Allure Report → Console Display
- Install the Framework: Follow the Installation Guide
- Quick Start: Read the Quick Start Guide
- Learn Usage: Explore the User Guide
- Understand Architecture: Review the Architecture Guide
- Write Your Tests: Start with the examples in the user guide
We welcome contributions! Please see our contributing guidelines:
- Fork the project
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check our comprehensive documentation
- Issues: Report bugs and request features via GitHub Issues
- Discussions: Join our GitHub Discussions
PTE Framework - Universal Backend Testing Made Simple 🚀