Deprecate scroll_click() because click() already scrolls before clicking

This commit is contained in:
Michael Mintz 2019-02-02 02:02:32 -05:00
parent c75e9a38e2
commit 552c545540
1 changed files with 4 additions and 1 deletions

View File

@ -1438,12 +1438,15 @@ class BaseCase(unittest.TestCase):
selector, by=by, timeout=timeout) selector, by=by, timeout=timeout)
self.__slow_scroll_to_element(element) self.__slow_scroll_to_element(element)
@decorators.deprecated("Use self.click() - It now scrolls before clicking")
def scroll_click(self, selector, by=By.CSS_SELECTOR): def scroll_click(self, selector, by=By.CSS_SELECTOR):
# DEPRECATED - self.click() now scrolls to the element before clicking # DEPRECATED - self.click() now scrolls to the element before clicking
# self.scroll_to(selector, by=by) # self.scroll_to(selector, by=by) # Redundant
self.click(selector, by=by) self.click(selector, by=by)
def click_xpath(self, xpath): def click_xpath(self, xpath):
# Technically self.click() will automatically detect an xpath selector,
# so self.click_xpath() is just a longer name for the same action.
self.click(xpath, by=By.XPATH) self.click(xpath, by=By.XPATH)
def js_click(self, selector, by=By.CSS_SELECTOR): def js_click(self, selector, by=By.CSS_SELECTOR):