Skip to content

Commit

Permalink
tries fixing jenkins CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Sep 20, 2023
1 parent 2756d84 commit 22d2012
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/browser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.core.driver_cache import DriverCacheManager

class SeleniumBrowsers:
"""
handle available selenium drivers/browsers
"""

def __init__(self, headless: bool = True, cache_valid_range=7):
def __init__(self, headless: bool = True):
"""
constructor
Args:
headless(bool): if True run in headless mode
cache_valid_range(int): the
"""
self.headless = headless
self.cache_valid_range = cache_valid_range
self.browsers = {}

def getFirst(self):
Expand Down Expand Up @@ -59,9 +56,8 @@ def _getFirefoxWebDriver(self) -> webdriver.Firefox:
"""
options = FirefoxOptions()
options.headless = self.headless
exe=GeckoDriverManager().install()
browser = webdriver.Firefox(executable_path=exe,options=options)
# browser = webdriver.Firefox(options=options)
exe = GeckoDriverManager().install()
browser = webdriver.Firefox(executable_path=exe, options=options)
return browser

def _getChromeWebDriver(self) -> webdriver.Chrome:
Expand All @@ -70,8 +66,8 @@ def _getChromeWebDriver(self) -> webdriver.Chrome:
"""
options = ChromeOptions()
options.headless = self.headless
cache_mgr=DriverCacheManager(valid_range=self.cache_valid_range)
chrome_executable = ChromeDriverManager(cache_manager=cache_mgr).install()
chrome_executable = ChromeDriverManager().install()
service = ChromeService(chrome_executable)
browser = webdriver.Chrome(service=service, options=options)
return browser

0 comments on commit 22d2012

Please sign in to comment.