# mythilysenthil/playwright_etr architecture

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

- Interactive diagram: https://gitdiagram.com/mythilysenthil/playwright_etr
- Repository: https://github.com/mythilysenthil/playwright_etr

## Overview

#### Purpose and Entry Points
This is a TypeScript end-to-end test automation repository for an employee/course-management application. It runs Cucumber BDD scenarios against a browser through Playwright. Primary execution configuration is in `cucumber.js`, with browser setup in `playwright.config.ts` and dependency/scripts definitions in `package.json`.

#### BDD Feature Layer
Business workflows are expressed as Gherkin features: course creation/editing, employee deletion/filtering, Excel export, and application launch. Feature files define the test suite’s externally visible behavior and map to step implementations.
- `src/test/features/Addcourse.feature`
- `src/test/features/EditCourse.feature`
- `src/test/features/ExcelExport.feature`

#### Step and World Orchestration
Step-definition modules bind Gherkin phrases to page actions and assertions. A custom Cucumber World carries shared scenario state—such as Playwright browser/page context and scenario-specific data—across steps. Hooks establish and tear down that runtime around scenarios.
- `src/test/steps/AddcourseSteps.ts`
- `src/test/world/CustomWorld.ts`
- `src/test/hooks/hooks.ts`

#### Page Object Boundary
Page objects isolate UI locators and browser interactions from BDD steps. `BasePage` likely supplies common interaction/navigation primitives; workflow-specific page objects model the home screen, sidebar, course forms, and filtering controls. This is the primary boundary between test intent and the target application UI.
- `src/test/pages/BasePage.ts`
- `src/test/pages/HomePage.ts`
- `src/test/pages/AddcoursePage.ts`

#### Test Data and Typed Input Models
Scenarios consume structured JSON, CSV, and Excel fixtures rather than embedding all values in feature files. Type definitions describe expected data shapes, while reader utilities load external data for data-driven tests such as employee filtering, course management, and export validation.
- `src/test/test-data/addcourse.json`
- `src/test/test-data/EmpID_Data.xlsx`
- `src/test/utilities/ExcelReader.ts`

#### Runtime Configuration and Reporting
Environment-specific values are kept outside test logic and read through an environment utility, with QA settings present under `env/`. The suite produces custom reporting through the report module, and execution timing behavior is centrally represented by timeout constants.
- `env/.env.qa`
- `src/test/utilities/envReader.ts`
- `src/test/helper/report.mts`

#### Execution Infrastructure
Node.js is the host runtime, TypeScript is the implementation language, Cucumber is the scenario runner, and Playwright drives browser automation. CI executes the suite through GitHub Actions, with a dedicated Playwright workflow. `rerun/` appears to retain rerun-related execution output or scenario references.
- `.github/workflows/playwright.yml`
- `cucumber.js`
- `rerun/@rerun.txt`

