diff --git a/screenshot_tests/tests/simple_test.py b/screenshot_tests/tests/simple_test.py index 8eb6eac..ef452a2 100644 --- a/screenshot_tests/tests/simple_test.py +++ b/screenshot_tests/tests/simple_test.py @@ -21,14 +21,14 @@ class TestExample(TestCase): def action(): time.sleep(2) - self.check_by_screenshot_file(None, screenshot_path=f'test_search_block.png', + self.check_by_screenshot_file(None, screenshot_path=f'{os.path.dirname(__file__)}/test_search_block.png', full_page=True, action=action) - def test_save_screenshot(self): + def save_screenshot(self): self.driver.get("https://s57.ivazh.ru/styles/r14/#12.13/71.2832/72.13405") def action(): time.sleep(2) - self.save_screenshot('test_search_block.png', full_page=True, action=action) + self.save_screenshot(f'{os.path.dirname(__file__)}/test_search_block.png', full_page=True, action=action) diff --git a/screenshot_tests/utils/screenshots.py b/screenshot_tests/utils/screenshots.py index 72abd75..bbccc11 100644 --- a/screenshot_tests/utils/screenshots.py +++ b/screenshot_tests/utils/screenshots.py @@ -1,6 +1,7 @@ """Screenshot TestCase.""" import logging +import os.path import time from typing import Tuple from urllib.parse import urlparse