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)

graph LR getChromiumExecutablePath["getChromiumExecutablePath"] collectAndSaveCoverage["collectAndSaveCoverage"] getChromiumExecutablePath -->|calls| getChromiumExecutablePath getChromiumExecutablePath -->|calls| collectAndSaveCoverage style getChromiumExecutablePath fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getChromiumExecutablePath "cf77c1808ae2925d.html" click collectAndSaveCoverage "ade0cf5b946e9936.html"

Impact (Incoming)

graph LR getChromiumExecutablePath["getChromiumExecutablePath"] getChromiumExecutablePath -->|calls| getChromiumExecutablePath style getChromiumExecutablePath fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getChromiumExecutablePath "cf77c1808ae2925d.html"
SourceType
getChromiumExecutablePath calls