from selenium.webdriver import Remote
import pytest
from selenium.webdriver.chrome.options import Options
@pytest.fixture(scope='class')
def selenium(pytestconfig):
options = Options()
options.add_argument("--window-size=1920,1080")
options.page_load_strategy = 'normal'
with step('Запуск браузера'):
driver = Remote(
desired_capabilities={
"browserName": pytestconfig.getini("browser_name"),
"browserVersion": pytestconfig.getini("browser_version")
},
command_executor=pytestconfig.getini("selenium_url"),
options=options
)
driver.implicitly_wait(30)
yield driver
driver.quit()