def search_movie(self, value): """ :type value: unicode """ elem = find_element(self._driver, HomePageLocators.SEARCH_MOVIE_LOCATOR) elem.clear() elem.send_keys(value) elem.send_keys(Keys.ENTER)
def movie_is_not_found(self): elem = find_element(self._driver, HomePageLocators.NOT_FOUND_MESSAGE_LOCATOR) return elem.text == HomePageLocators.NOT_FOUND_MESSAGE_CONTENT
def click_login_button(self): elem = find_element(self._driver, AuthPageLocators.LOGIN_BUTTON_LOCATOR) elem.click() from pages.home import HomePage return HomePage(self._driver)
def _is_element_present(self, locator): try: find_element(self._driver, locator) except TimeoutException: return False return True
def _click(self, locator): find_element(self._driver, locator).click()
def __get__(self, obj, owner): """Получает значение элемента""" element = find_element(obj._driver, self.locator) return element.text
def set(self, obj, value): element = find_element(obj._driver, self.locator) element.clear() element.send_keys(value)