Skip to content

Commit 34d2f69

Browse files
committed
format
1 parent af16b9f commit 34d2f69

File tree

2 files changed

+55
-13
lines changed

2 files changed

+55
-13
lines changed

modules/data/about_prefs.components.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,35 @@
321321
"selectorData": "primaryBrowserLocale",
322322
"strategy": "id",
323323
"groups": []
324+
},
325+
326+
"cookies-privacy-label": {
327+
"selectorData": "description[data-l10n-id='sitedata-delete-on-close-private-browsing2']",
328+
"strategy": "css",
329+
"groups": []
330+
},
331+
332+
"cookies-delete-on-close": {
333+
"selectorData": "deleteOnClose",
334+
"strategy": "id",
335+
"groups": []
336+
},
337+
338+
"logins-ask-to-save-password": {
339+
"selectorData": "savePasswords",
340+
"strategy": "id",
341+
"groups": []
342+
},
343+
344+
"logins-exceptions": {
345+
"selectorData": "passwordExceptions",
346+
"strategy": "id",
347+
"groups": []
348+
},
349+
350+
"history-privacy-label": {
351+
"selectorData": "description[data-l10n-id='history-dontremember-description']",
352+
"strategy": "css",
353+
"groups": []
324354
}
325355
}

tests/security_and_privacy/test_never_remember_browsing_history.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# import logging
21
import pytest
3-
4-
# from time import sleep
52
from selenium.webdriver import Firefox
63

74
from modules.browser_object import PanelUi, TabBar
8-
9-
# from modules.page_object_about_prefs import AboutPrefs
10-
# from modules.util import Utilities
5+
from modules.page_object_about_prefs import AboutPrefs
116

127
links = [
138
"about:about",
@@ -19,20 +14,37 @@
1914
"about:blank",
2015
]
2116

22-
link_set = set(links)
17+
COOKIE_LABEL_TEXT = "Based on your history settings, Firefox deletes cookies and site data from your session when you close the browser."
18+
HISTORY_LABEL_TEXT = "Firefox will use the same settings as private browsing, and will not remember any history as you browse the Web."
2319

2420

2521
@pytest.fixture()
2622
def add_prefs():
2723
return [("browser.privatebrowsing.autostart", True)]
2824

2925

30-
# def test_never_remember_browsing_history_settings(driver: Firefox):
31-
# """
32-
# C102381.1: Ensure that setting the browser to never remember history has the correct configurations in about:preferences
33-
# """
34-
# # about_prefs = AboutPrefs(driver, category="privacy").open()
35-
# pass
26+
def test_never_remember_browsing_history_settings(driver: Firefox):
27+
"""
28+
C102381.1: Ensure that setting the browser to never remember history has the correct configurations in about:preferences
29+
"""
30+
# instantiate objs
31+
about_prefs = AboutPrefs(driver, category="privacy").open()
32+
33+
# perform all about:preferences#privacy assertions according to testrail
34+
cookies_label = about_prefs.get_element("cookies-privacy-label")
35+
assert cookies_label.get_attribute("innerHTML") == COOKIE_LABEL_TEXT
36+
37+
delete_cookies_checkbox = about_prefs.get_element("cookies-delete-on-close")
38+
assert delete_cookies_checkbox.get_attribute("checked") == "true"
39+
40+
save_password = about_prefs.get_element("logins-ask-to-save-password")
41+
assert save_password.get_attribute("checked") is None
42+
43+
login_exceptions = about_prefs.get_element("logins-exceptions")
44+
assert login_exceptions.get_attribute("disabled") == "true"
45+
46+
history_label = about_prefs.get_element("history-privacy-label")
47+
assert history_label.get_attribute("innerHTML") == HISTORY_LABEL_TEXT
3648

3749

3850
def test_never_remember_browsing_history_from_panel(driver: Firefox):

0 commit comments

Comments
 (0)