1- import time
2-
31import pytest
2+
3+ from os import environ
4+ from time import sleep
5+
46from pynput .mouse import Button , Controller
57from selenium .webdriver import Firefox
68from selenium .webdriver .common .by import By
1214from modules .browser_object_tabbar import TabBar
1315from modules .page_object_generics import GenericPage
1416
17+ GHA = environ .get ("GITHUB_ACTIONS" ) == "true"
18+
1519
1620@pytest .fixture ()
1721def test_case ():
@@ -25,6 +29,7 @@ def add_to_prefs_list():
2529
2630@pytest .mark .audio
2731@pytest .mark .headed
32+ @pytest .mark .skipif (GHA , reason = "Test unstable in Github Actions" )
2833def test_play_mute_unmute_tabs_via_toggle (driver : Firefox , sys_platform : str ):
2934 """
3035 C246981 - Verify that play/mute/unmute tabs via toggle audio works
@@ -51,7 +56,7 @@ def test_play_mute_unmute_tabs_via_toggle(driver: Firefox, sys_platform: str):
5156
5257 # Verify correct number of tabs opened
5358 tabs .wait_for_num_tabs (3 )
54- time . sleep (2 )
59+ sleep (2 )
5560
5661 # Select all tabs via Control/Command click while staying on first tab
5762 modifier_key = Keys .COMMAND if sys_platform == "Darwin" else Keys .CONTROL
@@ -97,9 +102,9 @@ def click_multi_tab_audio_button():
97102 )
98103 # Offset to click on the audio control area (left side of tab)
99104 mouse .position = (element_x - 75 , element_y )
100- time . sleep (0.3 ) # Small delay for mouse positioning
105+ sleep (0.3 ) # Small delay for mouse positioning
101106 mouse .click (Button .left , 1 )
102- time . sleep (2 ) # Wait for action to take effect
107+ sleep (2 ) # Wait for action to take effect
103108
104109 # Click Play button
105110 click_multi_tab_audio_button ()
0 commit comments