How tmahm/htektesttools works
Project Type and Purpose
• This is an automation testing framework (Robot Framework-based) for Htek VoIP phones.
• Purpose: define phone behaviors, drive call/upgrade scenarios, collect logs & reports.
File Structure
• Top‑level components:
• config/ – global + user configs
• phoneFunction/ – core library defining Phone class and actions
• bin/ – Robot test cases, keywords, runner, and output artifacts
• docs/, img/, local_test/ – specifications, sample tests, reference data
• Auxiliary files: .gitignore, CHANGE LOG, deployment path hint (venv/lib/python3.5/...).
README Insights
• config/conf.py holds global constants; usr_data.py holds per‑user settings.
• phoneFunction/ defines Phone instantiation and actions (call, forward, upgrade).
• bin/ contains:
• key_words.robot – granular Robot Framework keywords mapped to Python functions
• run.robot – high‑level test scenarios
• log/, report.html, output.xml – execution artifacts
Main Components & Interactions
a. Components:
1. Test Runner (Robot Framework CLI via bin/run.robot)
2. Keyword Layer (key_words.robot)
3. Python Library (phoneFunction package)
4. Configuration Module (config package)
5. Device Under Test (Htek phones over network)
6. Reporting & Logging (bin/log/, report.html, output.xml)
b. Relationships & Data Flow:
• Test Runner invokes Robot test suite → loads config settings (conf.py & usr_data.py)
• Robot test cases call keywords (key_words.robot) → keywords delegate to Python functions in phoneFunction/action.py
• PhoneAction functions instantiate Phone objects (phones.py) with parameters → send SIP/HTTP commands to physical or virtual Htek phones
• Phones respond over network → phoneFunction captures status → returns results to Robot Framework
• Robot Framework collects execution data → writes logs (.log), XML, HTML reports
c. Architectural Patterns & Principles:
• Layered separation: Test definitions (Robot) → Keyword abstraction → Core library → External system
• Single Responsibility: config/ exclusively for parameters, phoneFunction/ for device logic
• Extensibility: new keywords or phone models can be added under phoneFunction/syn_phonelib
d. Key Technologies & Libraries:
• Robot Framework (DSL for test cases)
• Python 3.5+ for phoneFunction and config
• syn_phonelib for device-specific configs
• XML (local_test sample input)
• Reporting via Robot’s built‑in HTML/XML output