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
+3 -3
View File
@@ -21,14 +21,14 @@ class TestExample(TestCase):
def action(): def action():
time.sleep(2) 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) 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") self.driver.get("https://s57.ivazh.ru/styles/r14/#12.13/71.2832/72.13405")
def action(): def action():
time.sleep(2) 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)
+1
View File
@@ -1,6 +1,7 @@
"""Screenshot TestCase.""" """Screenshot TestCase."""
import logging import logging
import os.path
import time import time
from typing import Tuple from typing import Tuple
from urllib.parse import urlparse from urllib.parse import urlparse