Skip to content

Commit dba16ed

Browse files
committed
first part done
1 parent f06eed8 commit dba16ed

File tree

4 files changed

+93
-3
lines changed

4 files changed

+93
-3
lines changed

modules/data/panel_ui.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@
113113
"selectorData": "toolbarbutton[class='restoreallitem subviewbutton panel-subview-footer-button']",
114114
"strategy": "css",
115115
"groups": []
116+
},
117+
118+
"panel-ui-history-recent-history-container": {
119+
"selectorData": "appMenu_historyMenu",
120+
"strategy": "id",
121+
"groups": []
122+
},
123+
124+
"panel-ui-history-recent-history-item": {
125+
"selectorData": "toolbarbutton",
126+
"strategy": "tag",
127+
"groups": []
116128
}
117129

118130
}

modules/page_object_about_prefs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from modules.classes.autofill_base import AutofillAddressBase
1111
from modules.classes.credit_card import CreditCardBase
1212
from modules.page_base import BasePage
13-
from modules.util import BrowserActions, PomUtils
13+
from modules.util import PomUtils
1414

1515

1616
class AboutPrefs(BasePage):

tests/preferences/test_clear_cookie_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def open_clear_cookies_data_dialog():
2727

2828
# Check for a non-zero value of the 'Cookies and site data' option
2929
cookie_value = about_prefs.get_clear_cookie_data_value()
30-
assert cookie_value is not 0
30+
assert cookie_value != 0
3131

3232
# Then clear the cookies and site data
3333
about_prefs.get_element("clear-data-accept-button").click()
3434

3535
# Finally, check the value of the dialog option, it should be 0
3636
open_clear_cookies_data_dialog()
3737
cookie_value2 = about_prefs.get_clear_cookie_data_value()
38-
assert cookie_value2 is 0
38+
assert cookie_value2 == 0
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# import logging
2+
import pytest
3+
4+
# from time import sleep
5+
from selenium.webdriver import Firefox
6+
7+
from modules.browser_object import PanelUi, TabBar
8+
9+
# from modules.page_object_about_prefs import AboutPrefs
10+
# from modules.util import Utilities
11+
12+
links = [
13+
"about:about",
14+
"about:addons",
15+
"about:cache",
16+
"about:config",
17+
"about:buildconfig",
18+
"about:robots",
19+
"about:blank",
20+
]
21+
22+
link_set = set(links)
23+
24+
25+
@pytest.fixture()
26+
def add_prefs():
27+
return [("browser.privatebrowsing.autostart", True)]
28+
29+
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
36+
37+
38+
def test_never_remember_browsing_history_from_panel(driver: Firefox):
39+
"""
40+
C102381.2: Ensure that setting the browser to never remember history does not actually save any history
41+
"""
42+
panel_ui = PanelUi(driver).open()
43+
tabs = TabBar(driver)
44+
# util = Utilities()
45+
46+
num_tabs = 6
47+
48+
# open some tabs
49+
for i in range(num_tabs):
50+
driver.get(links[i])
51+
tabs.new_tab_by_button()
52+
tabs.switch_to_new_tab()
53+
54+
# close the first 6 tabs
55+
with driver.context(driver.CONTEXT_CHROME):
56+
x_icon = tabs.get_element("tab-x-icon", multiple=True)
57+
for i in range(num_tabs):
58+
x_icon[i].click()
59+
60+
panel_ui.open_panel_menu()
61+
62+
# go into the history tab
63+
with driver.context(driver.CONTEXT_CHROME):
64+
panel_ui.get_element("panel-ui-history").click()
65+
66+
# check for history
67+
recently_visited_container = panel_ui.get_element(
68+
"panel-ui-history-recent-history-container"
69+
)
70+
recently_visited_items = panel_ui.get_element(
71+
"panel-ui-history-recent-history-item",
72+
multiple=True,
73+
parent_element=recently_visited_container,
74+
)
75+
76+
# ensure no actual items are there
77+
assert len(recently_visited_items) == 1
78+
assert recently_visited_items[0].get_attribute("label") == "(Empty)"

0 commit comments

Comments
 (0)