Skip to content

Commit 23e9342

Browse files
authored
Merge pull request #719 from mozilla/tracy/try_headed_mode_mute_tab_test
Tracy/Try headed mode to avoid youtube bot detection
2 parents 20ef237 + f7005e2 commit 23e9342

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/tabs/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ def add_to_prefs_list():
2121

2222
@pytest.fixture()
2323
def video_url():
24-
return "https://www.youtube.com/watch?v=mAia0v3ojzw"
24+
return "https://www.w3schools.com/html/mov_bbb.mp4"

tests/tabs/test_mute_tabs.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import sys
12
from os import environ
23

34
import pytest
45
from selenium.webdriver import Firefox
5-
from selenium.webdriver.common.by import By
66
from selenium.webdriver.support import expected_conditions as EC
77

88
from modules.browser_object import TabBar
@@ -11,6 +11,7 @@
1111
COOKIE_CONSENT_SELECTOR = (
1212
"button[aria-label^='Accept all'], button[aria-label^='Accept the use']"
1313
)
14+
WIN_GHA = environ.get("GITHUB_ACTIONS") == "true" and sys.platform.startswith("win")
1415

1516

1617
@pytest.fixture()
@@ -23,20 +24,13 @@ def add_to_prefs_list():
2324
return [("network.cookie.cookieBehavior", "2")]
2425

2526

26-
GHA = environ.get("GITHUB_ACTIONS") == "true"
27-
28-
29-
@pytest.mark.unstable(reason="Bug https://bugzilla.mozilla.org/show_bug.cgi?id=1982379")
30-
@pytest.mark.skipif(GHA, reason="Test unstable in Github Actions")
27+
@pytest.mark.skipif(WIN_GHA, reason="Test unstable on Windows in Github Actions")
3128
@pytest.mark.audio
3229
def test_mute_unmute_tab(screenshot, driver: Firefox, video_url: str):
3330
"""C134719, test that tabs can be muted and unmuted"""
3431
tabs = TabBar(driver)
3532
driver.get(video_url)
36-
tabs.expect(EC.title_contains("Top 10"))
37-
38-
play_button = driver.find_element(By.CSS_SELECTOR, PLAY_BUTTON_SELECTOR)
39-
play_button.click()
33+
tabs.expect(EC.title_contains("mov_bbb.mp4"))
4034

4135
with driver.context(driver.CONTEXT_CHROME):
4236
tabs.expect_tab_sound_status(1, tabs.MEDIA_STATUS.PLAYING)

0 commit comments

Comments
 (0)