make screenshots

This commit is contained in:
Ivan Vazhenin
2022-09-28 20:58:41 +03:00
parent 201b660077
commit 9f89600070
2 changed files with 4 additions and 3 deletions

View File

@@ -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)

View File

@@ -1,6 +1,7 @@
"""Screenshot TestCase."""
import logging
import os.path
import time
from typing import Tuple
from urllib.parse import urlparse