Automated test runner for embedded devices with templates, logs, and reports. Desktop GUI powered by PyQt5 and Python.
Qt Embedded Test Suite is a comprehensive desktop application designed for automating functional and electrical tests for embedded devices. Built with PyQt5, it provides a user-friendly interface for creating test templates, executing tests via serial communication, monitoring progress in real-time, and generating detailed reports.
- β Test Template System - Create and manage JSON-based test templates with multiple steps
- β Step-Based Execution - Execute tests step-by-step with configurable timeouts and retries
- β Serial Command Scripting - Send commands and validate responses via serial ports
- β Live Logging - Real-time log viewer with color-coded message levels
- β Pass/Fail Evaluation - Automatic evaluation of test results based on expected outputs
- β Timing Control - Configurable timeouts and retry mechanisms for each step
- β SQLite Persistence - Store all test runs, results, and logs in a local database
- π Dashboard - Overview of test statistics and performance metrics
- π Template Manager - Visual editor for creating and modifying test templates
βΆοΈ Test Runner - Execute tests with real-time progress indicators and live logs- π Results Viewer - Browse and analyze historical test results with filtering
- βοΈ Settings Dialog - Configure default parameters for tests and serial communication
- π CSV Export - Export individual test results or summaries to CSV format
- π HTML Reports - Generate comprehensive HTML reports with styling and graphs
- π Progress Tracking - Visual progress bars and step-by-step status updates
- π‘οΈ Comprehensive Error Handling - Robust error detection and reporting
- π Retry Mechanisms - Automatic retry of failed steps with configurable attempts
β οΈ Error Notifications - User-friendly error messages and warnings- π Detailed Logging - Complete audit trail of all test activities
- Python 3.6 or higher
- pip (Python package manager)
# Clone the repository
git clone https://github.com/BaseMax/qt-embedded-test-suite.git
cd qt-embedded-test-suite
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .pip install PyQt5>=5.15.0 pyserial>=3.5 python-dateutil>=2.8.0# From the project root directory
python src/main.py
# Or if installed via pip
embedded-test-suite- Open the Templates Tab
- Click "New" to create a new template
- Enter Template Details:
- Name:
My First Test - Description:
Basic device communication test
- Name:
- Define Test Steps in JSON format:
{
"steps": [
{
"name": "Initialize Device",
"command": "init",
"expected_output": "OK",
"timeout": 10,
"retry_count": 2,
"optional": false
},
{
"name": "Get Version",
"command": "version",
"expected_output": "v1.0",
"timeout": 5,
"retry_count": 1,
"optional": false
}
]
}- Click "Save Template"
- Go to the "Run Test" Tab
- Select a Template from the dropdown
- Select a Serial Port (or click "Refresh" to update the list)
- Set Baud Rate (default: 115200)
- Click "Start Test"
- Monitor Progress in real-time through the live log and progress bar
- Review Results after completion
- Go to the "Results" Tab
- Filter by Status (All, Passed, Failed, Error)
- Select a Test Run to view detailed information
- Export Reports using CSV or HTML buttons
qt-embedded-test-suite/
βββ src/
β βββ __init__.py
β βββ main.py # Application entry point
β βββ database/
β β βββ __init__.py
β β βββ db_manager.py # SQLite database manager
β βββ models/
β β βββ __init__.py # Data models
β βββ controllers/
β β βββ __init__.py
β β βββ serial_handler.py # Serial communication
β β βββ test_executor.py # Test execution engine
β βββ ui/
β β βββ __init__.py
β β βββ main_window.py # Main application window
β β βββ dashboard_widget.py # Dashboard view
β β βββ template_manager_widget.py
β β βββ test_runner_widget.py
β β βββ results_viewer_widget.py
β β βββ settings_dialog.py
β βββ reports/
β β βββ __init__.py
β β βββ report_generator.py # CSV/HTML report generation
β βββ utils/
β βββ __init__.py
βββ examples/
β βββ basic_device_test.json
β βββ advanced_diagnostic_test.json
β βββ simple_communication_test.json
βββ requirements.txt
βββ setup.py
βββ .gitignore
βββ LICENSE
βββ README.md
Test templates are defined in JSON format with the following structure:
{
"steps": [
{
"name": "Step name",
"command": "command to send",
"expected_output": "expected response",
"timeout": 30,
"retry_count": 2,
"optional": false
}
]
}- name (string, required): Human-readable name for the step
- command (string, required): Command to send via serial port
- expected_output (string, optional): Expected response substring
- timeout (integer, optional): Maximum wait time in seconds (default: 30)
- retry_count (integer, optional): Number of retry attempts on failure (default: 0)
- optional (boolean, optional): If true, test continues even if step fails (default: false)
The application uses SQLite to persist all data:
- test_templates: Template definitions
- test_steps: Individual steps within templates (deprecated, moved to JSON)
- test_runs: Test execution instances
- test_step_results: Results of individual step executions
- test_logs: Detailed execution logs
- Multiple baud rates (9600 to 921600)
- Auto-detection of available serial ports
- Configurable timeouts
- Pattern matching for expected outputs
- Real-time data streaming
- Connect to serial port at specified baud rate
- Send command with optional newline
- Wait for expected output or timeout
- Retry on failure if configured
- Log all communication for debugging
- Individual test run details
- Summary of multiple test runs
- Includes all metadata and step results
- Styled, professional reports
- Color-coded status indicators
- Embedded step results and logs
- Progress visualization
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Write or update tests if applicable
- Submit a pull request
- Follow PEP 8 guidelines
- Use type hints where appropriate
- Document functions and classes with docstrings
- Keep functions focused and modular
- No ports found: Ensure device is connected and drivers are installed
- Connection failed: Check port permissions (Linux/Mac) or COM port number (Windows)
- Timeout errors: Increase timeout value or check device responsiveness
- Database errors: Delete
test_results.dbto reset the database - Import errors: Reinstall dependencies with
pip install -r requirements.txt - UI rendering issues: Update PyQt5 to the latest version
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
BaseMax
- Built with PyQt5 for the Qt framework
- Uses pyserial for serial communication
- SQLite for data persistence
- Initial release
- Complete PyQt5 GUI implementation
- Test template system
- Serial communication support
- SQLite persistence
- CSV/HTML reporting
- Dashboard and analytics