Skip to content

Commit 1a4e2d0

Browse files
committed
Add visit() method and add optional click delay
1 parent 55c76fa commit 1a4e2d0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ def open(self, url):
9090
self.__demo_mode_pause_if_active()
9191

9292
def open_url(self, url):
93-
""" In case people are mixing up self.open() with open(),
94-
use this alternative. """
93+
""" Same as open() """
94+
self.open(url)
95+
96+
def visit(self, url):
97+
""" Same as open() """
9598
self.open(url)
9699

97100
def click(self, selector, by=By.CSS_SELECTOR,
98-
timeout=settings.SMALL_TIMEOUT):
101+
timeout=settings.SMALL_TIMEOUT, delay=0):
99102
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
100103
timeout = self.__get_new_timeout(timeout)
101104
if page_utils.is_xpath_selector(selector):
@@ -113,6 +116,8 @@ def click(self, selector, by=By.CSS_SELECTOR,
113116
if not self.demo_mode:
114117
self.__scroll_to_element(element)
115118
pre_action_url = self.driver.current_url
119+
if delay and delay > 0:
120+
time.sleep(delay)
116121
try:
117122
if self.browser == 'ie' and by == By.LINK_TEXT:
118123
# An issue with clicking Link Text on IE means using jquery

0 commit comments

Comments
 (0)