How lruizajax/seleautomation-07-3 works
1. Repository purpose
- This is a UI test automation repository, not an application backend.
- All executable code lives under src/test/java; src/main is effectively empty.
- The system under test is the external ecommerce site DemoWebShop Tricentis at demowebshop.tricentis.com.
2. Core architecture pattern
- The repo is organized around TestNG + Selenium WebDriver + Page Object Model.
- Tests do not interact with the browser directly; they call page classes, which wrap locators and actions.
- The design boundary is: tests orchestrate flows, pages encapsulate UI behavior, and utilities handle shared concerns.
3. Test execution entry points
- Maven is the build and execution driver via pom.xml.
- testng.xml defines the suite, class-level parallelism, and listener registration.
- A GitHub Actions workflow exists at .github/workflows/selenium.yml, so CI is part of the architecture even though the exact job steps are not shown.
4. Test layer
- Test classes live in src/test/java/com/store/tests.
- Main implemented coverage is:
- HomeTest
- LoginTest
- RegisterTest
- Additional suites exist but are largely placeholders or under development:
- ProductTest
- CartTest
- CheckoutTest
- SecurityTest
- Each test extends BaseTest, which centralizes browser setup and shared page instances.
5. Page Object boundary
- Page objects live in src/test/java/com/store/pages.
- BasePage provides common browser actions such as find, click, type, submit, text retrieval, and visibility checks.
- Concrete pages currently modeled:
- HomePage
- LoginPage
- RegisterPage
- This layer contains the locators and UI interactions, keeping test classes thin and readable.
6. Data flow into tests
- Test input comes from two main sources:
- src/test/resources/users.csv for login credential data
- JavaFaker-based random data for registration
- CsvData reads CSV files into Object[][].
- DataProviders exposes TestNG data providers, especially dpFromCsv, to feed parameterized login tests.
- This means the login flow is data-driven, while registration is mix of synthetic and negative test data.
7. Validation strategies
- Most assertions are UI-level: visible elements, page text, success/error messages.
- DBValidation adds an optional second boundary to a MySQL database for backend verification.
- The README indicates this DB check is optional and depends on local MySQL configuration, so it is not the primary test path but an auxiliary validation path.
8. Cross-cutting test concerns
- TestListener wires TestNG lifecycle events to reporting and failure diagnostics.
- Retry implements retry logic for flaky tests, with a maximum of two retries.
- AllureUtils attaches screenshots, page source, and text to Allure reports.
- These concerns are centralized so the test cases themselves remain focused on business flows.
9. Reporting and observability
- Allure is the main reporting layer.
- Failures can attach:
- screenshots on each failure
- page source on final failure
- attempt metadata from the retry analyzer
- src/test/resources/allure.properties configures the report output behavior.
10. Runtime and infrastructure dependencies
- Selenium runs against Chrome/ChromeDriver on the local machine or CI environment.
- Test execution depends on Maven Surefire with an AspectJ weaver javaagent, which supports Allure/TestNG runtime integration.
- The project also references logging and other test tooling in the POM, but the important architectural runtime is: JUnit-like TestNG runner + browser driver + report instrumentation.
11. Parallelism and suite orchestration
- testng.xml configures suite execution in parallel by class with a thread count of 5.
- This means the architecture expects tests to be reasonably isolated and the BaseTest setup/teardown to safely manage browser state per method.
- Cookie cleanup and browser shutdown in tearDown() are key isolation boundaries.
12. External system interactions
- Primary external dependency: the public ecommerce website under test.
- Secondary optional dependency: a local MySQL instance for database validation.
- No internal service mesh or application server exists in this repo; it is purely a client-side automation harness around external systems.
13. Current maturity
- Home, login, and registration are the implemented, working flows.
- Product, cart, checkout, and security tests are scaffolded but not yet fully implemented.
- From an architecture-diagram perspective, this repo is best shown as a test automation client with a mature page-object/test-runner/reporting stack and a few optional validation and data-loading side paths.
Main entry points: testng.xml TestNG Suite · BaseTest.java Base Test · LoginTest.java Login Test · RegisterTest.java Register Test
Components 20
Build & CI
Execution entry points and automation plumbing
- Maven POM · Build and test execution definition
pom.xml - TestNG Suite · Suite orchestration, parallelism, and listeners
testng.xml - CI Workflow · GitHub Actions automation for running Selenium tests
.github/workflows/selenium.yml
Test Flows
Test classes that orchestrate browser journeys
- Home Test · Implemented home-flow coverage
src/test/java/com/store/tests/HomeTest.java - Login Test · Credential-based login coverage
src/test/java/com/store/tests/LoginTest.java - Register Test · User registration coverage
src/test/java/com/store/tests/RegisterTest.java - Planned Tests · Placeholder coverage for product, cart, checkout, and security flows
Page Objects
UI abstractions over the DemoWebShop interface
- Base Page · Shared browser actions and assertions for UI pages
src/test/java/com/store/pages/BasePage.java - Home Page · Home screen interactions and locators
src/test/java/com/store/pages/HomePage.java - Login Page · Login form behavior and validations
src/test/java/com/store/pages/LoginPage.java - Register Page · Registration form behavior and validations
src/test/java/com/store/pages/RegisterPage.java
Test Utilities
Shared setup, data, retry, reporting, and validation helpers
- Base Test · Central browser setup, teardown, and shared page instances
src/test/java/com/store/utils/BaseTest.java - Test Listener · Lifecycle hooks for reporting and failure diagnostics
src/test/java/com/store/listeners/TestListener.java - Retry · Flaky-test retry analyzer with limited retries
src/test/java/com/store/utils/Retry.java - Allure Utils · Attaches screenshots, page source, and text artifacts
src/test/java/com/store/utils/AllureUtils.java - CSV Data · Reads CSV fixtures into TestNG-friendly matrices
src/test/java/com/store/utils/CsvData.java - Data Providers · TestNG data-provider bridge for parameterized flows
src/test/java/com/store/utils/DataProviders.java - DB Validation · Optional MySQL-backed backend validation path
src/test/java/com/store/utils/DBValidation.java
External Systems
Systems outside this repository that tests exercise or optionally verify
- DemoWebShop · External ecommerce site under test
- MySQL · Local database used only for optional validation
Connections 26
- Maven POM → TestNG Suite: runs · Maven executes the TestNG suite
- Maven POM → CI Workflow: drives · CI uses the Maven test lifecycle
- TestNG Suite → Test Listener: registers · Suite wires reporting and diagnostics hooks
- TestNG Suite → Retry: uses · Suite relies on retry behavior for flaky tests
- CI Workflow → Maven POM: invokes · Workflow runs the build and test command
- Base Test → Home Page: shares · Base setup exposes common page instances
- Base Test → Login Page: shares · Base setup exposes common page instances
- Base Test → Register Page: shares · Base setup exposes common page instances
- Home Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Login Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Register Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Home Test → Home Page: uses · Home test delegates UI behavior to the page object
- Login Test → Login Page: uses · Login test delegates UI behavior to the page object
- Register Test → Register Page: uses · Register test delegates UI behavior to the page object
- Login Test → Data Providers: feeds · Login flow consumes parameterized test data
- Data Providers → CSV Data: loads · Data providers source CSV-backed user data
- Register Test → Allure Utils: reports · Registration flow emits rich failure artifacts
- Test Listener → Allure Utils: attaches · Listener coordinates reporting attachments
- Base Page → DemoWebShop: drives · Page actions operate the browser against the ecommerce site
- DB Validation → MySQL: verifies · Optional backend validation against a local database
- Planned Tests → DemoWebShop: targets · Planned flows are meant to cover remaining site areas
- Base Test → DemoWebShop: opens · Test setup launches the browser against the site
- TestNG Suite → Home Test: includes · Suite executes the implemented home coverage
- TestNG Suite → Login Test: includes · Suite executes the implemented login coverage
- TestNG Suite → Register Test: includes · Suite executes the implemented registration coverage
- TestNG Suite → Planned Tests: includes · Suite also contains scaffolded future coverage