|
1 |
| -# import logging |
2 | 1 | import pytest
|
3 |
| - |
4 |
| -# from time import sleep |
5 | 2 | from selenium.webdriver import Firefox
|
6 | 3 |
|
7 | 4 | 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 |
11 | 6 |
|
12 | 7 | links = [
|
13 | 8 | "about:about",
|
|
19 | 14 | "about:blank",
|
20 | 15 | ]
|
21 | 16 |
|
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." |
23 | 19 |
|
24 | 20 |
|
25 | 21 | @pytest.fixture()
|
26 | 22 | def add_prefs():
|
27 | 23 | return [("browser.privatebrowsing.autostart", True)]
|
28 | 24 |
|
29 | 25 |
|
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 |
36 | 48 |
|
37 | 49 |
|
38 | 50 | def test_never_remember_browsing_history_from_panel(driver: Firefox):
|
|
0 commit comments