Skip to content

Commit d964f0b

Browse files
committed
Change default timeout for some base_case.py methods.
1 parent 0a24b84 commit d964f0b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ def get_image_url(self, selector, by=By.CSS_SELECTOR,
339339
attribute='src', by=by, timeout=timeout)
340340

341341
def add_text(self, selector, new_value, by=By.CSS_SELECTOR,
342-
timeout=settings.SMALL_TIMEOUT):
342+
timeout=settings.LARGE_TIMEOUT):
343343
""" The more-reliable version of driver.send_keys()
344344
Similar to update_text(), but won't clear the text field first. """
345-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
345+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
346346
timeout = self._get_new_timeout(timeout)
347347
if page_utils.is_xpath_selector(selector):
348348
by = By.XPATH
@@ -382,16 +382,16 @@ def add_text(self, selector, new_value, by=By.CSS_SELECTOR,
382382
self._demo_mode_pause_if_active(tiny=True)
383383

384384
def send_keys(self, selector, new_value, by=By.CSS_SELECTOR,
385-
timeout=settings.SMALL_TIMEOUT):
385+
timeout=settings.LARGE_TIMEOUT):
386386
""" Same as add_text() -> more reliable, but less name confusion. """
387-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
387+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
388388
timeout = self._get_new_timeout(timeout)
389389
if page_utils.is_xpath_selector(selector):
390390
by = By.XPATH
391391
self.add_text(selector, new_value, by=by, timeout=timeout)
392392

393393
def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
394-
timeout=settings.SMALL_TIMEOUT, retry=False):
394+
timeout=settings.LARGE_TIMEOUT, retry=False):
395395
""" This method updates an element's text value with a new value.
396396
@Params
397397
selector - the selector with the value to update
@@ -400,7 +400,7 @@ def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
400400
timeout - how long to wait for the selector to be visible
401401
retry - if True, use jquery if the selenium text update fails
402402
"""
403-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
403+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
404404
timeout = self._get_new_timeout(timeout)
405405
if page_utils.is_xpath_selector(selector):
406406
by = By.XPATH
@@ -456,11 +456,11 @@ def update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
456456
self._demo_mode_pause_if_active(tiny=True)
457457

458458
def update_text(self, selector, new_value, by=By.CSS_SELECTOR,
459-
timeout=settings.SMALL_TIMEOUT, retry=False):
459+
timeout=settings.LARGE_TIMEOUT, retry=False):
460460
""" The shorter version of update_text_value(), which
461461
clears existing text and adds new text into the text field.
462462
We want to keep the old version for backward compatibility. """
463-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
463+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
464464
timeout = self._get_new_timeout(timeout)
465465
if page_utils.is_xpath_selector(selector):
466466
by = By.XPATH
@@ -746,9 +746,9 @@ def convert_to_css_selector(self, selector, by):
746746
selector, by))
747747

748748
def set_value(self, selector, new_value, by=By.CSS_SELECTOR,
749-
timeout=settings.SMALL_TIMEOUT):
749+
timeout=settings.LARGE_TIMEOUT):
750750
""" This method uses jQuery to update a text field. """
751-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
751+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
752752
timeout = self._get_new_timeout(timeout)
753753
if page_utils.is_xpath_selector(selector):
754754
by = By.XPATH
@@ -772,12 +772,12 @@ def set_value(self, selector, new_value, by=By.CSS_SELECTOR,
772772
self._demo_mode_pause_if_active()
773773

774774
def jquery_update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
775-
timeout=settings.SMALL_TIMEOUT):
775+
timeout=settings.LARGE_TIMEOUT):
776776
""" This method uses jQuery to update a text field.
777777
If the new_value string ends with the newline character,
778778
WebDriver will finish the call, which simulates pressing
779779
{Enter/Return} after the text is entered. """
780-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
780+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
781781
timeout = self._get_new_timeout(timeout)
782782
if page_utils.is_xpath_selector(selector):
783783
by = By.XPATH
@@ -805,10 +805,10 @@ def jquery_update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
805805
self._demo_mode_pause_if_active()
806806

807807
def jquery_update_text(self, selector, new_value, by=By.CSS_SELECTOR,
808-
timeout=settings.SMALL_TIMEOUT):
808+
timeout=settings.LARGE_TIMEOUT):
809809
""" The shorter version of jquery_update_text_value()
810810
(The longer version remains for backwards compatibility.) """
811-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
811+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
812812
timeout = self._get_new_timeout(timeout)
813813
self.jquery_update_text_value(
814814
selector, new_value, by=by, timeout=timeout)
@@ -847,29 +847,29 @@ def hover_and_click(self, hover_selector, click_selector,
847847

848848
def pick_select_option_by_text(self, dropdown_selector, option,
849849
dropdown_by=By.CSS_SELECTOR,
850-
timeout=settings.SMALL_TIMEOUT):
850+
timeout=settings.LARGE_TIMEOUT):
851851
""" Picks an HTML <select> option by option text. """
852-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
852+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
853853
timeout = self._get_new_timeout(timeout)
854854
self._pick_select_option(dropdown_selector, option,
855855
dropdown_by=dropdown_by, option_by="text",
856856
timeout=timeout)
857857

858858
def pick_select_option_by_index(self, dropdown_selector, option,
859859
dropdown_by=By.CSS_SELECTOR,
860-
timeout=settings.SMALL_TIMEOUT):
860+
timeout=settings.LARGE_TIMEOUT):
861861
""" Picks an HTML <select> option by option index. """
862-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
862+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
863863
timeout = self._get_new_timeout(timeout)
864864
self._pick_select_option(dropdown_selector, option,
865865
dropdown_by=dropdown_by, option_by="index",
866866
timeout=timeout)
867867

868868
def pick_select_option_by_value(self, dropdown_selector, option,
869869
dropdown_by=By.CSS_SELECTOR,
870-
timeout=settings.SMALL_TIMEOUT):
870+
timeout=settings.LARGE_TIMEOUT):
871871
""" Picks an HTML <select> option by option value. """
872-
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
872+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
873873
timeout = self._get_new_timeout(timeout)
874874
self._pick_select_option(dropdown_selector, option,
875875
dropdown_by=dropdown_by, option_by="value",

0 commit comments

Comments
 (0)