44from modules .browser_object_navigation import Navigation
55from modules .page_object_generics import GenericPage
66from modules .page_object_prefs import AboutPrefs
7- from modules .util import BrowserActions
87
98
109@pytest .fixture ()
@@ -30,15 +29,13 @@ def test_users_actions_saved_on_reload(driver: Firefox):
3029 # Instantiate objects
3130 nav = Navigation (driver )
3231 about_prefs = AboutPrefs (driver , category = "privacy" )
33- ba = BrowserActions (driver )
32+ page = GenericPage (driver , url = TEST_URL )
3433
3534 # Open Test page
36- GenericPage ( driver , url = TEST_URL ) .open ()
35+ page .open ()
3736
38- # Open the Site information panel and check "Allow Audio and Video"
39- nav .click_on ("autoplay-icon-blocked" )
40- nav .click_on ("permission-popup-audio-blocked" )
41- nav .click_and_hide_menu ("allow-audio-video-menuitem" )
37+ # Open the Audio-Video Permission panel and check "Allow Audio and Video"
38+ nav .open_audio_video_permission ()
4239
4340 # Refresh test page and check the site information panel shows "Allow Audio and Video"
4441 driver .get (driver .current_url )
@@ -48,17 +45,11 @@ def test_users_actions_saved_on_reload(driver: Firefox):
4845 nav .element_not_visible ("autoplay-icon-blocked" )
4946
5047 # Check the website is added to the exceptions list in about:preferences#privacy
51- about_prefs .open ()
52- about_prefs .get_element ("autoplay-settings-button" ).click ()
53-
54- # Get the web element for the iframe
55- iframe = about_prefs .get_iframe ()
56- ba .switch_to_iframe_context (iframe )
57-
48+ about_prefs .open_autopaly_modal ()
5849 about_prefs .element_visible ("mlb-allow-audio-video-settings" )
5950
60- # Open Test page
61- GenericPage ( driver , url = TEST_URL ) .open ()
51+ # # Open Test page
52+ page .open ()
6253
6354 # Open the Site information panel and check "Block Audio and Video"
6455 nav .click_on ("autoplay-icon-blocked" )
@@ -71,7 +62,7 @@ def test_users_actions_saved_on_reload(driver: Firefox):
7162 nav .element_visible ("autoplay-icon-blocked" )
7263
7364 # Revisit test page and check Site information panel shows "Block Audio and Video"
74- GenericPage ( driver , url = TEST_URL ) .open ()
65+ page .open ()
7566 nav .element_visible ("permission-popup-audio-video-blocked" )
7667
7768 # Check the Crossed off Play icon is displayed
0 commit comments