Skip to content

Commit 127086f

Browse files
committed
fix: mac tests use brave as the browser
1 parent 63b1e9d commit 127086f

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

sample/Tests/test/test_mac.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,26 @@ def login(cls):
9797
from selenium.webdriver.chrome.service import Service
9898
chromedriver_path = "/usr/local/bin/chromedriver"
9999

100-
# Try multiple possible Chrome paths on macOS
101-
chrome_paths = [
102-
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
103-
"/System/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
104-
"/usr/bin/google-chrome",
105-
"/usr/local/bin/google-chrome"
106-
]
100+
# Use Brave browser path (what CI actually uses)
101+
brave_path = "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
107102

108103
import os
109-
chrome_path = None
110-
for path in chrome_paths:
111-
if os.path.exists(path):
112-
chrome_path = path
113-
print(f"Found Chrome at: {chrome_path}")
114-
break
115-
116-
if not chrome_path:
117-
print("Chrome not found at any expected path, letting Selenium auto-detect")
118-
chrome_path = None
104+
browser_path = None
105+
if os.path.exists(brave_path):
106+
browser_path = brave_path
107+
print(f"Found browser at: {browser_path}")
119108

120-
# Set Chrome as the browser binary if found
121-
if chrome_path:
122-
chrome_options.binary_location = chrome_path
109+
if not browser_path:
110+
print("Browser not found at any expected path, letting Selenium auto-detect")
111+
browser_path = None
123112

124-
# Create service with explicit ChromeDriver path
125-
service = Service(executable_path=chromedriver_path)
113+
# Set browser as the binary if found
114+
if browser_path:
115+
chrome_options.binary_location = browser_path
116+
117+
# Create service with explicit ChromeDriver path and bypass version checking
118+
service_args = ["--whitelisted-ips=", "--disable-build-check"]
119+
service = Service(executable_path=chromedriver_path, service_args=service_args)
126120

127121
# Connect to the existing Chrome instance
128122
cls.seleniumdriver = webdriver.Chrome(service=service, options=chrome_options)

0 commit comments

Comments
 (0)