@@ -8528,6 +8528,8 @@ def post_message(self, message, duration=None, pause=True, style="info"):
8528
8528
duration = settings .DEFAULT_MESSAGE_DURATION
8529
8529
else :
8530
8530
duration = self .message_duration
8531
+ if (self .headless or self .xvfb ) and float (duration ) > 0.75 :
8532
+ duration = 0.75
8531
8533
try :
8532
8534
js_utils .post_message (self .driver , message , duration , style = style )
8533
8535
except Exception :
@@ -8562,6 +8564,8 @@ def post_success_message(self, message, duration=None, pause=True):
8562
8564
duration = settings .DEFAULT_MESSAGE_DURATION
8563
8565
else :
8564
8566
duration = self .message_duration
8567
+ if (self .headless or self .xvfb ) and float (duration ) > 0.75 :
8568
+ duration = 0.75
8565
8569
try :
8566
8570
js_utils .post_message (
8567
8571
self .driver , message , duration , style = "success"
@@ -8586,6 +8590,8 @@ def post_error_message(self, message, duration=None, pause=True):
8586
8590
duration = settings .DEFAULT_MESSAGE_DURATION
8587
8591
else :
8588
8592
duration = self .message_duration
8593
+ if (self .headless or self .xvfb ) and float (duration ) > 0.75 :
8594
+ duration = 0.75
8589
8595
try :
8590
8596
js_utils .post_message (
8591
8597
self .driver , message , duration , style = "error"
@@ -10406,13 +10412,23 @@ def __highlight_with_assert_success(
10406
10412
time .sleep (0.065 )
10407
10413
10408
10414
def __highlight_with_js_2 (self , message , selector , o_bs ):
10415
+ duration = self .message_duration
10416
+ if not duration :
10417
+ duration = settings .DEFAULT_MESSAGE_DURATION
10418
+ if (self .headless or self .xvfb ) and float (duration ) > 0.75 :
10419
+ duration = 0.75
10409
10420
js_utils .highlight_with_js_2 (
10410
- self .driver , message , selector , o_bs , self . message_duration
10421
+ self .driver , message , selector , o_bs , duration
10411
10422
)
10412
10423
10413
10424
def __highlight_with_jquery_2 (self , message , selector , o_bs ):
10425
+ duration = self .message_duration
10426
+ if not duration :
10427
+ duration = settings .DEFAULT_MESSAGE_DURATION
10428
+ if (self .headless or self .xvfb ) and float (duration ) > 0.75 :
10429
+ duration = 0.75
10414
10430
js_utils .highlight_with_jquery_2 (
10415
- self .driver , message , selector , o_bs , self . message_duration
10431
+ self .driver , message , selector , o_bs , duration
10416
10432
)
10417
10433
10418
10434
############
0 commit comments