-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: greg pereira <[email protected]>
- Loading branch information
1 parent
dd4cf14
commit e2982c4
Showing
1 changed file
with
23 additions
and
3 deletions.
There are no files selected for viewing
26 changes: 23 additions & 3 deletions
26
recipes/natural_language_processing/chatbot/tests/conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |