getChromiumExecutablePath function test
Last updated: 2026-03-01T23:25:47.056Z
Metrics
LOC: 9
Complexity: 3
Params: 0
Signature
getChromiumExecutablePath(): : string
Summary
Returns the Chrome for Testing executable path (bundled by Playwright) for use with launchPersistentContext. Regular stable Chrome ignores --load-extension unless Developer Mode is already enabled in the profile, so we always prefer Chrome for Testing (which has no such restriction). The CHROME_PATH env var can be used to override for exotic CI setups.
Source Code
function getChromiumExecutablePath(): string {
if (process.env.CHROME_PATH) return process.env.CHROME_PATH;
// chromium.executablePath() resolves the Playwright-bundled Chrome for Testing
try {
return chromium.executablePath();
} catch {
return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
}
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| getChromiumExecutablePath | calls |
| collectAndSaveCoverage | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| getChromiumExecutablePath | calls |