How durbanoo/seleautomation-8 works
1. This repository is a Java test-automation project, not an application under test. Its core runtime is Maven + TestNG + Selenium WebDriver, with Allure used for reporting and a small amount of optional database validation through JDBC/MySQL.
2. The system boundary is straightforward: the code in this repo drives a real external site, DemoWebShop at https://demowebshop.tricentis.com, through ChromeDriver. The primary data flow is: TestNG test -> page object actions -> browser/UI interaction -> assertions. Failures feed into Allure attachments and screenshots.
3. The codebase is concentrated entirely under src/test/java; src/main is effectively empty. That means the repository is organized as a test framework, with no reusable production service layer. The main subsystems are tests, page objects, utilities, and listeners.
4. The Page Object Model layer is the central abstraction boundary. BasePage contains shared Selenium helpers, and HomePage, LoginPage, and RegisterPage wrap the UI elements and actions for those screens. Tests should be diagrammed as depending on page objects, not directly on locators or WebDriver operations.
5. BaseTest is the test bootstrap layer. It creates and tears down the browser, sets the base URL, applies timeouts, and instantiates page objects plus the DB validator. This is the primary setup/teardown boundary between TestNG lifecycle management and browser automation.
6. Test classes are grouped by user journey or feature: Home, Register, Login, plus placeholders for Product, Cart, Checkout, and Security. The implemented flows are mostly UI validation and form interaction; several classes are scaffolded but not yet implemented, which matters if you’re diagramming maturity or coverage.
7. Test data comes from two sources: static CSV input and synthetic data. users.csv feeds the login data provider for parameterized login tests, while JavaFaker generates unique registration data. The architecture therefore mixes deterministic test datasets with generated data to avoid collisions in registration flows.
8. The listener/retry subsystem is a cross-cutting concern. TestListener is wired through testng.xml, automatically adds the Retry analyzer, and enriches failures with screenshots, attempt counts, and page source on final failure. This is the main observability/debugging path in the framework.
9. Reporting is centered on Allure. Utility methods attach screenshots, text, and HTML source, and the tests are annotated with severity/epic/feature/story metadata. In the architecture diagram, Allure should be shown as an output sink consuming test events and attachments rather than as part of the execution path.
10. Test execution is controlled by TestNG and Maven Surefire. testng.xml enables class-level parallelism with multiple threads, and the Surefire plugin injects AspectJ weaving for Allure/TestNG integration. This means the framework is designed for concurrent browser test execution, with thread-safety concerns centered around per-test driver instances.
11. There is an optional database-validation boundary via DBValidation, which opens a MySQL connection and queries customer data by email. This is separate from the UI path and should be shown as an auxiliary verification channel, not as part of the main test flow.
12. Supporting repo artifacts suggest execution/integration infrastructure: a GitHub Actions workflow for Selenium and a Docker Compose file for environment orchestration. Even without their internal details, they indicate the project is meant to run in CI and may rely on containerized or scripted test infrastructure around the browser tests.
Main entry points: BaseTest.java Base Test · BasePage.java Base Page · allure.properties Allure Report · HomeTest.java Home Tests
Components 22
Test Framework
Core test automation code under src/test/java.
- Listener + Retry · Captures failures, retries tests, and enriches final failures with diagnostics.
src/test/java/com/store/listeners/TestListener.java - Base Test · Creates browser sessions, sets base URL/timeouts, and manages teardown.
src/test/java/com/store/utils/BaseTest.java - Base Page · Shared Selenium helpers used by all page objects.
src/test/java/com/store/pages/BasePage.java - Home Page · Encapsulates home-screen actions and assertions.
src/test/java/com/store/pages/HomePage.java - Login Page · Encapsulates login form interactions and validation.
src/test/java/com/store/pages/LoginPage.java - Register Page · Encapsulates registration form interactions and validation.
src/test/java/com/store/pages/RegisterPage.java - Home Tests · Checks home-page behavior and navigation.
src/test/java/com/store/tests/HomeTest.java - Register Tests · Covers registration flows using generated user data.
src/test/java/com/store/tests/RegisterTest.java - Login Tests · Covers login flows and parameterized credential cases.
src/test/java/com/store/tests/LoginTest.java - Planned Flows · Placeholder coverage for product, cart, checkout, and security journeys.
- CSV Users · Login dataset loaded from users.csv.
src/test/resources/users.csv - Data Providers · Supplies parameterized inputs and synthetic registration data.
src/test/java/com/store/utils/DataProviders.java - CSV Helper · Reads structured test data from CSV.
src/test/java/com/store/utils/CsvData.java - Faker Data · Creates unique test identities to avoid registration collisions.
src/test/java/com/store/utils/DataProviders.java - Allure Utils · Attaches screenshots, text, and HTML source to Allure reports.
src/test/java/com/store/utils/AllureUtils.java - DB Validation · Queries MySQL for customer records by email as an optional check.
src/test/java/com/store/utils/DBValidation.java
External Systems
Browser, target site, and optional backend validation endpoints.
- Allure Report · Consumes annotations and attachments for test reporting.
src/test/resources/allure.properties - DemoWebShop · External UI under test at demowebshop.tricentis.com in ChromeDriver.
- ChromeDriver · Per-test browser instance used for UI automation.
Execution Infra
Build, suite, and environment orchestration around the tests.
- Maven Surefire · Runs the TestNG suite and enables AspectJ weaving for reporting integration.
pom.xml - TestNG Suite · Defines parallel class execution and wires listeners through the suite XML.
testng.xml - CI / Compose · GitHub Actions and Docker Compose provide automated execution and environment orchestration.
.github/workflows/selenium.yml
Connections 26
- Maven Surefire → TestNG Suite: launches · Surefire starts the TestNG suite.
- TestNG Suite → Listener + Retry: registers · Suite configuration wires the listener and retry logic.
- TestNG Suite → Base Test: executes · TestNG runs classes built on the shared test bootstrap.
- Base Test → ChromeDriver: creates · Bootstrap manages per-test browser sessions.
- ChromeDriver → DemoWebShop: drives · Browser actions hit the external DemoWebShop site.
- Base Test → Base Page: initializes · Base test prepares the page-object foundation.
- Base Page → Home Page: supports · Shared helpers back the concrete page objects.
- Base Page → Login Page: supports · Shared helpers back the concrete page objects.
- Base Page → Register Page: supports · Shared helpers back the concrete page objects.
- Home Tests → Home Page: uses · Home tests interact through the page object boundary.
- Register Tests → Register Page: uses · Registration tests interact through the page object boundary.
- Login Tests → Login Page: uses · Login tests interact through the page object boundary.
- Home Tests → Data Providers: consumes · Tests can source structured inputs from providers.
- Login Tests → CSV Users: consumes · Login flows use CSV-backed credentials.
- CSV Users → CSV Helper: loaded by · CSV helper parses the test dataset.
- Register Tests → Faker Data: generates · Registration flows rely on synthetic unique data.
- Listener + Retry → Allure Utils: attaches · Failures are enriched with screenshots and page source.
- Allure Utils → Allure Report: publishes · Attachments and metadata flow into Allure.
- Home Tests → Allure Report: annotated for · Tests carry epic/feature/story/severity metadata.
- Register Tests → Allure Report: annotated for · Tests carry epic/feature/story/severity metadata.
- Login Tests → Allure Report: annotated for · Tests carry epic/feature/story/severity metadata.
- Base Test → DB Validation: optionally uses · Some flows can validate user data through MySQL.
- DB Validation → DemoWebShop: verifies against · Database checks complement the UI path, not replace it.
- CI / Compose → Maven Surefire: runs · Workflow and containerized setup invoke the Maven test run.
- CI / Compose → ChromeDriver: provisions · CI environment supports browser automation execution.
- Planned Flows → Base Test: would use · Planned feature suites follow the same bootstrap pattern.