Skip to content

Commit 57d7ad7

Browse files
committed
fix: revert to using chrome for mac tests
1 parent 127086f commit 57d7ad7

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

sample/Tests/test/test_mac.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def tearDownClass(cls):
4040
def launch_browser(cls):
4141
print("Starting Browser...")
4242
browser_paths = [
43-
"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
43+
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
4444
]
4545

4646
browser_path = None
@@ -50,7 +50,7 @@ def launch_browser(cls):
5050
break
5151

5252
if not browser_path:
53-
print("Brave executable not found.")
53+
print("Chrome executable not found.")
5454
exit(1)
5555

5656
subprocess.Popen([
@@ -62,29 +62,29 @@ def launch_browser(cls):
6262

6363
@classmethod
6464
def stop_browser(cls):
65-
print("Stopping Brave...")
65+
print("Stopping Chrome...")
6666
try:
6767
# First try graceful shutdown using AppleScript
6868
subprocess.run([
6969
"osascript", "-e",
70-
'tell application "Brave Browser" to quit'
70+
'tell application "Google Chrome" to quit'
7171
], check=False, capture_output=True)
7272
time.sleep(2)
7373

7474
# Check if still running, then force kill
75-
result = subprocess.run(["pgrep", "-f", "Brave Browser"],
75+
result = subprocess.run(["pgrep", "-f", "Google Chrome"],
7676
capture_output=True, text=True)
7777
if result.returncode == 0:
7878
# Still running, force kill
79-
subprocess.run(["pkill", "-f", "Brave Browser"],
79+
subprocess.run(["pkill", "-f", "Google Chrome"],
8080
check=False, capture_output=True)
8181

82-
print("All Brave processes have been closed.")
82+
print("All Chrome processes have been closed.")
8383
except Exception as e:
84-
print("Brave might not be running.")
84+
print("Chrome might not be running.")
8585

8686
time.sleep(3)
87-
print("Stopped Brave")
87+
print("Stopped Chrome")
8888

8989
@classmethod
9090
def login(cls):
@@ -97,20 +97,18 @@ def login(cls):
9797
from selenium.webdriver.chrome.service import Service
9898
chromedriver_path = "/usr/local/bin/chromedriver"
9999

100-
# Use Brave browser path (what CI actually uses)
101-
brave_path = "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
100+
# Use Chrome browser (company software ensures it's installed)
101+
chrome_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
102102

103103
import os
104104
browser_path = None
105-
if os.path.exists(brave_path):
106-
browser_path = brave_path
107-
print(f"Found browser at: {browser_path}")
105+
if os.path.exists(chrome_path):
106+
browser_path = chrome_path
107+
print(f"Found Chrome at: {browser_path}")
108+
else:
109+
print("Chrome not found, letting Selenium auto-detect")
108110

109-
if not browser_path:
110-
print("Browser not found at any expected path, letting Selenium auto-detect")
111-
browser_path = None
112-
113-
# Set browser as the binary if found
111+
# Set Chrome as the browser binary if found
114112
if browser_path:
115113
chrome_options.binary_location = browser_path
116114

0 commit comments

Comments
 (0)