# surajswamy20/playwright-framework architecture

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

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

## Overview

This repository is a Playwright test-automation framework for browser-based and API exercises. Its principal workflow is running E2E or API test suites against target applications and services; page objects, fixtures, test data, and request helpers provide supporting layers. The tree also shows suites for login, products, browser behavior, and API lifecycle/authentication. Test files and the README were not excerpted, so their detailed calls and wiring cannot be confirmed; the graph avoids asserting those connections.

Main entry points: [`pages/LoginPage.ts`](https://github.com/surajswamy20/playwright-framework/blob/main/pages/LoginPage.ts) (Login pages), [`pages/LearningLoginPage.ts`](https://github.com/surajswamy20/playwright-framework/blob/main/pages/LearningLoginPage.ts) (Learning login), [`utils/apihelper.ts`](https://github.com/surajswamy20/playwright-framework/blob/main/utils/apihelper.ts) (API requests), [`playwright.config.ts`](https://github.com/surajswamy20/playwright-framework/blob/main/playwright.config.ts) (Runner config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_suites["Test suites"]
  node_e2e["Browser scenarios"]
  node_api["API scenarios"]
end

subgraph group_pages["Page objects"]
  node_login["Login pages<br/>[LoginPage.ts]"]
  node_learning_login["Learning login"]
  node_products["Product pages<br/>[productPage.ts]"]
  node_learning_products["Learning products"]
end

subgraph group_support["Test support"]
  node_fixtures["Test fixtures"]
  node_login_data["Login data<br/>[loginData.ts]"]
  node_api_data["API test data<br/>[apiTestData.ts]"]
  node_api_helper["API requests<br/>[apihelper.ts]"]
  node_login_helper["Login helper"]
  node_config["Runner config"]
end

node_engineer(("Test author"))
node_runner["Playwright runner"]
node_saucedemo["Sauce Demo"]
node_rest_api["Objects API"]

node_engineer -.->|"runs tests"| node_runner
node_runner -.->|"executes suites"| node_e2e
node_runner -.->|"executes suites"| node_api
node_learning_login -->|"opens site"| node_saucedemo
node_login -->|"opens site"| node_saucedemo
node_config -->|"sets base URL"| node_saucedemo
node_api_helper -->|"sends requests"| node_rest_api

click node_e2e "https://github.com/surajswamy20/playwright-framework/tree/main/tests/e2e"
click node_api "https://github.com/surajswamy20/playwright-framework/tree/main/tests/api"
click node_login "https://github.com/surajswamy20/playwright-framework/blob/main/pages/LoginPage.ts"
click node_learning_login "https://github.com/surajswamy20/playwright-framework/blob/main/pages/LearningLoginPage.ts"
click node_products "https://github.com/surajswamy20/playwright-framework/blob/main/pages/productPage.ts"
click node_learning_products "https://github.com/surajswamy20/playwright-framework/blob/main/pages/LearningProductsPage.ts"
click node_fixtures "https://github.com/surajswamy20/playwright-framework/tree/main/fixtures"
click node_login_data "https://github.com/surajswamy20/playwright-framework/blob/main/data/loginData.ts"
click node_api_data "https://github.com/surajswamy20/playwright-framework/blob/main/data/apiTestData.ts"
click node_api_helper "https://github.com/surajswamy20/playwright-framework/blob/main/utils/apihelper.ts"
click node_login_helper "https://github.com/surajswamy20/playwright-framework/blob/main/utils/importExportLogin.ts/importExportLogin.ts"
click node_config "https://github.com/surajswamy20/playwright-framework/blob/main/playwright.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_e2e,node_api toneBlue
class node_login,node_learning_login,node_products,node_learning_products toneAmber
class node_fixtures,node_login_data,node_api_data,node_api_helper,node_login_helper,node_config,node_rest_api toneMint
class node_engineer,node_runner,node_saucedemo toneIndigo
```

## Components

### Test suites

- [Browser scenarios](https://github.com/surajswamy20/playwright-framework/tree/main/tests/e2e): `tests/e2e`
- [API scenarios](https://github.com/surajswamy20/playwright-framework/tree/main/tests/api): `tests/api`

### Page objects

- [Login pages](https://github.com/surajswamy20/playwright-framework/blob/main/pages/LoginPage.ts): `pages/LoginPage.ts`
- [Learning login](https://github.com/surajswamy20/playwright-framework/blob/main/pages/LearningLoginPage.ts): `pages/LearningLoginPage.ts`
- [Product pages](https://github.com/surajswamy20/playwright-framework/blob/main/pages/productPage.ts): `pages/productPage.ts`
- [Learning products](https://github.com/surajswamy20/playwright-framework/blob/main/pages/LearningProductsPage.ts): `pages/LearningProductsPage.ts`

### Test support

- [Test fixtures](https://github.com/surajswamy20/playwright-framework/tree/main/fixtures): `fixtures`
- [Login data](https://github.com/surajswamy20/playwright-framework/blob/main/data/loginData.ts): `data/loginData.ts`
- [API test data](https://github.com/surajswamy20/playwright-framework/blob/main/data/apiTestData.ts): `data/apiTestData.ts`
- [API requests](https://github.com/surajswamy20/playwright-framework/blob/main/utils/apihelper.ts): `utils/apihelper.ts`
- [Login helper](https://github.com/surajswamy20/playwright-framework/blob/main/utils/importExportLogin.ts/importExportLogin.ts): `utils/importExportLogin.ts/importExportLogin.ts`
- [Runner config](https://github.com/surajswamy20/playwright-framework/blob/main/playwright.config.ts): `playwright.config.ts`

### Other components

- **Test author**
- **Playwright runner**
- **Sauce Demo**
- **Objects API**

## Connections

- Test author → Playwright runner: runs tests
- Playwright runner → Browser scenarios: executes suites
- Playwright runner → API scenarios: executes suites
- Learning login → Sauce Demo: opens site (evidence: `pages/LearningLoginPage.ts`)
- Login pages → Sauce Demo: opens site (evidence: `pages/LoginPage.ts`)
- Runner config → Sauce Demo: sets base URL (evidence: `playwright.config.ts`)
- API requests → Objects API: sends requests (evidence: `utils/apihelper.ts`)
