Framework Architecture Overview
Comprehensive 8-layer modular architecture design
Description
This document provides a comprehensive visual representation of the automation framework's architecture. The framework follows an 8-layer modular design that promotes scalability, maintainability, and extensibility.
- Modularity: Each layer can be updated independently
- Testability: Layers can be tested in isolation
- Scalability: Easy to add new capabilities
- Maintainability: Clear separation of responsibilities
- Extensibility: Simple to integrate new tools and services
8-Layer Architecture Diagram
graph TB
subgraph "Layer 1: Test Execution Layer"
TS[Test Suites<br/>TS_*_JUnit.java]
TC[Test Cases<br/>@Test methods]
TST[Test Steps<br/>autoPass/autoFail]
end
subgraph "Layer 2: Page Object Layer"
PO[Page Objects<br/>PO_*.java]
LOC[Locators<br/>Element definitions]
ACT[Actions<br/>Page methods]
end
subgraph "Layer 3: Framework Core Layer"
ASSERT[Custom Assertions<br/>FW_CustomAssertJU]
CONFIG[Configuration<br/>FW_ConfigMgr]
UTILS[Utilities<br/>FW_*Utils]
end
subgraph "Layer 4: Infrastructure Layer"
DRV[WebDriver Manager<br/>FW_Browser]
NET[Network Utils<br/>FW_NetworkUtils]
SYS[System Utils<br/>FW_SystemUtils]
end
subgraph "Layer 5: Reporting Layer"
ALLURE[Allure Reporter<br/>FW_AllureReportGenerator]
HTTP_RPT[HTTP Reporter<br/>FW_HttpDiagnosticReporter]
JUNIT[JUnit Formatter<br/>FW_TestSuiteFormatter]
end
subgraph "Layer 6: Audit & Diagnostics Layer"
HTTP_AUD[HTTP Audits<br/>FW_Audit_HttpReview]
NET_AUD[Network Audits<br/>FW_Audit_Ping/Traceroute]
PERF[Performance<br/>FW_Audit_SpeedTest]
end
subgraph "Layer 7: mAi Advisor™ Layer"
ADV_ENG[Advisor Engine<br/>FW_AdvisorEngine]
ADV_TMP[Template Loader<br/>FW_AdvisorTemplateLoader]
ADV_AUD[Audience Manager<br/>FW_AdvisorAudience]
end
subgraph "Layer 8: Data Integration Layer"
DATA_COL[Data Collector<br/>FW_TestStepDataCollector]
DATA_PROC[Data Processor<br/>FW_TestStepDataProcessor]
BQ[BigQuery Uploader<br/>FW_GoogleCloudBigQueryUploader]
end
TS --> TC
TC --> TST
TST --> ASSERT
TST --> PO
PO --> LOC
PO --> ACT
ACT --> DRV
ASSERT --> CONFIG
ASSERT --> UTILS
DRV --> NET
DRV --> SYS
TST --> DATA_COL
DATA_COL --> DATA_PROC
DATA_PROC --> BQ
TST --> ALLURE
TST --> JUNIT
HTTP_AUD --> HTTP_RPT
HTTP_AUD --> ADV_ENG
NET_AUD --> ADV_ENG
ADV_ENG --> ADV_TMP
ADV_ENG --> ADV_AUD
ADV_ENG --> HTTP_RPT
Layer Descriptions
Layer 1: Test Execution Layer
Purpose: Defines and executes automated test cases using JUnit 5
Key Components: Test Suites (TS_*_JUnit.java), Test Cases (@Test methods), Test Steps (autoPass/autoFail)
Responsibilities: Test suite organization, lifecycle management, execution flow control, JUnit 5 integration
Classes: TS_Authentication_JUnit, TS_Ordering_JUnit, TS_HttpAssessment_JUnit, TS_Network_JUnit
Layer 2: Page Object Layer
Purpose: Encapsulates page elements and interactions using Page Object Model pattern
Key Components: Page Objects (PO_*.java), Locators (XPath, CSS, ID), Actions (page methods)
Responsibilities: UI element encapsulation, page-level actions, wait strategies, reusable patterns
Classes: PO_Login, PO_Products, PO_Cart, PO_Checkout, PO_Common_Hamburger
Layer 3: Framework Core Layer
Purpose: Provides core utilities, assertions, and configuration management
Key Components: Custom Assertions (FW_CustomAssertJU), Configuration Manager (FW_ConfigMgr), Utilities
Responsibilities: Custom assertion logic, configuration management, utility functions, cross-cutting concerns
Classes: FW_CustomAssertJU, FW_ConfigMgr, FW_DateTimeUtils, FW_StringUtils, FW_FileDirUtils, FW_CSVUtils
Layer 4: Infrastructure Layer
Purpose: Manages WebDriver lifecycle and system-level operations
Key Components: WebDriver Manager (FW_Browser), Network Utilities, System Utilities
Responsibilities: WebDriver creation/configuration, browser lifecycle, network connectivity, environment detection
Classes: FW_Browser, FW_NetworkUtils, FW_SystemUtils, FW_PerformanceUtils
Layer 5: Reporting Layer
Purpose: Generates comprehensive test reports and execution summaries
Key Components: Allure Reporter, HTTP Reporter (FW_HttpDiagnosticReporter), JUnit Formatter
Responsibilities: Report generation, screenshot attachment, console formatting, trend analysis
Classes: FW_AllureReportGenerator, FW_HttpDiagnosticReporter, FW_HttpReporter, FW_TestSuiteFormatter, FW_ReportUtils
Layer 6: Audit & Diagnostics Layer
Purpose: Performs security audits and network diagnostics
Key Components: HTTP Audits, Network Audits (Ping, Traceroute), Performance (SpeedTest)
Responsibilities: HTTP security header auditing, SSL/TLS validation, network connectivity testing, performance measurement
Classes: FW_AuditManager, FW_Audit_HttpReview, FW_Audit_Ping, FW_Audit_Traceroute, FW_Audit_SpeedTest
Layer 7: mAi Advisor™ Layer
Purpose: Provides intelligent, context-aware recommendations for findings
Key Components: Advisor Engine, Template Loader, Audience Manager
Responsibilities: Recommendation generation, multi-tier content delivery, multi-audience targeting, template-based system
Classes: FW_Advisor, FW_AdvisorEngine, FW_AdvisorTemplateLoader, FW_AdvisorAudience
Layer 8: Data Integration Layer
Purpose: Collects, processes, and uploads test data to cloud analytics
Key Components: Data Collector, Data Processor, BigQuery Uploader
Responsibilities: Real-time test step data collection, batch processing and CSV generation, BigQuery integration
Classes: FW_TestStepDataCollector, FW_TestStepDataProcessor, FW_GoogleCloudBigQueryUploader, FW_GoogleCloudUtils
Component Interaction Flows
Test Execution Flow
sequenceDiagram
participant Maven
participant TestSuite
participant TestCase
participant PageObject
participant WebDriver
participant Assertion
participant DataCollector
participant Reporter
Maven->>TestSuite: Execute test suite
TestSuite->>TestCase: @BeforeAll setup
TestSuite->>TestCase: Run test method
TestCase->>PageObject: Call page action
PageObject->>WebDriver: Interact with browser
WebDriver-->>PageObject: Element interaction result
PageObject-->>TestCase: Action result
TestCase->>Assertion: autoPass/autoFail
Assertion->>Assertion: Capture screenshot
Assertion->>DataCollector: Collect test step data
Assertion->>Reporter: Log to Allure
TestCase->>TestSuite: @AfterEach teardown
TestSuite->>Reporter: Generate final reports
DataCollector->>Reporter: Process collected data
HTTP Audit Pipeline Flow
sequenceDiagram
participant Test as HTTP Test
participant Manager as FW_AuditManager
participant HttpAudit as FW_Audit_HttpReview
participant Advisor as mAi Advisor™
participant Reporter as HTTP Reporter
Test->>Manager: performHttpAudit(url)
Manager->>HttpAudit: Execute HTTP audit
HttpAudit->>HttpAudit: Check security headers
HttpAudit->>HttpAudit: Validate SSL/TLS
HttpAudit->>HttpAudit: Analyze findings
HttpAudit->>Advisor: Request recommendations
Advisor->>Advisor: Load templates
Advisor->>Advisor: Generate multi-audience content
Advisor-->>HttpAudit: Return recommendations
HttpAudit->>Reporter: Create diagnostic report
Reporter->>Reporter: Generate HTML report
Reporter-->>Test: Report available in target/http-reports/
mAi Advisor™ Recommendation Flow
flowchart LR
A[Audit Finding] --> B[FW_AdvisorEngine]
B --> C{Load Template}
C --> D[Understanding Tier]
C --> E[Action Tier]
D --> F[All Audiences]
E --> G{Select Audience}
G --> H[Developer]
G --> I[DevOps]
G --> J[QA]
G --> K[Security]
G --> L[PM]
G --> M[Executive]
H --> N[Code Examples]
I --> O[Server Configs]
J --> P[Test Cases]
K --> Q[Threat Analysis]
L --> R[Business Impact]
M --> S[Strategic Overview]
N --> T[Formatted Recommendation]
O --> T
P --> T
Q --> T
R --> T
S --> T
Data Collection to BigQuery Flow
flowchart TD
A[Test Step Complete] --> B[autoPass/autoFail]
B --> C[FW_TestStepDataCollector]
C --> D{Batch Size Reached?}
D -->|No| E[Queue Test Step]
D -->|Yes| F[FW_TestStepDataProcessor]
E --> D
F --> G[Write to CSV]
G --> H[Maven Post-Integration]
H --> I[FW_GoogleCloudBigQueryUploader]
I --> J{Validate Files}
J -->|Fail| K[Log Error]
J -->|Pass| L[Authenticate with GCP]
L --> M[Stream Upload to BigQuery]
M --> N[Historical Analytics Available]
Design Principles
- Single Responsibility: Each layer has one primary responsibility
- Dependency Inversion: Layers depend on abstractions, not implementations
- Open/Closed: Open for extension, closed for modification
- Interface Segregation: Clients only depend on methods they use
- Don't Repeat Yourself (DRY): Reusable components across layers
Layer Integration Points
- Test Layer → Page Object Layer: Test cases call page object methods; Test parameters → Page actions → Results
- Page Object Layer → Infrastructure Layer: Page objects use WebDriver from FW_Browser
- Framework Core → All Layers: All layers use utilities and configuration
- Audit Layer → Advisor Layer: Audits request recommendations for findings
- Test Layer → Data Integration Layer: Test steps automatically collect data
Extensibility Points
- New Test Suites: Add new
TS_*_JUnit.javafiles - New Page Objects: Create new
PO_*.javaclasses - Custom Utilities: Add new
FW_*Utils.javaclasses - New Audit Types: Implement new
FW_Audit_*.javacomponents - Custom Reporters: Create new report generators
- Advisor Templates: Add new JSON recommendation templates
Related Documentation
| Document | Description |
|---|---|
| Framework Overview | High-level framework introduction |
| Test Development Guide | Writing tests |
| Test Execution Flow | Maven to test execution |
| Data Collection Pipeline | Data flow details |
| BigQuery Integration | Cloud upload process |
| HTTP Assessment | HTTP audit layer details |
| Network Diagnostics | Network audit layer details |
| mAi Advisor™ | Advisor layer details |