CodeVetter · Repo Unpack · Behavior traces
microsoft/playwright
Four concrete flows were followed through source: test startup/execution, browser launch, locator click, and storage save/restore. The traces below preserve execution order and significant conditions. Error handling, force behavior, and reuse modes change these paths. They describe source behavior rather than observed runtime executions.
- Test startup: cli.js → program.parse → addTestCommand action → runTests → overridesFromOptions → loadConfigFromFile → filterProjects; arguments after '--' are removed from file filters.
- Ordinary test execution: runAllTestsWithConfig → createReporters/LastRunReporter → rebaseline/global-setup/load tasks → phase/report/run tasks → runTasks; list mode instead loads and reports without those execution tasks.
- Worker scheduling: createRunTestsTask checks dependencies → Dispatcher.run allocates slots and schedules → _createWorker constructs WorkerHost → WorkerHost.start creates artifacts and starts the runner; workers receive groups through runTestGroup messages.
- Browser launch: client BrowserType.launch normalizes args/env → channel.launch → BrowserTypeDispatcher.launch checks denyLaunch → server BrowserType.launch validates options and chooses Selenium or _innerLaunchWithRetries → _innerLaunch.
- Native launch continuation: _prepareToLaunch creates/selects directories and resolves the executable → _launchProcess calls launchProcess and waits for readiness → pipe/WebSocket transport → connectToTransport; persistent default-context preparation is skipped with ignoreAllDefaultArgs.
- Click: Locator.click delegates to its frame with strict:true → FrameDispatcher.click → server Frame.click → _retryWithProgressIfNotConnected → handle._click → _retryPointerAction → page.mouse.click; detached targets retry and force skips prechecks/visibility waits.
- Storage save: client storageState → BrowserContextDispatcher.storageState → server storageState → injected StorageScript.collect on live or temporary pages → channel result → optional mkdir/writeFile on the client.
- Storage replacement: prepareStorageState → channel.setStorageState → dispatcher calls server mode 'api' → cache/cookie cleanup → cookie/credential restore → intercepted origin navigation and StorageScript.restore → temporary-page close; resetForReuse retains the page and removes its interceptor.