# prakashs-dev/playwright-automation-testing architecture

> Architecture diagram of the GitHub repository prakashs-dev/playwright-automation-testing, 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/prakashs-dev/playwright-automation-testing
- Repository: https://github.com/prakashs-dev/playwright-automation-testing

## Overview

This repository is a Playwright automation-example suite, with a Cucumber hotel-booking workflow and separate page-object examples. The main user-to-result path is a test scenario driving a browser, performing actions, and checking outcomes; the Cucumber hotel steps and page objects show that flow directly. Other test areas cover ecommerce, browser behavior, APIs, and data sources. Source excerpts do not expose most test implementations or their wiring, so those branches are represented at directory level and are not given speculative call edges.

Main entry points: [`cucumber.js`](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber.js) (Cucumber Runner), [`cucumber/steps/searchpage.js`](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/steps/searchpage.js) (Search Steps), [`cucumber/pages/HomePage.js`](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/pages/HomePage.js) (Hotel Login Page), [`cucumber/support/hooks.js`](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/support/hooks.js) (Browser Hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hotel["Cucumber Hotel Tests"]
  node_cucumber_runner["Cucumber Runner<br/>[cucumber.js]"]
  node_hotel_features["Hotel Scenarios"]
  node_cucumber_hooks["Browser Hooks<br/>[hooks.js]"]
  node_login_steps["Login Steps<br/>[homepage.js]"]
  node_search_steps["Search Steps<br/>[searchpage.js]"]
  node_hotel_login["Hotel Login Page<br/>[HomePage.js]"]
  node_hotel_search["Hotel Search Page<br/>[SearchHotel.js]"]
  node_cucumber_report["Cucumber Report<br/>[report.js]"]
end

subgraph group_pages["Page Object Examples"]
  node_ecommerce_tests["Ecommerce Tests<br/>[Ecommerce.spec.js]"]
  node_ecommerce_login["Ecommerce Login<br/>[Login.js]"]
  node_ecommerce_product["Ecommerce Product<br/>[Product.js]"]
  node_ecommerce_checkout["Ecommerce Checkout<br/>[Checkout.js]"]
  node_demo_home["Demo Home Page<br/>[HomePage.js]"]
  node_demo_login["Demo Login Page<br/>[LoginPage.js]"]
  node_demo_cart["Demo Cart<br/>[Cart.js]"]
end

subgraph group_examples["Playwright Test Areas"]
  node_playwright_runner["Playwright Runner<br/>[package.json]"]
  node_general_tests["Browser Test Examples"]
  node_interview_tests["Interview Examples"]
end

subgraph group_data["Data Access"]
  node_mongo_helper["MongoDB Helper<br/>[mongodb.js]"]
  node_mongo_db[("MongoDB")]
end

node_test_author(("Test Author"))
node_browser(("Browser"))

node_test_author -->|"runs scenarios"| node_cucumber_runner
node_test_author -->|"runs tests"| node_playwright_runner
node_cucumber_runner -->|"loads scenarios"| node_hotel_features
node_cucumber_runner -->|"loads steps"| node_login_steps
node_cucumber_runner -->|"loads steps"| node_search_steps
node_cucumber_runner -->|"loads hooks"| node_cucumber_hooks
node_cucumber_hooks -->|"launches"| node_browser
node_login_steps -->|"calls login page"| node_hotel_login
node_search_steps -->|"calls login page"| node_hotel_login
node_search_steps -->|"calls search page"| node_hotel_search
node_hotel_login -->|"drives page"| node_browser
node_hotel_search -->|"drives page"| node_browser
node_mongo_helper -->|"connects to"| node_mongo_db

click node_cucumber_runner "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber.js"
click node_hotel_features "https://github.com/prakashs-dev/playwright-automation-testing/tree/main/cucumber/features"
click node_cucumber_hooks "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/support/hooks.js"
click node_login_steps "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/steps/homepage.js"
click node_search_steps "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/steps/searchpage.js"
click node_hotel_login "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/pages/HomePage.js"
click node_hotel_search "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/pages/SearchHotel.js"
click node_cucumber_report "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/reports/report.js"
click node_playwright_runner "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/package.json"
click node_general_tests "https://github.com/prakashs-dev/playwright-automation-testing/tree/main/tests"
click node_interview_tests "https://github.com/prakashs-dev/playwright-automation-testing/tree/main/interview"
click node_ecommerce_tests "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/Ecommerce.spec.js"
click node_ecommerce_login "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Login.js"
click node_ecommerce_product "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Product.js"
click node_ecommerce_checkout "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Checkout.js"
click node_demo_home "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/HomePage.js"
click node_demo_login "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/LoginPage.js"
click node_demo_cart "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/Cart.js"
click node_mongo_helper "https://github.com/prakashs-dev/playwright-automation-testing/blob/main/utils/mongodb.js"

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_cucumber_runner,node_hotel_features,node_cucumber_hooks,node_login_steps,node_search_steps,node_hotel_login,node_hotel_search,node_cucumber_report,node_browser toneBlue
class node_ecommerce_tests,node_ecommerce_login,node_ecommerce_product,node_ecommerce_checkout,node_demo_home,node_demo_login,node_demo_cart toneAmber
class node_playwright_runner,node_general_tests,node_interview_tests toneMint
class node_mongo_helper,node_mongo_db toneRose
class node_test_author toneIndigo
```

## Components

### Cucumber Hotel Tests

- [Cucumber Runner](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber.js): `cucumber.js`
- [Hotel Scenarios](https://github.com/prakashs-dev/playwright-automation-testing/tree/main/cucumber/features): `cucumber/features`
- [Browser Hooks](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/support/hooks.js): `cucumber/support/hooks.js`
- [Login Steps](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/steps/homepage.js): `cucumber/steps/homepage.js`
- [Search Steps](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/steps/searchpage.js): `cucumber/steps/searchpage.js`
- [Hotel Login Page](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/pages/HomePage.js): `cucumber/pages/HomePage.js`
- [Hotel Search Page](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/pages/SearchHotel.js): `cucumber/pages/SearchHotel.js`
- [Cucumber Report](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/cucumber/reports/report.js): `cucumber/reports/report.js`

### Page Object Examples

- [Ecommerce Tests](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/Ecommerce.spec.js): `ecommerce/Ecommerce.spec.js`
- [Ecommerce Login](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Login.js): `ecommerce/pages/Login.js`
- [Ecommerce Product](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Product.js): `ecommerce/pages/Product.js`
- [Ecommerce Checkout](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/ecommerce/pages/Checkout.js): `ecommerce/pages/Checkout.js`
- [Demo Home Page](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/HomePage.js): `pages/HomePage.js`
- [Demo Login Page](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/LoginPage.js): `pages/LoginPage.js`
- [Demo Cart](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/pages/Cart.js): `pages/Cart.js`

### Playwright Test Areas

- [Playwright Runner](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/package.json): `package.json`
- [Browser Test Examples](https://github.com/prakashs-dev/playwright-automation-testing/tree/main/tests): `tests`
- [Interview Examples](https://github.com/prakashs-dev/playwright-automation-testing/tree/main/interview): `interview`

### Data Access

- [MongoDB Helper](https://github.com/prakashs-dev/playwright-automation-testing/blob/main/utils/mongodb.js): `utils/mongodb.js`
- **MongoDB**

### Other components

- **Test Author**
- **Browser**

## Connections

- Test Author → Cucumber Runner: runs scenarios
- Test Author → Playwright Runner: runs tests (evidence: `package.json`)
- Cucumber Runner → Hotel Scenarios: loads scenarios (evidence: `cucumber.js`)
- Cucumber Runner → Login Steps: loads steps (evidence: `cucumber.js`)
- Cucumber Runner → Search Steps: loads steps (evidence: `cucumber.js`)
- Cucumber Runner → Browser Hooks: loads hooks (evidence: `cucumber.js`)
- Browser Hooks → Browser: launches (evidence: `cucumber/support/hooks.js`)
- Login Steps → Hotel Login Page: calls login page (evidence: `cucumber/steps/homepage.js`)
- Search Steps → Hotel Login Page: calls login page (evidence: `cucumber/steps/searchpage.js`)
- Search Steps → Hotel Search Page: calls search page (evidence: `cucumber/steps/searchpage.js`)
- Hotel Login Page → Browser: drives page (evidence: `cucumber/pages/HomePage.js`)
- Hotel Search Page → Browser: drives page (evidence: `cucumber/pages/SearchHotel.js`)
- MongoDB Helper → MongoDB: connects to (evidence: `utils/mongodb.js`)
