CodeVetter · Repo Unpack · System map
microsoft/playwright
The repository separates browser automation, test orchestration, protocol definitions, and browser-facing interfaces into workspace packages. Local automation still crosses a client/dispatcher boundary before reaching browser implementations. Persistent state consists of browser profiles, browser installation caches, and explicit JSON/artifact files. The inspected deployment surfaces are Node packages, command-line programs, and optional browser-control servers.
- The private playwright-internal workspace is version 1.64.0-next, requires Node.js >=20, and includes packages/* as npm workspaces.
- The playwright package exports CommonJS/ESM library and test entrypoints, installs the playwright executable, and depends on the matching playwright-core version.
- packages/playwright/cli.js loads the compiled program and parses process.argv; program.ts decorates the shared library CLI before adding test-runner commands.
- createInProcessPlaywright wires Connection to DispatcherConnection, enables raw buffers, creates PlaywrightDispatcher, and switches from synchronous initialization to setImmediate message delivery.
- BrowserType launches native executables and selects WebSocketTransport or PipeTransport according to supportsPipeTransport.
- Test phases use Dispatcher to allocate worker slots; WorkerHost identifies the worker process entry and assigns a per-worker artifact directory.
- Browser installation storage honors PLAYWRIGHT_BROWSERS_PATH, including package-local mode '0'; installation locks the registry and records package links before optional cache cleanup.
- Root scripts define build/watch, combined linting, browser-specific tests, stable-runner tests, MCP tests, and platform-specific suites.