Module: Panda::Core::Testing::Support::System::ChromePath

Defined in:
lib/panda/core/testing/support/system/chrome_path.rb

Class Method Summary collapse

Class Method Details

.resolveObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/panda/core/testing/support/system/chrome_path.rb', line 9

def self.resolve
  @resolved ||= begin
    candidates = [
      # Linux (Debian/Ubuntu + your CI image)
      "/usr/bin/chromium",
      "/usr/bin/chromium-browser",
      "/usr/bin/google-chrome",
      "/opt/google/chrome/google-chrome",
      "/opt/google/chrome/chrome",

      # macOS Homebrew paths (Chromium)
      "/opt/homebrew/bin/chromium",
      "/usr/local/bin/chromium",

      # macOS Google Chrome
      "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
      "/Applications/Chromium.app/Contents/MacOS/Chromium",
      "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
    ]

    candidates.find { |path| File.executable?(path) } ||
      raise("Could not find a Chrome/Chromium binary on this system")
  end
end