fix the binary pathing for chrome
Some checks failed
ChromeTests / build (3.12) (push) Failing after 1m0s
EdgeTests / build (3.12) (push) Successful in 1m8s
Pylint / build (3.12) (push) Successful in 12s

This commit is contained in:
Greg Gauthier 2024-07-23 22:52:24 +01:00
parent 2a3722b585
commit 5866721964

View File

@ -4,6 +4,7 @@ import platform
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.edge.options import Options as EdgeOptions from selenium.webdriver.edge.options import Options as EdgeOptions
from selenium.webdriver.edge.service import Service as EdgeService from selenium.webdriver.edge.service import Service as EdgeService
from selenium.webdriver.firefox.options import Options as FirefoxOptions from selenium.webdriver.firefox.options import Options as FirefoxOptions
@ -24,11 +25,15 @@ class BrowserDriver:
def chrome(headless=True): def chrome(headless=True):
chrome_path = os.path.join(CWD, 'chrome-linux64', 'chrome')
driver_path = os.path.join(CWD, 'driver', 'chromedriver')
options = ChromeOptions() options = ChromeOptions()
options.binary_location = chrome_path
if headless: if headless:
options.add_argument("--headless") options.add_argument("--headless")
options.add_argument('--ignore-certificate-errors') options.add_argument('--ignore-certificate-errors')
return webdriver.Chrome(options=options) chrome_service = ChromeService(executable_path=driver_path)
return webdriver.Chrome(service=chrome_service, options=options)
def firefox(headless=True): def firefox(headless=True):