from selenium.webdriver.remote.webdriver import WebDriver

from homework_zfh.test_frame.handle_black import handle_black


class BasePage:
    def __init__(self, driver: WebDriver = None):
        self.driver = driver

    @handle_black
    def find(self, locator):
        return self.driver.find_element(*locator)

    def find_and_click(self, locator):
        self.find(locator).click()

    def send(self, locator, content):
        self.find(locator).send_keys(content)
