@@ -27,19 +27,23 @@ def test_preferences_all_toggles_enabled(driver: Firefox):
27
27
28
28
# Check if toggles are enabled
29
29
nonsponsored_checkbox = about_prefs .get_element ("firefox-suggest-nonsponsored" )
30
- assert nonsponsored_checkbox .is_selected (), f"Checkbox with selector '{ nonsponsored_checkbox } ' is not checked"
30
+ assert (
31
+ nonsponsored_checkbox .is_selected ()
32
+ ), f"Checkbox with selector '{ nonsponsored_checkbox } ' is not checked"
31
33
sponsors_checkbox = about_prefs .get_element ("firefox-suggest-sponsored" )
32
- assert sponsors_checkbox .is_selected (), f"Checkbox with selector '{ sponsors_checkbox } ' is not checked"
34
+ assert (
35
+ sponsors_checkbox .is_selected ()
36
+ ), f"Checkbox with selector '{ sponsors_checkbox } ' is not checked"
33
37
34
38
# Check if sponsored suggestion is displayed. Using long sleeps otherwise sponsored suggestions won't be displayed
35
39
time .sleep (20 )
36
40
u .search ("iphone" , with_enter = False )
37
41
time .sleep (20 )
38
- with ( driver .context (driver .CONTEXT_CHROME ) ):
42
+ with driver .context (driver .CONTEXT_CHROME ):
39
43
assert nav .get_elements ("sponsored-suggestion" )
40
44
41
45
# Check if a non-sponsored suggestion is displayed
42
46
u .search ("wiki" , with_enter = False )
43
- with ( driver .context (driver .CONTEXT_CHROME ) ):
47
+ with driver .context (driver .CONTEXT_CHROME ):
44
48
assert not nav .get_elements ("sponsored-suggestion" )
45
- assert nav .get_element ("firefox-suggest" ).is_displayed ()
49
+ assert nav .get_element ("firefox-suggest" ).is_displayed ()
0 commit comments