File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
2
from os import environ
3
+ from time import sleep
3
4
4
5
import pytest
5
6
from selenium .webdriver import Firefox
@@ -51,5 +52,13 @@ def test_allow_audio_video_functionality(driver: Firefox):
51
52
52
53
# Open test website and check the site is loaded and the featured video starts playing with sound
53
54
GenericPage (driver , url = TEST_URL ).open ()
54
- with driver .context (driver .CONTEXT_CHROME ):
55
- tabs .expect_tab_sound_status (1 , tabs .MEDIA_STATUS .PLAYING )
55
+ max_retries = 3
56
+ for attempt in range (max_retries ):
57
+ try :
58
+ with driver .context (driver .CONTEXT_CHROME ):
59
+ tabs .expect_tab_sound_status (1 , tabs .MEDIA_STATUS .PLAYING )
60
+ break # Success!
61
+ except AssertionError :
62
+ sleep (2 )
63
+ else :
64
+ pytest .fail (f"Tab sound status did not reach PLAYING after { max_retries } retries." )
You can’t perform that action at this time.
0 commit comments