Skip to content

Commit

Permalink
enabling tests on darwin
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed Apr 10, 2024
1 parent dd4cf14 commit e2982c4
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions recipes/natural_language_processing/chatbot/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
import pytest
from selenium import webdriver
import platform
import os

if not os.environ["CHROMEDRIVER_PATH"]:
CHROMEDRIVER_PATH="../../chromedriver"

@pytest.fixture
def chrome_options(chrome_options):
if platform.system() == "Darwin":
CHROME_PATH="../../Google\ Chrome.app"

CHROMEDRIVER_PATH_ABS=os.path.abspath(CHROMEDRIVER_PATH)

@pytest.fixture(scope="module")
def chrome_driver(request):
chromedriver_path = '/path/to/chromedriver'
chrome_path = '/path/to/chrome'

chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = chrome_path
driver = webdriver.Chrome(executable_path=chromedriver_path, options=chrome_options)
chrome_options.add_argument("--headless")
return chrome_options
def teardown():
driver.quit()

request.addfinalizer(teardown)
return driver

0 comments on commit e2982c4

Please sign in to comment.