Architecture Overview
TAFLEX is built on a robust, extensible architecture that follows enterprise-grade design patterns. This document explains the architectural decisions and how different components interact.
Design Philosophyโ
TAFLEX follows these core principles:
| Principle | Description |
|---|---|
| ๐งฉ Strategy Pattern | Runtime driver resolution allows the same test code to run on Web, API, or Mobile without modification. |
| ๐ Separation of Concerns | Test logic is completely decoupled from driver implementation and locator definitions. |
| โ๏ธ Configuration Over Code | Behavior is controlled through external configuration, not hardcoded values. |
| ๐งช Modern Java | Leverages Java 21 features for clean and efficient automation code. |
High-Level Architectureโ
Component Breakdownโ
1. Driver Layerโ
The Driver Layer implements the Strategy Pattern, allowing runtime selection of the appropriate driver implementation based on the execution.mode property.
2. Locator Systemโ
All locators are externalized in .properties files and resolved by the LocatorFactory.
Locator Loading Order:
global.properties- Common across all modes.{mode}/common.properties- Mode-specific common locators.{mode}/{page}.properties- Page/feature-specific locators.
3. Configuration Managementโ
The ConfigManager provides centralized access to properties defined in automation.properties, with support for environment variable overrides.
4. Test Execution Flowโ
- Suite Start: TestNG starts the execution.
- Setup:
BaseTestcallsDriverFactoryto get the correct driver instance. - Initialization: The driver initializes the underlying tool (Playwright, HttpClient, or Appium).
- Execution: Tests interact with the
AutomationDriverusing logical locator names. - Teardown:
BaseTestterminates the driver and reports results.
Technology Stackโ
| Category | Technologies |
|---|---|
| Core Language | Java 21+ |
| Build Tool | Gradle 8.5 |
| Test Runner | TestNG |
| Web Testing | Playwright for Java |
| API Testing | Apache HttpClient |
| Mobile Testing | Appium (Java Client) |
| Database | HikariCP, JDBC |
| Reporting | ReportPortal, Xray Cloud |
| Logging | SLF4J with Logback |