Skip to content

Commit 2ee4b41

Browse files
committed
Improve demo-mode on mobile device tests
1 parent 53c3002 commit 2ee4b41

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

seleniumbase/fixtures/js_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import requests
77
import time
88
from selenium.common.exceptions import WebDriverException
9+
from seleniumbase import config as sb_config
910
from seleniumbase.common import decorators
1011
from seleniumbase.config import settings
1112
from seleniumbase.core import style_sheet
@@ -542,7 +543,12 @@ def post_messenger_success_message(driver, message, msg_dur):
542543
msg_dur = settings.DEFAULT_MESSAGE_DURATION
543544
msg_dur = float(msg_dur)
544545
try:
545-
set_messenger_theme(driver, theme="future", location="bottom_right")
546+
theme = "future"
547+
location = "bottom_right"
548+
if sb_config.mobile_emulator:
549+
theme = "block"
550+
location = "top_center"
551+
set_messenger_theme(driver, theme=theme, location=location)
546552
post_message(
547553
driver, message, msg_dur, style="success")
548554
time.sleep(msg_dur + 0.07)

0 commit comments

Comments
 (0)