Add "locator()" as a shortcut for "get_element()"
This commit is contained in:
parent
eea244127c
commit
edf0fce6e7
|
@ -744,6 +744,7 @@ self.generate_traffic_chain(pages, loops=1)
|
|||
|
||||
self.get_element(selector, by="css selector", timeout=None)
|
||||
# Duplicates:
|
||||
# self.locator(selector, by="css selector", timeout=None)
|
||||
# self.wait_for_element_present(selector, by="css selector", timeout=None)
|
||||
|
||||
self.wait_for_query_selector(selector, by="css selector", timeout=None)
|
||||
|
|
|
@ -8898,12 +8898,11 @@ class BaseCase(unittest.TestCase):
|
|||
def get_element(self, selector, by="css selector", timeout=None):
|
||||
"""Same as wait_for_element_present() - returns the element.
|
||||
The element does not need be visible (it may be hidden)."""
|
||||
self.__check_scope()
|
||||
if not timeout:
|
||||
timeout = settings.LARGE_TIMEOUT
|
||||
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
|
||||
timeout = self.__get_new_timeout(timeout)
|
||||
selector, by = self.__recalculate_selector(selector, by)
|
||||
return self.wait_for_element_present(selector, by=by, timeout=timeout)
|
||||
|
||||
def locator(self, selector, by="css selector", timeout=None):
|
||||
"""Same as wait_for_element_present() - returns the element.
|
||||
The element does not need be visible (it may be hidden)."""
|
||||
return self.wait_for_element_present(selector, by=by, timeout=timeout)
|
||||
|
||||
def wait_for_query_selector(
|
||||
|
@ -9000,11 +8999,6 @@ class BaseCase(unittest.TestCase):
|
|||
|
||||
def find_element(self, selector, by="css selector", timeout=None):
|
||||
"""Same as wait_for_element_visible() - returns the element"""
|
||||
self.__check_scope()
|
||||
if not timeout:
|
||||
timeout = settings.LARGE_TIMEOUT
|
||||
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
|
||||
timeout = self.__get_new_timeout(timeout)
|
||||
return self.wait_for_element_visible(selector, by=by, timeout=timeout)
|
||||
|
||||
def assert_element(self, selector, by="css selector", timeout=None):
|
||||
|
|
Loading…
Reference in New Issue