# amol9patil/playwright-bdd-framework architecture

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

- Interactive diagram: https://gitdiagram.com/amol9patil/playwright-bdd-framework
- Repository: https://github.com/amol9patil/playwright-bdd-framework

## Overview

This is a Playwright/TypeScript BDD UI-automation framework for SauceDemo. Its main workflow is Gherkin scenarios for authentication, inventory, cart and checkout, mapped to step definitions that use fixtures and page objects to exercise the site; assertions remain in the steps. Page objects share BasePage behavior. The README also documents cross-browser execution, failure evidence, and HTML plus reportingLabs reports. Edges follow the README’s stated architecture or sampled imports and calls; fixture internals and feature-to-step registration are not sampled, so those links use the README as evidence.

Main entry points: [`fixtures/customFixtures.ts`](https://github.com/amol9patil/playwright-bdd-framework/blob/main/fixtures/customFixtures.ts) (Custom fixtures), [`pages/InventoryPage.ts`](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/InventoryPage.ts) (Inventory page), [`features`](https://github.com/amol9patil/playwright-bdd-framework/tree/main/features) (Gherkin scenarios), [`steps/authentication.steps.ts`](https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/authentication.steps.ts) (Authentication steps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bdd["BDD scenarios and steps"]
  node_features["Gherkin scenarios"]
  node_auth_steps["Authentication steps"]
  node_cart_steps["Cart steps<br/>[cart.steps.ts]"]
  node_checkout_steps["Checkout steps<br/>[checkout.steps.ts]"]
  node_inventory_steps["Inventory steps<br/>[inventory.steps.ts]"]
end

subgraph group_ui["Browser interaction"]
  node_login_page["Login page<br/>[LoginPage.ts]"]
  node_inventory_page["Inventory page<br/>[InventoryPage.ts]"]
  node_cart_page["Cart page<br/>[CartPage.ts]"]
  node_checkout_page["Checkout page<br/>[CheckoutPage.ts]"]
  node_base_page["Shared page behavior<br/>[BasePage.ts]"]
end

subgraph group_runtime["Execution and reporting"]
  node_fixtures["Custom fixtures<br/>[customFixtures.ts]"]
  node_credentials["Credentials<br/>[env.ts]"]
  node_runner["Playwright runner"]
  node_report_config["Report settings"]
  node_html_report["Playwright HTML report"]
  node_labs_report["ReportingLabs report"]
end

node_operator(("Test author"))
node_saucedemo["SauceDemo site"]

node_operator -->|"defines scenarios"| node_features
node_features -->|"maps to steps"| node_auth_steps
node_features -->|"maps to steps"| node_cart_steps
node_features -->|"maps to steps"| node_checkout_steps
node_features -->|"maps to steps"| node_inventory_steps
node_auth_steps -->|"uses"| node_fixtures
node_cart_steps -->|"uses"| node_fixtures
node_checkout_steps -->|"uses"| node_fixtures
node_inventory_steps -->|"uses"| node_fixtures
node_fixtures -->|"provides"| node_login_page
node_fixtures -->|"provides"| node_inventory_page
node_fixtures -->|"provides"| node_cart_page
node_fixtures -->|"provides"| node_checkout_page
node_auth_steps -->|"calls"| node_login_page
node_auth_steps -->|"calls"| node_inventory_page
node_auth_steps -->|"reads"| node_credentials
node_cart_steps -->|"calls"| node_inventory_page
node_cart_steps -->|"calls"| node_cart_page
node_checkout_steps -->|"calls"| node_cart_page
node_checkout_steps -->|"calls"| node_checkout_page
node_inventory_steps -->|"uses"| node_inventory_page
node_login_page -->|"extends"| node_base_page
node_inventory_page -->|"extends"| node_base_page
node_cart_page -->|"extends"| node_base_page
node_checkout_page -->|"extends"| node_base_page
node_login_page -->|"drives UI"| node_saucedemo
node_inventory_page -->|"drives UI"| node_saucedemo
node_cart_page -->|"drives UI"| node_saucedemo
node_checkout_page -->|"drives UI"| node_saucedemo
node_runner -->|"imports"| node_report_config
node_runner -->|"configures"| node_html_report
node_runner -->|"configures"| node_labs_report

click node_features "https://github.com/amol9patil/playwright-bdd-framework/tree/main/features"
click node_auth_steps "https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/authentication.steps.ts"
click node_cart_steps "https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/cart.steps.ts"
click node_checkout_steps "https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/checkout.steps.ts"
click node_inventory_steps "https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/inventory.steps.ts"
click node_fixtures "https://github.com/amol9patil/playwright-bdd-framework/blob/main/fixtures/customFixtures.ts"
click node_login_page "https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/LoginPage.ts"
click node_inventory_page "https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/InventoryPage.ts"
click node_cart_page "https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/CartPage.ts"
click node_checkout_page "https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/CheckoutPage.ts"
click node_base_page "https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/BasePage.ts"
click node_credentials "https://github.com/amol9patil/playwright-bdd-framework/blob/main/utils/env.ts"
click node_runner "https://github.com/amol9patil/playwright-bdd-framework/blob/main/playwright.config.ts"
click node_report_config "https://github.com/amol9patil/playwright-bdd-framework/blob/main/reporting-labs.config.ts"

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_auth_steps,node_cart_steps,node_checkout_steps,node_inventory_steps toneBlue
class node_login_page,node_inventory_page,node_cart_page,node_checkout_page,node_base_page toneAmber
class node_fixtures,node_credentials,node_runner,node_report_config,node_html_report,node_labs_report toneMint
class node_operator,node_saucedemo toneIndigo
```

## Components

### BDD scenarios and steps

- [Gherkin scenarios](https://github.com/amol9patil/playwright-bdd-framework/tree/main/features): `features`
- [Authentication steps](https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/authentication.steps.ts): `steps/authentication.steps.ts`
- [Cart steps](https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/cart.steps.ts): `steps/cart.steps.ts`
- [Checkout steps](https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/checkout.steps.ts): `steps/checkout.steps.ts`
- [Inventory steps](https://github.com/amol9patil/playwright-bdd-framework/blob/main/steps/inventory.steps.ts): `steps/inventory.steps.ts`

### Browser interaction

- [Login page](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/LoginPage.ts): `pages/LoginPage.ts`
- [Inventory page](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/InventoryPage.ts): `pages/InventoryPage.ts`
- [Cart page](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/CartPage.ts): `pages/CartPage.ts`
- [Checkout page](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/CheckoutPage.ts): `pages/CheckoutPage.ts`
- [Shared page behavior](https://github.com/amol9patil/playwright-bdd-framework/blob/main/pages/BasePage.ts): `pages/BasePage.ts`

### Execution and reporting

- [Custom fixtures](https://github.com/amol9patil/playwright-bdd-framework/blob/main/fixtures/customFixtures.ts): `fixtures/customFixtures.ts`
- [Credentials](https://github.com/amol9patil/playwright-bdd-framework/blob/main/utils/env.ts): `utils/env.ts`
- [Playwright runner](https://github.com/amol9patil/playwright-bdd-framework/blob/main/playwright.config.ts): `playwright.config.ts`
- [Report settings](https://github.com/amol9patil/playwright-bdd-framework/blob/main/reporting-labs.config.ts): `reporting-labs.config.ts`
- **Playwright HTML report**
- **ReportingLabs report**

### Other components

- **Test author**
- **SauceDemo site**

## Connections

- Test author → Gherkin scenarios: defines scenarios (evidence: `README.md`)
- Gherkin scenarios → Authentication steps: maps to steps (evidence: `README.md`)
- Gherkin scenarios → Cart steps: maps to steps (evidence: `README.md`)
- Gherkin scenarios → Checkout steps: maps to steps (evidence: `README.md`)
- Gherkin scenarios → Inventory steps: maps to steps (evidence: `README.md`)
- Authentication steps → Custom fixtures: uses (evidence: `steps/authentication.steps.ts`)
- Cart steps → Custom fixtures: uses (evidence: `steps/cart.steps.ts`)
- Checkout steps → Custom fixtures: uses (evidence: `steps/checkout.steps.ts`)
- Inventory steps → Custom fixtures: uses (evidence: `steps/inventory.steps.ts`)
- Custom fixtures → Login page: provides (evidence: `README.md`)
- Custom fixtures → Inventory page: provides (evidence: `README.md`)
- Custom fixtures → Cart page: provides (evidence: `README.md`)
- Custom fixtures → Checkout page: provides (evidence: `README.md`)
- Authentication steps → Login page: calls (evidence: `steps/authentication.steps.ts`)
- Authentication steps → Inventory page: calls (evidence: `steps/authentication.steps.ts`)
- Authentication steps → Credentials: reads (evidence: `steps/authentication.steps.ts`)
- Cart steps → Inventory page: calls (evidence: `steps/cart.steps.ts`)
- Cart steps → Cart page: calls (evidence: `steps/cart.steps.ts`)
- Checkout steps → Cart page: calls (evidence: `steps/checkout.steps.ts`)
- Checkout steps → Checkout page: calls (evidence: `steps/checkout.steps.ts`)
- Inventory steps → Inventory page: uses (evidence: `steps/inventory.steps.ts`)
- Login page → Shared page behavior: extends (evidence: `pages/LoginPage.ts`)
- Inventory page → Shared page behavior: extends (evidence: `pages/InventoryPage.ts`)
- Cart page → Shared page behavior: extends (evidence: `pages/CartPage.ts`)
- Checkout page → Shared page behavior: extends (evidence: `pages/CheckoutPage.ts`)
- Login page → SauceDemo site: drives UI (evidence: `README.md`)
- Inventory page → SauceDemo site: drives UI (evidence: `README.md`)
- Cart page → SauceDemo site: drives UI (evidence: `README.md`)
- Checkout page → SauceDemo site: drives UI (evidence: `README.md`)
- Playwright runner → Report settings: imports (evidence: `playwright.config.ts`)
- Playwright runner → Playwright HTML report: configures (evidence: `playwright.config.ts`)
- Playwright runner → ReportingLabs report: configures (evidence: `playwright.config.ts`)
