How qaamitkumar/opencart works
Project Type and Purpose
• This is a Java-based automated testing framework built with Maven, TestNG, and Selenium.
• It implements data-driven and cross-browser testing against a web application using the Page Object Model (POM).
• It includes Docker-based Selenium Grid orchestration, ExtentReports/HTML reporting, and utilities for data handling and logging.
Key Components
a. Test Runner & CI Integration
• Maven + TestNG (configured via multiple XML suite files: master.xml, grouping.xml, grid-docker.xml, crossbrowsertesting.xml)
• Optional integration point: Jenkins or local run.bat to kick off mvn test
b. Test Code
• src/test/java/testCases: Test classes (TC001_AccountRegistrationTest, TC002_LoginTest, TC003_LoginDDT)
• src/test/java/pageObjects: POM classes (HomePage, LoginPage, AccountRegistrationPage, MyAccountPage, BasePage)
• src/test/java/testBase/BaseClass.java: Sets up WebDriver instances, reads config, initializes reporting, logging, screenshots
c. Utilities
• DataProviders.java and ExcelUtility.java: Read test data from testData/Opencart_LoginData.xlsx
• ExtentReportManager.java: Configures ExtentReports HTML output
• log4j2.xml: Logging configuration
d. Configuration & Data
• src/test/resources/config.properties: URLs, credentials, browser settings
• docker-compose.yaml: Defines Selenium Grid Hub and node containers for Chrome/Firefox/Edge
e. External Services & Artifacts
• Selenium Grid Hub + browser nodes (Docker)
• CrossBrowserTesting (via crossbrowsertesting.xml suite)
• test-output/ & reports/: TestNG and ExtentReports artifacts and screenshots
Relationships & Data Flow
1) CI/Local Runner → Maven → TestNG Engine
2) TestNG reads suite XML, loads config.properties, initializes BaseClass
3) BaseClass spins up WebDriver (local or remote via Selenium Grid/CrossBrowserTesting)
4) TestNG executes testCases → each test calls PageObjects → PageObjects issue WebDriver commands → browser nodes
5) Browser nodes run tests, return responses to WebDriver client
6) Utilities capture logs, screenshots on failure, feed ExtentReportManager
7) On completion, TestNG and ExtentReports generate HTML/XML in test-output/ and reports/
Architectural Patterns & Principles
• Page Object Model: Encapsulate page interactions in pageObjects classes
• Data-Driven Testing: Externalize test data in Excel via DataProviders
• Factory/Singleton for WebDriver in BaseClass
• Modular suite definitions for grouping tests, grid execution, cross-browser execution