Skip to content

Commit 31b4971

Browse files
authored
Update test_play_mute_unmute_tabs_via_toggle.py
Disable test on GHA
1 parent 26c03a1 commit 31b4971

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/tabs/test_play_mute_unmute_tabs_via_toggle.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import time
2-
31
import pytest
2+
3+
from os import environ
4+
from time import sleep
5+
46
from pynput.mouse import Button, Controller
57
from selenium.webdriver import Firefox
68
from selenium.webdriver.common.by import By
@@ -12,6 +14,8 @@
1214
from modules.browser_object_tabbar import TabBar
1315
from modules.page_object_generics import GenericPage
1416

17+
GHA = environ.get("GITHUB_ACTIONS") == "true"
18+
1519

1620
@pytest.fixture()
1721
def 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")
2833
def 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

Comments
 (0)