# angular/protractor architecture

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

- Interactive diagram: https://gitdiagram.com/angular/protractor
- Repository: https://github.com/angular/protractor

## Overview

Protractor is a Node.js end-to-end testing framework for Angular and AngularJS applications. Test authors define specs and configuration; Protractor loads and schedules test runs, creates WebDriver sessions, and exposes browser, element, locator, and wait-condition APIs for interacting with the application in a real browser. Angular-specific client scripts support synchronization and Angular-aware queries. The README documents browser-based test execution; the supplied source excerpts do not show the complete runner-to-framework call chain, so those links are marked unverified.

Main entry points: [`lib/browser.ts`](https://github.com/angular/protractor/blob/master/lib/browser.ts) (Browser API), [`lib/config.ts`](https://github.com/angular/protractor/blob/master/lib/config.ts) (Run configuration), [`lib/runner.ts`](https://github.com/angular/protractor/blob/master/lib/runner.ts) (Test runner), [`lib/taskScheduler.ts`](https://github.com/angular/protractor/blob/master/lib/taskScheduler.ts) (Task scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Test entry"]
  node_test_specs["Test specs"]
  node_cli["CLI<br/>[cli.ts]"]
end

subgraph group_execution["Run coordination"]
  node_config["Run configuration<br/>[config.ts]"]
  node_config_parser["Config parser<br/>[configParser.ts]"]
  node_runner["Test runner<br/>[runner.ts]"]
  node_scheduler["Task scheduler<br/>[taskScheduler.ts]"]
  node_frameworks["Test frameworks"]
  node_plugins["Plugin hooks<br/>[plugins.ts]"]
end

subgraph group_webdriver["Browser control"]
  node_providers["Driver selection<br/>[index.ts]"]
  node_driver_provider["Driver provider<br/>[driverProvider.ts]"]
  node_webdriver["WebDriver<br/>[webdriver.js]"]
  node_browser["Browser API<br/>[browser.ts]"]
  node_elements["Element API<br/>[element.ts]"]
  node_locators["Locators<br/>[locators.ts]"]
  node_conditions["Wait conditions"]
end

subgraph group_angular["Angular support"]
  node_client_scripts["Angular client scripts"]
end

node_author(("Test author"))
node_application["Application under test"]
node_selenium(("Selenium service"))

node_author -->|"writes"| node_test_specs
node_author -->|"configures"| node_config
node_cli -.->|"loads config"| node_config_parser
node_config_parser -->|"builds config"| node_config
node_runner -.->|"schedules tasks"| node_scheduler
node_runner -.->|"runs specs"| node_frameworks
node_runner -.->|"selects driver"| node_providers
node_providers -->|"builds provider"| node_driver_provider
node_providers -->|"reads settings"| node_config
node_scheduler -->|"uses config parser"| node_config_parser
node_scheduler -->|"uses config"| node_config
node_config -->|"types plugin config"| node_plugins
node_webdriver -->|"connects to"| node_selenium
node_driver_provider -.->|"creates sessions"| node_selenium
node_browser -->|"uses"| node_elements
node_browser -->|"uses"| node_locators
node_browser -->|"uses"| node_conditions
node_browser -->|"executes scripts"| node_client_scripts
node_test_specs -->|"interacts through"| node_browser
node_browser -->|"drives browser"| node_application
node_client_scripts -->|"checks Angular hooks"| node_application

click node_test_specs "https://github.com/angular/protractor/tree/master/spec"
click node_cli "https://github.com/angular/protractor/blob/master/lib/cli.ts"
click node_config "https://github.com/angular/protractor/blob/master/lib/config.ts"
click node_config_parser "https://github.com/angular/protractor/blob/master/lib/configParser.ts"
click node_runner "https://github.com/angular/protractor/blob/master/lib/runner.ts"
click node_scheduler "https://github.com/angular/protractor/blob/master/lib/taskScheduler.ts"
click node_frameworks "https://github.com/angular/protractor/tree/master/lib/frameworks"
click node_plugins "https://github.com/angular/protractor/blob/master/lib/plugins.ts"
click node_providers "https://github.com/angular/protractor/blob/master/lib/driverProviders/index.ts"
click node_driver_provider "https://github.com/angular/protractor/blob/master/lib/driverProviders/driverProvider.ts"
click node_webdriver "https://github.com/angular/protractor/blob/master/lib/selenium-webdriver/webdriver.js"
click node_browser "https://github.com/angular/protractor/blob/master/lib/browser.ts"
click node_elements "https://github.com/angular/protractor/blob/master/lib/element.ts"
click node_locators "https://github.com/angular/protractor/blob/master/lib/locators.ts"
click node_conditions "https://github.com/angular/protractor/blob/master/lib/expectedConditions.ts"
click node_client_scripts "https://github.com/angular/protractor/blob/master/lib/clientsidescripts.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_test_specs,node_cli toneBlue
class node_config,node_config_parser,node_runner,node_scheduler,node_frameworks,node_plugins toneAmber
class node_providers,node_driver_provider,node_webdriver,node_browser,node_elements,node_locators,node_conditions toneMint
class node_client_scripts toneRose
class node_author,node_application,node_selenium toneIndigo
```

## Components

### Test entry

- [Test specs](https://github.com/angular/protractor/tree/master/spec): `spec`
- [CLI](https://github.com/angular/protractor/blob/master/lib/cli.ts): `lib/cli.ts`

### Run coordination

- [Run configuration](https://github.com/angular/protractor/blob/master/lib/config.ts): `lib/config.ts`
- [Config parser](https://github.com/angular/protractor/blob/master/lib/configParser.ts): `lib/configParser.ts`
- [Test runner](https://github.com/angular/protractor/blob/master/lib/runner.ts): `lib/runner.ts`
- [Task scheduler](https://github.com/angular/protractor/blob/master/lib/taskScheduler.ts): `lib/taskScheduler.ts`
- [Test frameworks](https://github.com/angular/protractor/tree/master/lib/frameworks): `lib/frameworks`
- [Plugin hooks](https://github.com/angular/protractor/blob/master/lib/plugins.ts): `lib/plugins.ts`

### Browser control

- [Driver selection](https://github.com/angular/protractor/blob/master/lib/driverProviders/index.ts): `lib/driverProviders/index.ts`
- [Driver provider](https://github.com/angular/protractor/blob/master/lib/driverProviders/driverProvider.ts): `lib/driverProviders/driverProvider.ts`
- [WebDriver](https://github.com/angular/protractor/blob/master/lib/selenium-webdriver/webdriver.js): `lib/selenium-webdriver/webdriver.js`
- [Browser API](https://github.com/angular/protractor/blob/master/lib/browser.ts): `lib/browser.ts`
- [Element API](https://github.com/angular/protractor/blob/master/lib/element.ts): `lib/element.ts`
- [Locators](https://github.com/angular/protractor/blob/master/lib/locators.ts): `lib/locators.ts`
- [Wait conditions](https://github.com/angular/protractor/blob/master/lib/expectedConditions.ts): `lib/expectedConditions.ts`

### Angular support

- [Angular client scripts](https://github.com/angular/protractor/blob/master/lib/clientsidescripts.js): `lib/clientsidescripts.js`

### Other components

- **Test author**
- **Application under test**
- **Selenium service**

## Connections

- Test author → Test specs: writes (evidence: `README.md`)
- Test author → Run configuration: configures (evidence: `lib/config.ts`)
- CLI → Config parser: loads config
- Config parser → Run configuration: builds config (evidence: `lib/configParser.ts`)
- Test runner → Task scheduler: schedules tasks
- Test runner → Test frameworks: runs specs
- Test runner → Driver selection: selects driver
- Driver selection → Driver provider: builds provider (evidence: `lib/driverProviders/index.ts`)
- Driver selection → Run configuration: reads settings (evidence: `lib/driverProviders/index.ts`)
- Task scheduler → Config parser: uses config parser (evidence: `lib/taskScheduler.ts`)
- Task scheduler → Run configuration: uses config (evidence: `lib/taskScheduler.ts`)
- Run configuration → Plugin hooks: types plugin config (evidence: `lib/config.ts`)
- WebDriver → Selenium service: connects to (evidence: `README.md`)
- Driver provider → Selenium service: creates sessions
- Browser API → Element API: uses (evidence: `lib/browser.ts`)
- Browser API → Locators: uses (evidence: `lib/browser.ts`)
- Browser API → Wait conditions: uses (evidence: `lib/browser.ts`)
- Browser API → Angular client scripts: executes scripts (evidence: `lib/browser.ts`)
- Test specs → Browser API: interacts through (evidence: `README.md`)
- Browser API → Application under test: drives browser (evidence: `README.md`)
- Angular client scripts → Application under test: checks Angular hooks (evidence: `lib/clientsidescripts.js`)