Main entry points: [`src/test/steps/AddcourseSteps.ts`](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/steps/AddcourseSteps.ts) (Step definitions), [`cucumber.js`](https://github.com/mythilysenthil/playwright_etr/blob/main/cucumber.js) (Cucumber runner), [`src/test/world/CustomWorld.ts`](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/world/CustomWorld.ts) (Custom World), [`src/test/pages/BasePage.ts`](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/BasePage.ts) (Base page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bdd["BDD Suite"]
  node_features["Gherkin features<br/>BDD specifications<br/>[Addcourse.feature]"]
  node_steps["Step definitions<br/>Cucumber bindings<br/>[AddcourseSteps.ts]"]
  node_world["Custom World<br/>scenario state<br/>[CustomWorld.ts]"]
  node_hooks["Scenario hooks<br/>Cucumber lifecycle<br/>[hooks.ts]"]
end

subgraph group_ui["Browser Automation"]
  node_basepage["Base page<br/>page-object base<br/>[BasePage.ts]"]
  node_homepage["Home page<br/>page object<br/>[HomePage.ts]"]
  node_coursepage["Course form page<br/>page object<br/>[AddcoursePage.ts]"]
  node_playwright{{"Playwright browser<br/>browser automation"}}
end

subgraph group_data["Data &amp; Environment"]
  node_fixtures["Course JSON fixture<br/>test data<br/>[addcourse.json]"]
  node_excel["Employee Excel fixture<br/>test data<br/>[EmpID_Data.xlsx]"]
  node_excelreader["Excel reader<br/>fixture reader<br/>[ExcelReader.ts]"]
  node_envreader["Environment reader<br/>settings utility<br/>[envReader.ts]"]
  node_qaenv["QA environment<br/>environment settings<br/>[.env.qa]"]
end

subgraph group_execution["Execution &amp; CI"]
  node_cucumber{{"Cucumber runner<br/>BDD runner config<br/>[cucumber.js]"}}
  node_report["Custom report<br/>reporting module<br/>[report.mts]"]
  node_ci["GitHub Actions<br/>CI workflow<br/>[playwright.yml]"]
  node_rerun["Rerun references<br/>execution output<br/>[@rerun.txt]"]
  node_package["Node project<br/>runtime dependencies<br/>[package.json]"]
end

node_features -->|"maps phrases to"| node_steps
node_steps -->|"uses scenario state"| node_world
node_hooks -->|"initializes"| node_world
node_steps -->|"drives"| node_homepage
node_steps -->|"drives"| node_coursepage
node_homepage -->|"extends"| node_basepage
node_coursepage -->|"extends"| node_basepage
node_basepage -->|"uses"| node_playwright
node_steps -->|"consumes"| node_fixtures
node_steps -->|"reads data through"| node_excelreader
node_excelreader -->|"loads"| node_excel
node_world -.->|"reads runtime settings"| node_envreader
node_envreader -->|"loads"| node_qaenv
node_cucumber -->|"executes"| node_features
node_cucumber -->|"runs lifecycle"| node_hooks
node_cucumber -->|"produces"| node_report
node_ci -->|"runs suite"| node_cucumber
node_cucumber -.->|"writes or consumes"| node_rerun
node_package -.->|"provides scripts and dependencies"| node_cucumber
node_package -.->|"provides dependency"| node_playwright

click node_features "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/features/Addcourse.feature"
click node_steps "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/steps/AddcourseSteps.ts"
click node_world "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/world/CustomWorld.ts"
click node_hooks "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/hooks/hooks.ts"
click node_basepage "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/BasePage.ts"
click node_homepage "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/HomePage.ts"
click node_coursepage "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/AddcoursePage.ts"
click node_playwright "https://github.com/mythilysenthil/playwright_etr/blob/main/playwright.config.ts"
click node_fixtures "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/test-data/addcourse.json"
click node_excel "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/test-data/EmpID_Data.xlsx"
click node_excelreader "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/utilities/ExcelReader.ts"
click node_envreader "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/utilities/envReader.ts"
click node_qaenv "https://github.com/mythilysenthil/playwright_etr/blob/main/env/.env.qa"
click node_cucumber "https://github.com/mythilysenthil/playwright_etr/blob/main/cucumber.js"
click node_report "https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/helper/report.mts"
click node_ci "https://github.com/mythilysenthil/playwright_etr/blob/main/.github/workflows/playwright.yml"
click node_rerun "https://github.com/mythilysenthil/playwright_etr/blob/main/rerun/%40rerun.txt"
click node_package "https://github.com/mythilysenthil/playwright_etr/blob/main/package.json"

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_features,node_steps,node_world,node_hooks toneBlue
class node_basepage,node_homepage,node_coursepage,node_playwright toneAmber
class node_fixtures,node_excel,node_excelreader,node_envreader,node_qaenv toneMint
class node_cucumber,node_report,node_ci,node_rerun,node_package toneRose
```

## Components

### BDD Suite

Feature specifications and scenario orchestration.

- [Gherkin features](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/features/Addcourse.feature): BDD specifications · Course and export workflows define visible test behavior. · `src/test/features/Addcourse.feature`
- [Step definitions](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/steps/AddcourseSteps.ts): Cucumber bindings · Binds feature phrases to page actions and assertions. · `src/test/steps/AddcourseSteps.ts`
- [Custom World](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/world/CustomWorld.ts): scenario state · Carries browser context, page, and scenario data. · `src/test/world/CustomWorld.ts`
- [Scenario hooks](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/hooks/hooks.ts): Cucumber lifecycle · Creates and tears down scenario runtime. · `src/test/hooks/hooks.ts`

### Browser Automation

Page-object boundary over the application UI.

- [Base page](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/BasePage.ts): page-object base · Shared navigation and interaction primitives. · `src/test/pages/BasePage.ts`
- [Home page](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/HomePage.ts): page object · `src/test/pages/HomePage.ts`
- [Course form page](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/pages/AddcoursePage.ts): page object · Models course creation and editing UI. · `src/test/pages/AddcoursePage.ts`
- [Playwright browser](https://github.com/mythilysenthil/playwright_etr/blob/main/playwright.config.ts): browser automation · Drives the target application in a browser. · `playwright.config.ts`

### Data & Environment

External fixtures and runtime settings.

- [Course JSON fixture](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/test-data/addcourse.json): test data · Structured input for course scenarios. · `src/test/test-data/addcourse.json`
- [Employee Excel fixture](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/test-data/EmpID_Data.xlsx): test data · Input or validation data for employee workflows. · `src/test/test-data/EmpID_Data.xlsx`
- [Excel reader](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/utilities/ExcelReader.ts): fixture reader · Loads spreadsheet data for data-driven tests. · `src/test/utilities/ExcelReader.ts`
- [Environment reader](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/utilities/envReader.ts): settings utility · Loads environment-specific values outside test logic. · `src/test/utilities/envReader.ts`
- [QA environment](https://github.com/mythilysenthil/playwright_etr/blob/main/env/.env.qa): environment settings · `env/.env.qa`

### Execution & CI

Runner configuration, reporting, and continuous execution.

- [Cucumber runner](https://github.com/mythilysenthil/playwright_etr/blob/main/cucumber.js): BDD runner config · Primary scenario execution configuration. · `cucumber.js`
- [Custom report](https://github.com/mythilysenthil/playwright_etr/blob/main/src/test/helper/report.mts): reporting module · `src/test/helper/report.mts`
- [GitHub Actions](https://github.com/mythilysenthil/playwright_etr/blob/main/.github/workflows/playwright.yml): CI workflow · Runs the Playwright test workflow. · `.github/workflows/playwright.yml`
- [Rerun references](https://github.com/mythilysenthil/playwright_etr/blob/main/rerun/%40rerun.txt): execution output · Stores scenarios or output used for reruns. · `rerun/@rerun.txt`
- [Node project](https://github.com/mythilysenthil/playwright_etr/blob/main/package.json): runtime dependencies · Defines scripts and TypeScript test dependencies. · `package.json`

## Connections

- Gherkin features → Step definitions: maps phrases to
- Step definitions → Custom World: uses scenario state
- Scenario hooks → Custom World: initializes
- Step definitions → Home page: drives
- Step definitions → Course form page: drives
- Home page → Base page: extends
- Course form page → Base page: extends
- Base page → Playwright browser: uses
- Step definitions → Course JSON fixture: consumes
- Step definitions → Excel reader: reads data through
- Excel reader → Employee Excel fixture: loads
- Custom World → Environment reader: reads runtime settings
- Environment reader → QA environment: loads
- Cucumber runner → Gherkin features: executes
- Cucumber runner → Scenario hooks: runs lifecycle
- Cucumber runner → Custom report: produces
- GitHub Actions → Cucumber runner: runs suite
- Cucumber runner → Rerun references: writes or consumes
- Node project → Cucumber runner: provides scripts and dependencies
- Node project → Playwright browser: provides dependency
