Skip to content
Snippets Groups Projects
Commit ad052e83 authored by admin's avatar admin
Browse files

update conftest.py

parent 8d418bee
No related branches found
No related tags found
No related merge requests found
Pipeline #111039 failed
import pytest
from datetime import datetime
import allure
import os
from selenium import webdriver
host = os.environ.get('MAIN_HOST')
port = os.environ.get('MAIN_PORT')
@pytest.fixture(scope='function')
def driver():
options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Remote(
command_executor=f'http://{host}:4444/wd/hub', options=options)
command_executor=f'http://{host}:{port}/wd/hub', options=options)
driver.maximize_window()
yield driver
attach = driver.get_screenshot_as_png()
allure.attach(attach, name=f"Screenshot {datetime.today()}", attachment_type=allure.attachment_type.PNG)
driver.quit()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment