Skip to content

Commit ca52462

Browse files
committed
nerge changes in and fix
2 parents c912059 + 8c6c388 commit ca52462

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
lines changed

modules/browser_object_panel_ui.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,12 @@ def open_private_window(self) -> BasePage:
141141
with self.driver.context(self.driver.CONTEXT_CHROME):
142142
self.get_element("panel-ui-new-private-window").click()
143143
return self
144+
145+
def open_history_menu(self) -> BasePage:
146+
"""
147+
Opens the History menu
148+
"""
149+
self.open_panel_menu()
150+
with self.driver.context(self.driver.CONTEXT_CHROME):
151+
self.get_element("panel-ui-history").click()
152+
return self

modules/data/panel_ui.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@
127127
"groups": []
128128
},
129129

130+
"recent-history-content": {
131+
"selectorData": "#appMenu_historyMenu .toolbarbutton-text",
132+
"strategy": "css",
133+
"groups": []
134+
},
135+
130136
"panel-ui-history-recent-history-container": {
131137
"selectorData": "appMenu_historyMenu",
132138
"strategy": "id",

tests/security_and_privacy/test_never_remember_browsing_history.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ def test_never_remember_browsing_history_from_panel(driver: Firefox):
6969
for i in range(num_tabs):
7070
x_icon[i].click()
7171

72-
panel_ui.open_panel_menu()
72+
panel_ui.open_panel_menu()
7373

74-
# go into the history tab
75-
with driver.context(driver.CONTEXT_CHROME):
74+
# go into the history tab
7675
panel_ui.get_element("panel-ui-history").click()
7776

7877
# check for history
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_panel_ui import PanelUi
5+
6+
YOUTUBE_URL = "https://www.youtube.com/"
7+
FACEBOOK_URL = "https://www.facebook.com/"
8+
AMAZON_URL = "https://www.amazon.com/"
9+
10+
11+
@pytest.fixture()
12+
def add_prefs():
13+
return []
14+
15+
16+
def test_websites_visited_in_private_browser_not_displayed_in_history(driver: Firefox):
17+
"""
18+
C101663 - Verify the visited websites from the Private Browsing session are not displayed inside the normal session
19+
History menu
20+
"""
21+
22+
initial_window_handle = driver.current_window_handle
23+
24+
panel_ui = PanelUi(driver).open()
25+
panel_ui.open_private_window()
26+
panel_ui.switch_to_new_window()
27+
28+
driver.get(YOUTUBE_URL)
29+
driver.get(FACEBOOK_URL)
30+
driver.get(AMAZON_URL)
31+
32+
driver.switch_to.window(initial_window_handle)
33+
34+
panel_ui.open_history_menu()
35+
with panel_ui.driver.context(panel_ui.driver.CONTEXT_CHROME):
36+
empty_label = panel_ui.get_element("recent-history-content").get_attribute(
37+
"value"
38+
)
39+
assert (
40+
empty_label == "(Empty)"
41+
), f"Expected history to be empty, but found '{empty_label}'"

0 commit comments

Comments
 (0)