Skip to content

Commit 1786136

Browse files
committed
add permission checking
1 parent 046ef40 commit 1786136

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/security_and_privacy/test_notifications_change_set.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
NOTIFICATIONS_SITE = "https://www.bennish.net/web-notifications.html"
1010
associated_labels = [
11-
("notifications-allow-button", "Allow"),
12-
("notifications-block-button", "Block"),
11+
("notifications-allow-button", "Allow", "granted"),
12+
("notifications-block-button", "Block", "denied"),
1313
]
1414

1515

@@ -18,8 +18,8 @@ def add_prefs():
1818
return []
1919

2020

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):
2323
"""
2424
C159150: verifies that changing different settings allows for notifcations to be blocked
2525
"""
@@ -33,11 +33,13 @@ def test_notifications_allow(driver: Firefox, button_data: str, button_text: str
3333
with driver.context(driver.CONTEXT_CHROME):
3434
about_prefs.get_element(button_data).click()
3535

36-
check_notification_script = """
36+
check_notification_script = """
3737
return Notification.permission;
3838
"""
3939
permission_status = driver.execute_script(check_notification_script)
40+
4041
logging.info(f"Notification permission status: {permission_status}")
42+
assert permission_status == permission
4143

4244
about_prefs.open()
4345
about_prefs.get_element("permissions-notifications-button").click()

0 commit comments

Comments
 (0)