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,49 +29,33 @@ 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
35-     # Open Test  page 
36-     GenericPage ( driver ,  url = TEST_URL ) .open ()
34+     # Open the test  page 
35+     page .open ()
3736
38-     # Open the Site information panel and check "Allow Audio and Video" 
39-     nav .click_on ("autoplay-permission" )
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 .set_site_autoplay_permission ("allow-audio-video" )
4239
43-     # Refresh test page and check the site information panel shows "Allow Audio and Video" 
40+     # Refresh test page and check the Audio-Video Permission panel shows "Allow Audio and Video" and the crossed off 
41+     # Play icon is no longer displayed 
4442    driver .get (driver .current_url )
45-     nav .element_visible ("permission-popup-audio-video-allowed" )
46- 
47-     # Check the Crossed off Play icon is no longer displayed 
48-     nav .element_not_visible ("autoplay-icon-blocked" )
43+     nav .verify_autoplay_state ("allow" )
4944
5045    # 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- 
46+     about_prefs .open_autoplay_modal ()
5847    about_prefs .element_visible ("mlb-allow-audio-video-settings" )
5948
60-     # Open Test  page 
61-     GenericPage ( driver ,  url = TEST_URL ) .open ()
49+     # #  Open the test  page 
50+     page .open ()
6251
63-     # Open the Site information panel and check "Block Audio and Video" 
64-     nav .click_on ("autoplay-permission" )
65-     nav .click_on ("permission-popup-audio-video-allowed" )
66-     nav .click_and_hide_menu ("block-audio-video-menuitem" )
52+     # Open the Audio-Video Permission panel and check "Block Audio and Video" 
53+     nav .set_site_autoplay_permission ("block-audio-video" )
6754
68-     # Refresh test page and check the site information  panel shows "Block Audio and Video" 
55+     # Refresh test page and check the Audio-Video Permission  panel shows "Block Audio and Video" 
6956    driver .get (driver .current_url )
70-     nav .element_visible ("permission-popup-audio-video-blocked" )
71-     nav .element_visible ("autoplay-icon-blocked" )
57+     nav .verify_autoplay_state ("block" )
7258
7359    # Revisit test page and check Site information panel shows "Block Audio and Video" 
74-     GenericPage (driver , url = TEST_URL ).open ()
75-     nav .element_visible ("permission-popup-audio-video-blocked" )
76- 
77-     # Check the Crossed off Play icon is displayed 
78-     nav .element_visible ("autoplay-icon-blocked" )
60+     page .open ()
61+     nav .verify_autoplay_state ("block" )
0 commit comments