make screenshots

This commit is contained in:
Ivan Vazhenin
2022-09-28 12:55:33 +03:00
parent 7c8a859f5e
commit 25a79ed807
3 changed files with 17 additions and 25 deletions

View File

@@ -2,7 +2,6 @@ import pytest
import logging
import allure
from selenium.webdriver import Chrome, ChromeOptions
from webdriver_manager.chrome import ChromeDriverManager
class Config:
@@ -14,8 +13,8 @@ class Config:
def driver():
options = ChromeOptions()
options.add_argument("--headless")
webdriver = Chrome(ChromeDriverManager().install(), desired_capabilities=options.to_capabilities())
webdriver.implicitly_wait(5)
webdriver = Chrome('/home/ashatora/yandexdriver', options=options)
webdriver.implicitly_wait(2)
yield webdriver
allure.attach(webdriver.current_url, "last url", allure.attachment_type.URI_LIST)
webdriver.quit()
@@ -24,13 +23,13 @@ def driver():
def pytest_addoption(parser):
"""Command line parser."""
parser.addoption(f'--{Config.BASE_URL}',
default='https://go.mail.ru/',
default='https://s57.ivazh.ru/styles/r14/#12.13/71.2832/72.13405',
dest=Config.BASE_URL,
action='store',
metavar='str',
help='Environment for run tests.')
parser.addoption(f'--{Config.STAGING}',
default='go.mail.ru',
default='s57.ivazh.ru',
dest=Config.STAGING,
action='store',
metavar='str',