# testingtequila/janbaskdemoautomation architecture

> Architecture diagram of the GitHub repository testingtequila/janbaskdemoautomation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/testingtequila/janbaskdemoautomation
- Repository: https://github.com/testingtequila/janbaskdemoautomation

## Overview

#### Purpose and Execution Model
This is a Java/Maven UI automation project for the Janbask demo e-commerce site. It executes Cucumber BDD scenarios through TestNG, driving a real browser with Selenium WebDriver. Maven is the build, dependency, and test-launch boundary: `pom.xml`.

#### BDD Specification Layer
Gherkin features define user-visible behavior and scenario inputs. The current functional scope is login behavior:
- `src/test/resources/features/Login.feature`

Cucumber binds these steps to Java implementation classes rather than directly to browser code.

#### Test Orchestration
The TestNG/Cucumber runner discovers feature files and step-definition glue, configures Cucumber plugins/reporting, and initiates scenario execution:
- `src/test/java/testRunner/TestRunner.java`

Scenario lifecycle setup/teardown is centralized in hooks, providing the control boundary for browser initialization and cleanup:
- `src/test/java/stepDefinitions/Hooks.java`

#### Step-Definition Layer
Step definitions translate Gherkin actions/assertions into calls on page objects. They should remain workflow-oriented and avoid Selenium locator details:
- `src/test/java/stepDefinitions/Login.java`

Control flow is: `Login.feature` → Cucumber runner → hooks → `Login` steps → page objects/utilities → Selenium browser session.

#### Page Object Model
Page objects encapsulate site pages, locators, and high-level UI actions. The present model covers authentication, account state, and store interactions:
- `src/main/java/pom/AccountLogin.java`
- `src/main/java/pom/MyAccount.java`
- `src/main/java/pom/MyStore.java`

This is the primary maintainability boundary: feature and step code should depend on page actions, while Selenium-specific interactions remain in these page abstractions and shared utilities.

#### Browser and Shared Automation Services
Browser selection/session handling is centralized rather than embedded in individual scenarios:
- `src/main/java/utilities/HandlingBrowsers.java`

Shared reusable behavior, likely including waits or common WebDriver interactions, is grouped in:
- `src/main/java/utilities/Reuse.java`

The runtime depends on Java, Maven, Selenium WebDriver, Cucumber, and TestNG. The external system under test is `janbaskdemo.com`; browser-driver availability/configuration is an environmental dependency.

#### Test Data and State
Data classes isolate named test inputs or application-level values from scenario and page logic:
- `src/main/java/datarepo/AppLevel.java`
- `src/main/java/datarepo/TCLevelData.java`

These classes form the intended data boundary for reusable application-wide versus test-case-specific values, reducing hard-coded credentials or inputs in step definitions.

#### Reporting and Outputs
Cucumber plugin configuration in the runner/build produces feature-level execution results, conventionally under Maven’s `target` output. No CI pipeline, dedicated configuration files, or externally hosted reporting integration is present in the supplied tree.

