How iamcharankumar/web_test_framework works
Main Components
• Test Runner / Executor: Represent Maven, TestNG, and parallel test execution configuration that kicks off the test suites.
• Test Cases and Test Data: Under the “src/test” package, this includes the test case classes (e.g., LoginPageTest, CartPageTest) and data providers.
• Core Test Framework:
• Page Objects: Found in the “src/main/java/io/saucelabs/portal/qa/pages” package (e.g., HomePage, LoginPage, SauceLabsBasePage) and common base classes (WebBasePage, WebConstants).
• Browser Manager: Modules in the “src/main/java/io/saucelabs/portal/qa/browsermanager” package (like BrowserFactory, ChromeBrowser, FirefoxBrowser, MsEdgeBrowser) that abstract browser instantiation and manage WebDriver sessions.
• Utilities & Helpers: Classes in “src/main/java/io/saucelabs/portal/qa/utils”, “waits”, “locators”, and “exceptions” packages to support logging, configuration, synchronization, and error management.
• Modules & Locators: Modules like SauceLabsPortal and locator interfaces/implementations help bind page elements to actions.
• Config & Resources: The configuration files (config.properties) and the Docker Compose YAML file found in “src/main/java/resources” for setting up the Selenium Grid.
• External Integrations:
• Report Portal: As described in the README, with steps to integrate test reports via Report Portal.
• Discord Messaging Service: For sending notifications with report metrics.
• Docker / Selenium Grid Setup: For executing tests remotely (with separate containers for Chrome and Firefox nodes).
Interactions and Relationships
• Test Cases use the Page Objects and Core Utilities to execute tests.
• The Browser Manager locates and instantiates the appropriate browser driver based on configuration (local, headless, or remote mode).
• Maven (pom.xml) acts as the build tool that integrates all pieces together, driving test execution.
Architectural Patterns and Design Principles
• The framework follows the Page Object Model (POM) for maintainability and clarity in how page elements are identified and used.
• Dependency injection or factory patterns (as evidenced by the BrowserFactory) are used to instantiate browser drivers.
• The layered approach separates tests, page representations, browser management, utilities, and exception handling.
• Parallel execution/configuration is a key design to improve test throughput (as indicated by the TestNG parallel commands in the README).
Relevant Technologies and Frameworks
• Java, Maven, TestNG, Selenium WebDriver.
• Docker and Docker Compose for remote execution with a Selenium Grid.
• Report Portal for result aggregation and analysis.
• Discord webhooks for notifications.