Skip to content

Commit 3c78026

Browse files
authored
Merge pull request #533 from mozilla/vs/mute-tabs-take2
vs/accept cookies banner2
2 parents 2ce9f0a + 1d7801e commit 3c78026

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/tabs/test_mute_tabs.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,26 @@
33
import pytest
44
from selenium.webdriver import Firefox
55
from selenium.webdriver.common.by import By
6+
from selenium.webdriver.support import expected_conditions as EC
67

78
from modules.browser_object import TabBar
89

10+
PLAY_BUTTON_SELECTOR = ".ytp-play-button"
11+
COOKIE_CONSENT_SELECTOR = (
12+
"button[aria-label^='Accept all'], button[aria-label^='Accept the use']"
13+
)
14+
915

1016
@pytest.fixture()
1117
def test_case():
1218
return "134719"
1319

1420

21+
@pytest.fixture()
22+
def add_to_prefs_list():
23+
return [("network.cookie.cookieBehavior", "2")]
24+
25+
1526
GHA = environ.get("GITHUB_ACTIONS") == "true"
1627

1728

@@ -21,8 +32,11 @@ def test_mute_unmute_tab(screenshot, driver: Firefox, video_url: str):
2132
"""C134719, test that tabs can be muted and unmuted"""
2233
tabs = TabBar(driver)
2334
driver.get(video_url)
24-
play_button = driver.find_element(By.CSS_SELECTOR, ".ytp-play-button")
35+
tabs.expect(EC.title_contains("Top 10"))
36+
37+
play_button = driver.find_element(By.CSS_SELECTOR, PLAY_BUTTON_SELECTOR)
2538
play_button.click()
39+
2640
with driver.context(driver.CONTEXT_CHROME):
2741
tabs.expect_tab_sound_status(1, tabs.MEDIA_STATUS.PLAYING)
2842
tabs.click_tab_mute_button(1)

0 commit comments

Comments
 (0)