8
8
9
9
NOTIFICATIONS_SITE = "https://www.bennish.net/web-notifications.html"
10
10
associated_labels = [
11
- ("notifications-allow-button" , "Allow" ),
12
- ("notifications-block-button" , "Block" ),
11
+ ("notifications-allow-button" , "Allow" , "granted" ),
12
+ ("notifications-block-button" , "Block" , "denied" ),
13
13
]
14
14
15
15
@@ -18,8 +18,8 @@ def add_prefs():
18
18
return []
19
19
20
20
21
- @pytest .mark .parametrize ("button_data, button_text" , associated_labels )
22
- def test_notifications_allow (driver : Firefox , button_data : str , button_text : str ):
21
+ @pytest .mark .parametrize ("button_data, button_text, permission " , associated_labels )
22
+ def test_notifications_allow (driver : Firefox , button_data : str , button_text : str , permission : str ):
23
23
"""
24
24
C159150: verifies that changing different settings allows for notifcations to be blocked
25
25
"""
@@ -33,11 +33,13 @@ def test_notifications_allow(driver: Firefox, button_data: str, button_text: str
33
33
with driver .context (driver .CONTEXT_CHROME ):
34
34
about_prefs .get_element (button_data ).click ()
35
35
36
- check_notification_script = """
36
+ check_notification_script = """
37
37
return Notification.permission;
38
38
"""
39
39
permission_status = driver .execute_script (check_notification_script )
40
+
40
41
logging .info (f"Notification permission status: { permission_status } " )
42
+ assert permission_status == permission
41
43
42
44
about_prefs .open ()
43
45
about_prefs .get_element ("permissions-notifications-button" ).click ()
0 commit comments