Fix tests

This commit is contained in:
Ivan Vazhenin
2023-07-04 19:13:49 +03:00
parent bde3749cd4
commit cd1c20d054
3 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import pytest
import logging
import allure
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.chrome.service import Service
class Config:
@@ -13,7 +14,7 @@ class Config:
def driver():
options = ChromeOptions()
options.add_argument("--headless")
webdriver = Chrome('/home/ashatora/yandexdriver', options=options)
webdriver = Chrome(service=Service(executable_path='/home/ashatora/yandexdriver'), options=options)
webdriver.implicitly_wait(2)
yield webdriver
allure.attach(webdriver.current_url, "last url", allure.attachment_type.URI_LIST)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View File

@@ -246,7 +246,7 @@ class TestCase(common.TestCase):
def check_by_screenshot_file(self, element, *args, **kwargs):
diff, test_url = self._get_screenshot_diff(element, *args, **kwargs)
assert diff == 0, f"Элемент отличается на странице:\n{test_url.geturl()}\n"
assert diff == 0, f"Элемент отличается на странице:\n{test_url}\n"
def save_screenshot(self, screenshot_path, element=None, action=None, full_screen=True, full_page=False, finalize=None, scroll_and_screen=True):
if full_screen: