How gandhivivek96/selenium-automation-poc works
Main Components
• Test Runner & Build System: Represented by Maven (pom.xml) which drives the build process, dependency management, and test execution.
• Configuration Management: The configuration files in the “config” directory (DEV.properties, QA.properties, UAT.properties, config.json) that feed into the test execution environment.
• Test Scripts & Page Objects: The “src/test/java/io/github/gandhivivek96/” directory contains well-organized subcomponents:
• Pages (Page Object Model implementations such as LoginPage, HomePage, ProductDetailPage, etc.)
• POJOs for structured data (AddressPOJO, Config, Environment, etc.)
• Tests (various test cases which extend a common TestBase)
• Data Providers & Test Data: Data providers (reading CSV, JSON, Excel files) and the “testData” directory housing loginData in several formats.
• Utility & Helper Components: Utility classes for browser handling, Excel/CSV/JSON reading, logging, and report generation (e.g., BrowserUtility, ExtentReporterUtility).
• Reporting and Logging: Integration with Log4j2 (via log4j2.xml) and ExtentReports for comprehensive test reporting.
• Parallel Execution & Thread Safety: Use of ThreadLocal to hold WebDriver and ExtentReport instances, ensuring safe concurrent execution.
• CI/CD Integration: GitHub Actions (as shown by .github/workflows/maven.yml) automates the test runs on push, pull request, and on schedule.
• Cloud Testing Integration: Optional LambdaTest integration is controlled by parameters (e.g., -DisLambdaTest) to run tests on a cloud grid when needed.
Component Relationships & Interactions
• The Maven build system triggers test executions and integrates with the testing framework.
• Test Runner (TestNG) interacts with:
• The Configuration component to pick environment-specific settings.
• The Data Providers to feed test data into test cases.
• The Page Object components that encapsulate the UI interaction logic.
• The Utilities for cross-browser management, logging, and reporting.
• On failure or success, test cases send logs and reports to the Reporting component.
• CI/CD flows (hosted on GitHub Actions) invoke the build & test process, eventually deploying the generated reports (e.g., to GitHub Pages).
• When cloud testing is enabled, the test set-up logic interacts with LambdaTest.
• There’s a defined workflow between data, test cases, page objects, and utilities ensuring maintainability (the essence of the POM pattern).
Architectural Patterns & Design Principles
• Page Object Model (POM): Separates pages (UI elements/operations) from test logic.
• Data-Driven Testing: Uses external data sources in CSV, JSON, and Excel formats to drive tests.
• Separation of Concerns: Clear division between test scripts, utilities, and configuration.
• Thread Safety in parallel test execution using ThreadLocal storage.
• Continuous Integration: Automated test execution through GitHub Actions, ensuring rapid feedback.
Relevant Technologies & Frameworks
• Java (JDK 11+), Selenium WebDriver, TestNG, Maven.
• Data access libraries: OpenCSV, Gson, Apache POI.
• Logging: Log4j2 and Reporting: ExtentReports.
• External integrations: LambdaTest (cloud testing) and GitHub Actions (CI/CD).
Final Advice
• Be as detailed as possible – include every critical architectural element without oversimplifying.
Happy diagramming!