Skip to content

Commit 586033b

Browse files
committed
permission using javascript
1 parent 12a96c7 commit 586033b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/security_and_privacy/test_notifications_change_set.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import logging
23
from selenium.webdriver import Firefox
34

45
from modules.page_object import AboutPrefs, GenericPage
@@ -31,6 +32,12 @@ def test_notifications_allow(driver: Firefox, button_data: str, button_text: str
3132
with driver.context(driver.CONTEXT_CHROME):
3233
about_prefs.get_element(button_data).click()
3334

35+
check_notification_script = """
36+
return Notification.permission;
37+
"""
38+
permission_status = driver.execute_script(check_notification_script)
39+
logging.info(f"Notification permission status: {permission_status}")
40+
3441
about_prefs.open()
3542
about_prefs.get_element("permissions-notifications-button").click()
3643

@@ -51,4 +58,4 @@ def test_notifications_allow(driver: Firefox, button_data: str, button_text: str
5158
"permissions-notifications-popup-websites-item-status",
5259
parent_element=website_item,
5360
)
54-
assert notification_website_status.get_attribute("label") == button_text
61+
assert notification_website_status.get_attribute("label") == button_text

0 commit comments

Comments
 (0)