Skip to content
conftest.py 397 B
Newer Older
admin's avatar
admin committed
import pytest
admin's avatar
admin committed
import os
admin's avatar
admin committed
from selenium import webdriver

admin's avatar
admin committed
host = os.environ.get('MAIN_HOST')

admin's avatar
admin committed
@pytest.fixture(scope='function')
def driver():
    options = webdriver.ChromeOptions()
admin's avatar
admin committed
    options.add_argument('--headless')
    driver = webdriver.Remote(
admin's avatar
admin committed
    command_executor=f'http://{host}:4444/wd/hub', options=options)
admin's avatar
admin committed
    driver.maximize_window()
    yield driver
    driver.quit()