import os

from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
from screenshot_tests.utils.screenshots import TestCase
import time


class TestExample(TestCase):
    # def test_main_page(self):
    #     self.driver.get("https://s57map.ivazh.ru/")
    #
    #     def action():
    #         time.sleep(2)
    #
    #     self.check_by_screenshot(None, full_page=True, action=action)

    # def test_mouse_move(self):
    #     self.driver.get("https://s57map.ivazh.ru/")
    #
    #     def action():
    #         time.sleep(2)
    #         a = ActionChains(self.driver)
    #         a.move_by_offset(100, 200)
    #         a.perform()
    #
    #     self.check_by_screenshot(None, full_page=True, action=action)

    def test_search_block(self):
        self.driver.get("https://s57test.ivazh.ru/")

        def action():
            time.sleep(2)

        self.check_by_screenshot_file(None, screenshot_path=f'{os.path.dirname(__file__)}/test_s57_style.png',
                                      full_page=True, action=action)

    def test_save_screenshot(self):
        self.driver.get("https://s57test.ivazh.ru/")

        def action():
            time.sleep(2)

        self.save_screenshot(f'{os.path.dirname(__file__)}/test_s57_style.png', full_page=True, action=action)

