Skip to content

Commit f180e1f

Browse files
committed
Make that actually loop
1 parent 7d86a0c commit f180e1f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/tabs/test_mute_tabs.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import logging
12
from time import sleep
23

34
import pytest
5+
from selenium.common.exceptions import NoSuchElementException
46
from selenium.webdriver import Firefox
57
from selenium.webdriver.support import expected_conditions as EC
68

@@ -34,8 +36,15 @@ def test_mute_unmute_tab(screenshot, driver: Firefox, video_url: str):
3436
sound_status = False
3537
retries = 0
3638
while not sound_status and retries < RETRY_LIMIT:
37-
sound_status = tabs.expect_tab_sound_status(1, tabs.MEDIA_STATUS.PLAYING)
39+
try:
40+
sound_status = tabs.expect_tab_sound_status(
41+
1, tabs.MEDIA_STATUS.PLAYING
42+
)
43+
except NoSuchElementException:
44+
logging.info("Tab sound status not found")
45+
retries += 1
3846
sleep(0.5)
47+
3948
tabs.click_tab_mute_button(1)
4049
tabs.expect_tab_sound_status(1, tabs.MEDIA_STATUS.MUTED)
4150
tabs.click_tab_mute_button(1)

0 commit comments

Comments
 (0)