Skip to content

Commit 2f0365a

Browse files
authored
Merge pull request #124 from seleniumbase/test-reliability
Test Reliability
2 parents f069c57 + 6c26634 commit 2f0365a

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

help_docs/method_summary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ self.scroll_to(selector, by=By.CSS_SELECTOR)
7575

7676
self.slow_scroll_to(selector, by=By.CSS_SELECTOR)
7777

78-
self.scroll_click(selector, by=By.CSS_SELECTOR)
78+
self.scroll_click(selector, by=By.CSS_SELECTOR) # DEPRECATED
7979

8080
self.click_xpath(xpath)
8181

seleniumbase/fixtures/base_case.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def click(self, selector, by=By.CSS_SELECTOR,
8989
element = page_actions.wait_for_element_visible(
9090
self.driver, selector, by, timeout=timeout)
9191
self._demo_mode_highlight_if_active(selector, by)
92+
if not self.demo_mode:
93+
self._scroll_to_element(element)
9294
pre_action_url = self.driver.current_url
9395
try:
9496
element.click()
@@ -115,6 +117,8 @@ def double_click(self, selector, by=By.CSS_SELECTOR,
115117
element = page_actions.wait_for_element_visible(
116118
self.driver, selector, by, timeout=timeout)
117119
self._demo_mode_highlight_if_active(selector, by)
120+
if not self.demo_mode:
121+
self._scroll_to_element(element)
118122
pre_action_url = self.driver.current_url
119123
try:
120124
actions = ActionChains(self.driver)
@@ -330,6 +334,8 @@ def add_text(self, selector, new_value, by=By.CSS_SELECTOR,
330334
element = self.wait_for_element_visible(
331335
selector, by=by, timeout=timeout)
332336
self._demo_mode_highlight_if_active(selector, by)
337+
if not self.demo_mode:
338+
self._scroll_to_element(element)
333339
pre_action_url = self.driver.current_url
334340
try:
335341
if not new_value.endswith('\n'):
@@ -381,6 +387,8 @@ def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
381387
element = self.wait_for_element_visible(
382388
selector, by=by, timeout=timeout)
383389
self._demo_mode_highlight_if_active(selector, by)
390+
if not self.demo_mode:
391+
self._scroll_to_element(element)
384392
try:
385393
element.clear()
386394
except StaleElementReferenceException:
@@ -590,6 +598,9 @@ def highlight(self, selector, by=By.CSS_SELECTOR,
590598
def scroll_to(self, selector, by=By.CSS_SELECTOR,
591599
timeout=settings.SMALL_TIMEOUT):
592600
''' Fast scroll to destination '''
601+
if self.demo_mode:
602+
self.slow_scroll_to(selector, by=by, timeout=timeout)
603+
return
593604
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
594605
timeout = self._get_new_timeout(timeout)
595606
element = self.wait_for_element_visible(
@@ -613,7 +624,8 @@ def slow_scroll_to(self, selector, by=By.CSS_SELECTOR,
613624
self._slow_scroll_to_element(element)
614625

615626
def scroll_click(self, selector, by=By.CSS_SELECTOR):
616-
self.scroll_to(selector, by=by)
627+
# DEPRECATED - self.click() now scrolls to the element before clicking
628+
# self.scroll_to(selector, by=by)
617629
self.click(selector, by=by)
618630

619631
def click_xpath(self, xpath):

server_setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='seleniumbase',
11-
version='1.4.6',
11+
version='1.4.7',
1212
description='Test Automation Framework - http://seleniumbase.com',
1313
long_description='Automation Framework for Simple & Reliable Web Testing',
1414
platforms='Mac * Windows * Linux * Docker',

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='seleniumbase',
10-
version='1.4.6',
10+
version='1.4.7',
1111
description='Test Automation Framework - http://seleniumbase.com',
1212
long_description='Automation Framework for Simple & Reliable Web Testing',
1313
platforms='Mac * Windows * Linux * Docker',

0 commit comments

Comments
 (0)