How partheebanmani/selenium_cucumber_pom works
Main components
• Test Orchestration
• TestNG Runner (RunnerTest.java)
• Cucumber Engine (hooks into TestNG via Maven)
• Feature/Step Layer
• Gherkin Feature Files (src/test/resources/*.feature)
• Step Definitions (src/test/java/.../stepdefinitions)
• Test Context & Data
• TestContext (holds per-scenario state)
• PropertiesConfig & TestEnv (env config)
• UI Automation Layer
• Page Objects (BasePage, Login, Inventory, ProductInformation)
• Driver Management
– DriverFactory, DriverManager, BaseDriver
– BrowserProviders (Chrome, Firefox, Safari)
– Enums (Browsers) and Exceptions (BrowserNotSupported)
• SeleniumUtility (common browser ops)
• API Automation Layer
• RestAssuredUtility (HTTP calls)
• APIUrl & JsonFields (constants)
• Models/BaseModel & specific models (User, Employee, Cat)
• Utilities & Infrastructure
• KafkaUtility (if testing messaging flows)
• Util (generic helpers)
• PropertiesConverter (TestEnvConverter)
• External Systems
• Application Under Test (SauceDemo UI)
• REST endpoints under test
• Dockerized Selenium Grid (Hub + Node containers)
Relationships & data flow
• The TestNG runner invokes Cucumber, which in turn reads Feature files.
• For each Gherkin step, the Cucumber Engine calls a Step Definition.
• Step Definitions use TestContext to share data and then invoke either:
• UI path: Page Objects → SeleniumUtility → DriverManager → Selenium Grid → Browser → SauceDemo
• API path: RestAssuredUtility → HTTP Request → Target API → JSON response → Models
• DriverFactory selects the right BrowserProvider based on -Dbrowser or -Dbrowser.env.
• Configuration is loaded at startup (PropertiesConfig, TestEnvConverter).
• Parallel execution is orchestrated by TestNG + Docker Grid.
Architectural patterns & principles
• Page Object Model: separates page-specific logic from tests
• Factory Pattern: DriverFactory abstracts browser instantiation
• Singleton-ish Context: TestContext maintains state across steps
• BDD Layer: clear separation of “what” (Feature files) vs. “how” (StepDefs)
• Layered Structure:
• Presentation/Test Layer
• Domain/Model Layer
• Infrastructure Layer
Technologies & frameworks to annotate
• Java + Maven
• TestNG
• Cucumber BDD
• Selenium WebDriver + Docker Selenium Grid
• Rest Assured
• AssertJ for assertions
• KafkaUtility (if applicable)