Skip to content

Commit 5ab430d

Browse files
committed
Create test to confirm that nav bar doesn't recognised PB sites
1 parent abadc46 commit 5ab430d

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

modules/data/navigation.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,17 @@
220220
"selectorData": "identity-popup-more-info",
221221
"strategy": "id",
222222
"groups": []
223+
},
224+
225+
"search-result-url": {
226+
"selectorData": ".urlbarView-title.urlbarView-overflowable[is-url='']",
227+
"strategy": "css",
228+
"groups": []
229+
},
230+
231+
"search-result-action-term": {
232+
"selectorData": ".urlbarView-action",
233+
"strategy": "css",
234+
"groups": []
223235
}
224236
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object import Navigation
5+
from modules.browser_object_panel_ui import PanelUi
6+
7+
YOUTUBE_URL = "https://www.youtube.com/"
8+
FACEBOOK_URL = "https://www.facebook.com/"
9+
AMAZON_URL = "https://www.amazon.com/"
10+
11+
12+
@pytest.fixture()
13+
def add_prefs():
14+
return []
15+
16+
17+
def test_websites_visited_in_private_browser_not_displayed_in_awesome_bar(
18+
driver: Firefox,
19+
):
20+
"""
21+
C101665 - Verify the visited websites from the Private Browsing session are not displayed inside the normal session
22+
Awesome Bar
23+
"""
24+
25+
initial_window_handle = driver.current_window_handle
26+
27+
nav = Navigation(driver)
28+
panel_ui = PanelUi(driver)
29+
panel_ui.open_private_window()
30+
panel_ui.switch_to_new_window()
31+
32+
for url in [YOUTUBE_URL, FACEBOOK_URL, AMAZON_URL]:
33+
driver.get(url)
34+
35+
driver.switch_to.window(initial_window_handle)
36+
37+
for url in [YOUTUBE_URL, FACEBOOK_URL, AMAZON_URL]:
38+
nav.type_in_awesome_bar(url)
39+
url_element = nav.get_element("search-result-url")
40+
action_element = nav.get_element("search-result-action-term")
41+
42+
# Check that the URLS are displayed in search results with the term "Visit"
43+
assert (url_element.text, action_element.text) == (url, "Visit")
44+
45+
nav.clear_awesome_bar()

0 commit comments

Comments
 (0)