Skip to content

Commit f11d155

Browse files
committed
Better error-handling
1 parent ce80e42 commit f11d155

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3185,7 +3185,10 @@ def wait_for_angularjs(self, timeout=None, **kwargs):
31853185

31863186
def sleep(self, seconds):
31873187
self.__check_scope()
3188-
if not sb_config.time_limit:
3188+
if (
3189+
not hasattr(sb_config, "time_limit")
3190+
or (hasattr(sb_config, "time_limit") and not sb_config.time_limit)
3191+
):
31893192
time.sleep(seconds)
31903193
elif seconds < 0.4:
31913194
shared_utils.check_if_time_limit_exceeded()

seleniumbase/fixtures/js_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def set_messenger_theme(
599599
theme = "flat"
600600
if location == "default":
601601
location = "bottom_right"
602-
if sb_config.mobile_emulator:
602+
if hasattr(sb_config, "mobile_emulator") and sb_config.mobile_emulator:
603603
location = "top_center"
604604
if max_messages == "default":
605605
max_messages = "8"
@@ -682,7 +682,7 @@ def post_messenger_success_message(driver, message, msg_dur):
682682
try:
683683
theme = "flat"
684684
location = "bottom_right"
685-
if sb_config.mobile_emulator:
685+
if hasattr(sb_config, "mobile_emulator") and sb_config.mobile_emulator:
686686
location = "top_center"
687687
set_messenger_theme(driver, theme=theme, location=location)
688688
post_message(driver, message, msg_dur, style="success")

0 commit comments

Comments
 (0)