# takoua17/formationplaywrightbdd architecture

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

- Interactive diagram: https://gitdiagram.com/takoua17/formationplaywrightbdd
- Repository: https://github.com/takoua17/formationplaywrightbdd

## Overview

FormationPlaywrightBDD is a Playwright/Cucumber BDD test framework for validating automationexercise.com through UI scenarios and a separate account API scenario. The main UI path runs from Gherkin features through Cucumber step definitions and page objects to browser actions; hooks manage browser lifecycle and capture artifacts. Product, cart, checkout, and authentication are distinct scenario domains, with YAML-backed configuration as an internal layer. The README documents these capabilities; edges for unsampled scenario files are limited to its architecture description and indexed references.

Main entry points: [`src/steps/ui`](https://github.com/takoua17/formationplaywrightbdd/tree/main/src/steps/ui) (UI step definitions), [`src/pages/connexionPage.ts`](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/connexionPage.ts) (Login / logout), [`src/pages/checkoutPage.ts`](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/checkoutPage.ts) (Checkout & payment), [`src/support/pageFixture.ts`](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/support/pageFixture.ts) (Page fixture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_specs["BDD Scenarios"]
  node_ui_features["UI features"]
  node_api_feature["Account feature<br/>[compte.feature]"]
end

subgraph group_execution["Scenario Execution"]
  node_ui_steps["UI step definitions"]
  node_api_steps["API step definitions<br/>[compteApistep.ts]"]
  node_hooks["Browser hooks<br/>[hooks.ts]"]
end

subgraph group_ui["UI Page Objects"]
  node_base_page["Base page helpers<br/>[basePage.ts]"]
  node_auth_page["Login / logout<br/>[connexionPage.ts]"]
  node_cart_page["Cart actions<br/>[panierPage.ts]"]
  node_product_page["Product browsing<br/>[produitPage.ts]"]
  node_checkout_page["Checkout &amp; payment<br/>[checkoutPage.ts]"]
end

subgraph group_api["Account API"]
  node_account_api["Account API client<br/>[compteApi.ts]"]
end

subgraph group_setup["Runtime Support"]
  node_fixture["Page fixture<br/>[pageFixture.ts]"]
  node_config_loader["YAML config loader<br/>[configLoader.ts]"]
  node_config_file["Runtime settings<br/>[config.yaml]"]
end

node_qa(("QA / BDD user"))
node_automation_site["Automation Exercise"]
node_playwright["Playwright browser"]
node_account_service["Account API service"]

node_qa -->|"defines scenarios"| node_ui_features
node_qa -->|"defines scenarios"| node_api_feature
node_ui_features -->|"maps steps"| node_ui_steps
node_api_feature -.->|"maps steps"| node_api_steps
node_ui_steps -->|"calls actions"| node_auth_page
node_ui_steps -->|"calls actions"| node_cart_page
node_ui_steps -->|"calls actions"| node_product_page
node_ui_steps -->|"calls actions"| node_checkout_page
node_ui_steps -->|"uses shared page"| node_fixture
node_api_steps -->|"calls client"| node_account_api
node_auth_page -->|"extends helpers"| node_base_page
node_cart_page -->|"extends helpers"| node_base_page
node_product_page -->|"extends helpers"| node_base_page
node_checkout_page -->|"extends helpers"| node_base_page
node_fixture -->|"types page reference"| node_product_page
node_hooks -->|"sets browser page"| node_fixture
node_hooks -->|"reads settings"| node_config_loader
node_config_loader -->|"loads YAML"| node_config_file
node_auth_page -->|"reads credentials"| node_config_loader
node_checkout_page -->|"reads payment settings"| node_config_loader
node_hooks -->|"launches browser"| node_playwright
node_fixture -->|"holds page"| node_playwright
node_auth_page -.->|"automates login"| node_automation_site
node_checkout_page -.->|"submits order"| node_automation_site
node_account_api -->|"sends account requests"| node_account_service

click node_ui_features "https://github.com/takoua17/formationplaywrightbdd/tree/main/src/features/ui"
click node_api_feature "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/features/api/compte.feature"
click node_ui_steps "https://github.com/takoua17/formationplaywrightbdd/tree/main/src/steps/ui"
click node_api_steps "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/steps/api/compteApistep.ts"
click node_hooks "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/hooks/hooks.ts"
click node_fixture "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/support/pageFixture.ts"
click node_base_page "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/basePage.ts"
click node_auth_page "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/connexionPage.ts"
click node_cart_page "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/panierPage.ts"
click node_product_page "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/produitPage.ts"
click node_checkout_page "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/checkoutPage.ts"
click node_config_loader "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/config/configLoader.ts"
click node_config_file "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/config/config.yaml"
click node_account_api "https://github.com/takoua17/formationplaywrightbdd/blob/main/src/api/compteApi.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_ui_features,node_api_feature,node_qa,node_playwright toneBlue
class node_ui_steps,node_api_steps,node_hooks toneAmber
class node_base_page,node_auth_page,node_cart_page,node_product_page,node_checkout_page,node_account_service toneMint
class node_account_api toneRose
class node_fixture,node_config_loader,node_config_file,node_automation_site toneIndigo
```

## Components

### BDD Scenarios

- [UI features](https://github.com/takoua17/formationplaywrightbdd/tree/main/src/features/ui): `src/features/ui`
- [Account feature](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/features/api/compte.feature): `src/features/api/compte.feature`

### Scenario Execution

- [UI step definitions](https://github.com/takoua17/formationplaywrightbdd/tree/main/src/steps/ui): `src/steps/ui`
- [API step definitions](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/steps/api/compteApistep.ts): `src/steps/api/compteApistep.ts`
- [Browser hooks](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/hooks/hooks.ts): `src/hooks/hooks.ts`

### UI Page Objects

- [Base page helpers](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/basePage.ts): `src/pages/basePage.ts`
- [Login / logout](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/connexionPage.ts): `src/pages/connexionPage.ts`
- [Cart actions](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/panierPage.ts): `src/pages/panierPage.ts`
- [Product browsing](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/produitPage.ts): `src/pages/produitPage.ts`
- [Checkout & payment](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/pages/checkoutPage.ts): `src/pages/checkoutPage.ts`

### Account API

- [Account API client](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/api/compteApi.ts): `src/api/compteApi.ts`

### Runtime Support

- [Page fixture](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/support/pageFixture.ts): `src/support/pageFixture.ts`
- [YAML config loader](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/config/configLoader.ts): `src/config/configLoader.ts`
- [Runtime settings](https://github.com/takoua17/formationplaywrightbdd/blob/main/src/config/config.yaml): `src/config/config.yaml`

### Other components

- **QA / BDD user**
- **Automation Exercise**
- **Playwright browser**
- **Account API service**

## Connections

- QA / BDD user → UI features: defines scenarios (evidence: `README.md`)
- QA / BDD user → Account feature: defines scenarios (evidence: `README.md`)
- UI features → UI step definitions: maps steps (evidence: `README.md`)
- Account feature → API step definitions: maps steps
- UI step definitions → Login / logout: calls actions (evidence: `src/steps/ui/connexionSteps.ts`)
- UI step definitions → Cart actions: calls actions (evidence: `src/steps/ui/panierSteps.ts`)
- UI step definitions → Product browsing: calls actions (evidence: `src/steps/ui/panierSteps.ts`)
- UI step definitions → Checkout & payment: calls actions (evidence: `src/steps/ui/checkoutSteps.ts`)
- UI step definitions → Page fixture: uses shared page (evidence: `src/steps/ui/panierSteps.ts`)
- API step definitions → Account API client: calls client (evidence: `src/steps/api/compteApistep.ts`)
- Login / logout → Base page helpers: extends helpers (evidence: `src/pages/connexionPage.ts`)
- Cart actions → Base page helpers: extends helpers (evidence: `src/pages/panierPage.ts`)
- Product browsing → Base page helpers: extends helpers (evidence: `src/pages/produitPage.ts`)
- Checkout & payment → Base page helpers: extends helpers (evidence: `src/pages/checkoutPage.ts`)
- Page fixture → Product browsing: types page reference (evidence: `src/support/pageFixture.ts`)
- Browser hooks → Page fixture: sets browser page (evidence: `src/hooks/hooks.ts`)
- Browser hooks → YAML config loader: reads settings (evidence: `src/hooks/hooks.ts`)
- YAML config loader → Runtime settings: loads YAML (evidence: `src/config/configLoader.ts`)
- Login / logout → YAML config loader: reads credentials (evidence: `src/pages/connexionPage.ts`)
- Checkout & payment → YAML config loader: reads payment settings (evidence: `src/pages/checkoutPage.ts`)
- Browser hooks → Playwright browser: launches browser (evidence: `src/hooks/hooks.ts`)
- Page fixture → Playwright browser: holds page (evidence: `src/support/pageFixture.ts`)
- Login / logout → Automation Exercise: automates login
- Checkout & payment → Automation Exercise: submits order
- Account API client → Account API service: sends account requests (evidence: `src/api/compteApi.ts`)
