@@ -10,6 +10,13 @@ def test_case():
10
10
return "143627"
11
11
12
12
13
+ def open_clear_cookies_data_dialog (about_prefs : AboutPrefs , ba : BrowserActions ):
14
+ about_prefs .open ()
15
+ clear_data_popup = about_prefs .press_button_get_popup_dialog_iframe ("Clear Data" )
16
+ ba .switch_to_iframe_context (clear_data_popup )
17
+ return about_prefs .get_clear_cookie_data_value ()
18
+
19
+
13
20
def test_clear_cookie_data (driver : Firefox ):
14
21
"""
15
22
C143627: Cookies and site data can be cleared via the "Clear Data" panel
@@ -18,27 +25,18 @@ def test_clear_cookie_data(driver: Firefox):
18
25
about_prefs = AboutPrefs (driver , category = "privacy" )
19
26
ba = BrowserActions (driver )
20
27
21
- def open_clear_cookies_data_dialog ():
22
- about_prefs .open ()
23
- clear_data_popup = about_prefs .press_button_get_popup_dialog_iframe (
24
- "Clear Data"
25
- )
26
- ba .switch_to_iframe_context (clear_data_popup )
27
-
28
28
# Visit a site to get a cookie added to saved data
29
- driver .get ("https://www.firefox .com" )
29
+ driver .get ("https://www.wikipedia .com" )
30
30
31
31
# Navigate to the clear data dialog of about:preferences#privacy
32
- open_clear_cookies_data_dialog ()
33
-
34
32
# Check for a non-zero value of the 'Cookies and site data' option
35
- cookie_value = about_prefs . get_clear_cookie_data_value ( )
33
+ cookie_value = open_clear_cookies_data_dialog ( about_prefs , ba )
36
34
assert cookie_value > 0
37
35
38
36
# Then clear the cookies and site data
39
37
about_prefs .get_element ("clear-data-accept-button" ).click ()
40
38
41
39
# Finally, check the value of the dialog option, it should be 0
42
- open_clear_cookies_data_dialog ()
43
- cookie_value2 = about_prefs . get_clear_cookie_data_value ( )
40
+
41
+ cookie_value2 = open_clear_cookies_data_dialog ( about_prefs , ba )
44
42
assert cookie_value2 == 0
0 commit comments