Main entry points: [`src/test/java/stepDefinitions/Login.java`](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/stepDefinitions/Login.java) (Login steps), [`src/test/java/testRunner/TestRunner.java`](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/testRunner/TestRunner.java) (Cucumber TestNG runner), [`src/main/java/utilities/Reuse.java`](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/utilities/Reuse.java) (Shared automation), [`pom.xml`](https://github.com/testingtequila/janbaskdemoautomation/blob/master/pom.xml) (Maven build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spec["BDD Specification"]
  node_feature["Login feature<br/>Gherkin feature<br/>[Login.feature]"]
  node_login_steps["Login steps<br/>step definitions<br/>[Login.java]"]
end

subgraph group_execution["Test Execution"]
  node_maven{{"Maven build<br/>build boundary<br/>[pom.xml]"}}
  node_runner["Cucumber TestNG runner<br/>test runner<br/>[TestRunner.java]"]
  node_hooks["Scenario hooks<br/>lifecycle control<br/>[Hooks.java]"]
  node_reports["Test results<br/>Maven output"]
end

subgraph group_automation["Automation Core"]
  node_account_login["Account login page<br/>page object<br/>[AccountLogin.java]"]
  node_my_account["My account page<br/>page object<br/>[MyAccount.java]"]
  node_my_store["Store page<br/>page object<br/>[MyStore.java]"]
  node_browser_service["Browser handling<br/>session service"]
  node_reuse["Shared automation<br/>WebDriver utility<br/>[Reuse.java]"]
end

subgraph group_data["Test Data"]
  node_app_data["Application data<br/>data repository<br/>[AppLevel.java]"]
  node_case_data["Test-case data<br/>data repository<br/>[TCLevelData.java]"]
end

node_browser(("Browser driver<br/>environment dependency"))
node_janbask(("Janbask demo site<br/>system under test"))

node_maven -->|"launches"| node_runner
node_maven -->|"writes output"| node_reports
node_feature -->|"discovered by"| node_runner
node_runner -->|"runs lifecycle"| node_hooks
node_runner -->|"binds steps"| node_login_steps
node_runner -->|"publishes results"| node_reports
node_hooks -->|"initializes and closes"| node_browser_service
node_login_steps -->|"uses"| node_account_login
node_login_steps -->|"uses"| node_my_account
node_login_steps -->|"uses"| node_my_store
node_login_steps -.->|"reads values"| node_app_data
node_login_steps -.->|"reads inputs"| node_case_data
node_browser_service -->|"creates session"| node_browser
node_account_login -->|"uses shared actions"| node_reuse
node_my_account -->|"uses shared actions"| node_reuse
node_my_store -->|"uses shared actions"| node_reuse
node_reuse -->|"issues WebDriver commands"| node_browser
node_browser -->|"drives UI against"| node_janbask

click node_maven "https://github.com/testingtequila/janbaskdemoautomation/blob/master/pom.xml"
click node_feature "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/resources/features/Login.feature"
click node_runner "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/testRunner/TestRunner.java"
click node_hooks "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/stepDefinitions/Hooks.java"
click node_login_steps "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/stepDefinitions/Login.java"
click node_account_login "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/AccountLogin.java"
click node_my_account "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/MyAccount.java"
click node_my_store "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/MyStore.java"
click node_browser_service "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/utilities/HandlingBrowsers.java"
click node_reuse "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/utilities/Reuse.java"
click node_app_data "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/datarepo/AppLevel.java"
click node_case_data "https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/datarepo/TCLevelData.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_feature,node_login_steps toneBlue
class node_maven,node_runner,node_hooks,node_reports toneAmber
class node_account_login,node_my_account,node_my_store,node_browser_service,node_reuse toneMint
class node_app_data,node_case_data toneRose
class node_browser,node_janbask toneNeutral
```

## Components

### BDD Specification

- [Login feature](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/resources/features/Login.feature): Gherkin feature · `src/test/resources/features/Login.feature`
- [Login steps](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/stepDefinitions/Login.java): step definitions · Translates login scenarios into page actions. · `src/test/java/stepDefinitions/Login.java`

### Test Execution

- [Maven build](https://github.com/testingtequila/janbaskdemoautomation/blob/master/pom.xml): build boundary · Resolves dependencies and launches the test suite. · `pom.xml`
- [Cucumber TestNG runner](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/testRunner/TestRunner.java): test runner · Discovers features and glue and configures reporting. · `src/test/java/testRunner/TestRunner.java`
- [Scenario hooks](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/test/java/stepDefinitions/Hooks.java): lifecycle control · Creates and cleans up browser sessions per scenario. · `src/test/java/stepDefinitions/Hooks.java`
- **Test results**: Maven output · Cucumber plugin output is written under target.

### Automation Core

- [Account login page](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/AccountLogin.java): page object · `src/main/java/pom/AccountLogin.java`
- [My account page](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/MyAccount.java): page object · `src/main/java/pom/MyAccount.java`
- [Store page](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/pom/MyStore.java): page object · `src/main/java/pom/MyStore.java`
- [Browser handling](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/utilities/HandlingBrowsers.java): session service · Centralizes browser selection and WebDriver session creation. · `src/main/java/utilities/HandlingBrowsers.java`
- [Shared automation](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/utilities/Reuse.java): WebDriver utility · Provides reusable waits and browser interactions. · `src/main/java/utilities/Reuse.java`

### Test Data

- [Application data](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/datarepo/AppLevel.java): data repository · Holds reusable application-level values. · `src/main/java/datarepo/AppLevel.java`
- [Test-case data](https://github.com/testingtequila/janbaskdemoautomation/blob/master/src/main/java/datarepo/TCLevelData.java): data repository · Holds test-case-specific inputs. · `src/main/java/datarepo/TCLevelData.java`

### Other components

- **Browser driver**: environment dependency · A locally available browser and driver execute WebDriver commands.
- **Janbask demo site**: system under test

## Connections

- Maven build → Cucumber TestNG runner: launches
- Maven build → Test results: writes output
- Login feature → Cucumber TestNG runner: discovered by
- Cucumber TestNG runner → Scenario hooks: runs lifecycle
- Cucumber TestNG runner → Login steps: binds steps
- Cucumber TestNG runner → Test results: publishes results
- Scenario hooks → Browser handling: initializes and closes
- Login steps → Account login page: uses
- Login steps → My account page: uses
- Login steps → Store page: uses
- Login steps → Application data: reads values
- Login steps → Test-case data: reads inputs
- Browser handling → Browser driver: creates session
- Account login page → Shared automation: uses shared actions
- My account page → Shared automation: uses shared actions
- Store page → Shared automation: uses shared actions
- Shared automation → Browser driver: issues WebDriver commands
- Browser driver → Janbask demo site: drives UI against
