# rana9019/playwright-behave-py architecture

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

- Interactive diagram: https://gitdiagram.com/rana9019/playwright-behave-py
- Repository: https://github.com/rana9019/playwright-behave-py

## Overview

This repository is a Playwright/Behave UI test-automation framework for a web application, with test-result reporting and analysis utilities. Its main workflow is Gherkin scenarios → Behave step definitions → page objects that drive and verify the application in Chromium. The documented test domains remain separate page-object components; reporting includes an interactive dashboard, failure analysis, and Excel updates. Source evidence is sampled, so some domain-level links reflect the README’s documented architecture rather than inspected step implementations.

Main entry points: [`environment.py`](https://github.com/rana9019/playwright-behave-py/blob/main/environment.py) (Behave lifecycle), [`steps`](https://github.com/rana9019/playwright-behave-py/tree/main/steps) (Step definitions), [`features`](https://github.com/rana9019/playwright-behave-py/tree/main/features) (Domain scenarios), [`pages/login_page.py`](https://github.com/rana9019/playwright-behave-py/blob/main/pages/login_page.py) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bdd["BDD scenarios"]
  node_features["Domain scenarios"]
end

subgraph group_automation["Browser automation"]
  node_steps["Step definitions"]
  node_login_page["Login<br/>[login_page.py]"]
  node_patients_page["Patients<br/>[patients_page.py]"]
  node_alerts_page["Alerts<br/>[alerts_page.py]"]
  node_dose_page["Dose tracking<br/>[dositrace_page.py]"]
  node_exams_page["Examinations<br/>[exams_page.py]"]
  node_protocols_page["Protocols"]
  node_risk_page["Risk assessment"]
  node_worklist_page["Worklist<br/>[worklist_page.py]"]
  node_nrd_page["NRD/NRI<br/>[nrd_nri_page.py]"]
  node_reports_page["Reports<br/>[rapport_page.py]"]
  node_statistics_page["Statistics"]
end

subgraph group_runtime["Test runtime"]
  node_browser(("Chromium browser"))
  node_environment["Behave lifecycle<br/>[environment.py]"]
end

subgraph group_reporting["Results and analysis"]
  node_results[("Scenario results<br/>[environment.py]")]
  node_dashboard["Interactive dashboard"]
  node_failure_analysis["Failure analysis"]
  node_excel["Excel reporting<br/>[excel_updater.py]"]
end

node_tester(("Test author"))
node_application(("Tested web application"))

node_tester -->|"authors scenarios"| node_features
node_features -->|"binds steps"| node_steps
node_steps -.->|"drives login"| node_login_page
node_steps -->|"calls page methods"| node_patients_page
node_steps -.->|"drives alerts"| node_alerts_page
node_steps -.->|"drives dose tests"| node_dose_page
node_steps -.->|"drives exam tests"| node_exams_page
node_steps -.->|"drives protocol tests"| node_protocols_page
node_steps -.->|"drives risk tests"| node_risk_page
node_steps -.->|"drives worklist tests"| node_worklist_page
node_steps -.->|"drives NRD/NRI tests"| node_nrd_page
node_steps -.->|"drives report tests"| node_reports_page
node_steps -.->|"drives statistics tests"| node_statistics_page
node_environment -->|"launches"| node_browser
node_environment -->|"creates page object"| node_login_page
node_environment -->|"creates page object"| node_patients_page
node_environment -->|"creates page object"| node_alerts_page
node_environment -->|"creates page object"| node_dose_page
node_environment -->|"creates page object"| node_exams_page
node_environment -->|"creates page object"| node_protocols_page
node_environment -->|"creates page object"| node_risk_page
node_environment -->|"creates page object"| node_worklist_page
node_environment -->|"creates page object"| node_nrd_page
node_environment -->|"creates page object"| node_reports_page
node_environment -->|"creates page object"| node_statistics_page
node_browser -->|"automates UI"| node_application
node_environment -->|"records scenarios"| node_results
node_results -->|"updates workbook"| node_excel
node_results -.->|"visualizes results"| node_dashboard
node_results -.->|"analyzes failures"| node_failure_analysis

click node_features "https://github.com/rana9019/playwright-behave-py/tree/main/features"
click node_steps "https://github.com/rana9019/playwright-behave-py/tree/main/steps"
click node_login_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/login_page.py"
click node_patients_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/patients_page.py"
click node_alerts_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/alerts_page.py"
click node_dose_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/dositrace_page.py"
click node_exams_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/exams_page.py"
click node_protocols_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/protocoles_dositrace_page.py"
click node_risk_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/risk_patient_page.py"
click node_worklist_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/worklist_page.py"
click node_nrd_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/nrd_nri_page.py"
click node_reports_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/rapport_page.py"
click node_statistics_page "https://github.com/rana9019/playwright-behave-py/blob/main/pages/statistique_page.py"
click node_environment "https://github.com/rana9019/playwright-behave-py/blob/main/environment.py"
click node_results "https://github.com/rana9019/playwright-behave-py/blob/main/environment.py"
click node_dashboard "https://github.com/rana9019/playwright-behave-py/blob/main/utils/playwright_dashboard.py"
click node_failure_analysis "https://github.com/rana9019/playwright-behave-py/blob/main/utils/analyze_failures.py"
click node_excel "https://github.com/rana9019/playwright-behave-py/blob/main/utils/excel_updater.py"

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 toneBlue
class node_steps,node_login_page,node_patients_page,node_alerts_page,node_dose_page,node_exams_page,node_protocols_page,node_risk_page,node_worklist_page,node_nrd_page,node_reports_page,node_statistics_page toneAmber
class node_browser,node_environment toneMint
class node_results,node_dashboard,node_failure_analysis,node_excel toneRose
class node_tester,node_application toneIndigo
```

## Components

### BDD scenarios

- [Domain scenarios](https://github.com/rana9019/playwright-behave-py/tree/main/features): `features`

### Browser automation

- [Step definitions](https://github.com/rana9019/playwright-behave-py/tree/main/steps): `steps`
- [Login](https://github.com/rana9019/playwright-behave-py/blob/main/pages/login_page.py): `pages/login_page.py`
- [Patients](https://github.com/rana9019/playwright-behave-py/blob/main/pages/patients_page.py): `pages/patients_page.py`
- [Alerts](https://github.com/rana9019/playwright-behave-py/blob/main/pages/alerts_page.py): `pages/alerts_page.py`
- [Dose tracking](https://github.com/rana9019/playwright-behave-py/blob/main/pages/dositrace_page.py): `pages/dositrace_page.py`
- [Examinations](https://github.com/rana9019/playwright-behave-py/blob/main/pages/exams_page.py): `pages/exams_page.py`
- [Protocols](https://github.com/rana9019/playwright-behave-py/blob/main/pages/protocoles_dositrace_page.py): `pages/protocoles_dositrace_page.py`
- [Risk assessment](https://github.com/rana9019/playwright-behave-py/blob/main/pages/risk_patient_page.py): `pages/risk_patient_page.py`
- [Worklist](https://github.com/rana9019/playwright-behave-py/blob/main/pages/worklist_page.py): `pages/worklist_page.py`
- [NRD/NRI](https://github.com/rana9019/playwright-behave-py/blob/main/pages/nrd_nri_page.py): `pages/nrd_nri_page.py`
- [Reports](https://github.com/rana9019/playwright-behave-py/blob/main/pages/rapport_page.py): `pages/rapport_page.py`
- [Statistics](https://github.com/rana9019/playwright-behave-py/blob/main/pages/statistique_page.py): `pages/statistique_page.py`

### Test runtime

- **Chromium browser**
- [Behave lifecycle](https://github.com/rana9019/playwright-behave-py/blob/main/environment.py): `environment.py`

### Results and analysis

- [Scenario results](https://github.com/rana9019/playwright-behave-py/blob/main/environment.py): `environment.py`
- [Interactive dashboard](https://github.com/rana9019/playwright-behave-py/blob/main/utils/playwright_dashboard.py): `utils/playwright_dashboard.py`
- [Failure analysis](https://github.com/rana9019/playwright-behave-py/blob/main/utils/analyze_failures.py): `utils/analyze_failures.py`
- [Excel reporting](https://github.com/rana9019/playwright-behave-py/blob/main/utils/excel_updater.py): `utils/excel_updater.py`

### Other components

- **Test author**
- **Tested web application**

## Connections

- Test author → Domain scenarios: authors scenarios (evidence: `readme.md`)
- Domain scenarios → Step definitions: binds steps (evidence: `readme.md`)
- Step definitions → Login: drives login
- Step definitions → Patients: calls page methods (evidence: `steps/patients_steps.py`)
- Step definitions → Alerts: drives alerts
- Step definitions → Dose tracking: drives dose tests
- Step definitions → Examinations: drives exam tests
- Step definitions → Protocols: drives protocol tests
- Step definitions → Risk assessment: drives risk tests
- Step definitions → Worklist: drives worklist tests
- Step definitions → NRD/NRI: drives NRD/NRI tests
- Step definitions → Reports: drives report tests
- Step definitions → Statistics: drives statistics tests
- Behave lifecycle → Chromium browser: launches (evidence: `environment.py`)
- Behave lifecycle → Login: creates page object (evidence: `environment.py`)
- Behave lifecycle → Patients: creates page object (evidence: `environment.py`)
- Behave lifecycle → Alerts: creates page object (evidence: `environment.py`)
- Behave lifecycle → Dose tracking: creates page object (evidence: `environment.py`)
- Behave lifecycle → Examinations: creates page object (evidence: `environment.py`)
- Behave lifecycle → Protocols: creates page object (evidence: `environment.py`)
- Behave lifecycle → Risk assessment: creates page object (evidence: `environment.py`)
- Behave lifecycle → Worklist: creates page object (evidence: `environment.py`)
- Behave lifecycle → NRD/NRI: creates page object (evidence: `environment.py`)
- Behave lifecycle → Reports: creates page object (evidence: `environment.py`)
- Behave lifecycle → Statistics: creates page object (evidence: `environment.py`)
- Chromium browser → Tested web application: automates UI (evidence: `readme.md`)
- Behave lifecycle → Scenario results: records scenarios (evidence: `environment.py`)
- Scenario results → Excel reporting: updates workbook (evidence: `environment.py`)
- Scenario results → Interactive dashboard: visualizes results (evidence: `readme.md`)
- Scenario results → Failure analysis: analyzes failures (evidence: `readme.md`)
