Skip to content

Commit ad4e8a2

Browse files
Merge branch 'main' into vs/test-switch-to-tab
2 parents d42b1bd + c2cda5e commit ad4e8a2

File tree

6 files changed

+87
-3
lines changed

6 files changed

+87
-3
lines changed

SELECTOR_INFO.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3497,10 +3497,9 @@ Location: On the hamburger menu
34973497
Path to .json: modules/data/panel_ui.components.json
34983498
```
34993499
```
3500-
Selector name: bookmark-by-title
35013500
Selector Data: toolbarbutton.bookmark-item[label*='{title}']
3502-
Description: Bookmark item
3503-
Location: On the hamburger menu > Bookmarks
3501+
Description: Bookmark or history item by title. This selector works for both bookmarks and history items since Firefox uses the same CSS class "bookmark-item" for both in the hamburger menu UI.
3502+
Location: On the hamburger menu > Bookmarks or History
35043503
Path to .json: modules/data/panel_ui.components.json
35053504
```
35063505
```

manifests/all.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ address_bar_and_search:
4242
- test_searchmode_cleared_on_engine_removal
4343
- test_switch_to_existing_tab_when_having_the_same_URL
4444
- test_search_suggestions
45+
- test_delete_history_entry_via_firefox_suggest_completion_list
4546
audio_video:
4647
- test_block_audio_video_functionality
4748
- test_allow_audio_video_functionality

manifests/functional.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ address_bar_and_search:
77
- test_disable_websearch_from_awesome_bar
88
- test_searchmode_cleared_on_engine_removal
99
- test_switch_to_existing_tab_when_having_the_same_URL
10+
- test_delete_history_entry_via_firefox_suggest_completion_list
11+
1012
tabs:
1113
- test_change_position_of_pinned_tabs
1214
- test_close_pinned_tab_via_mouse

manifests/key.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ address_bar_and_search:
1212
test_ctrl_enter_fixes_url: pass
1313
test_default_search_provider_change_awesome_bar: unstable
1414
test_default_search_provider_change_legacy_search_bar: deprecated
15+
test_delete_history_entry_via_firefox_suggest_completion_list: pass
1516
test_disable_websearch_from_awesome_bar: pass
1617
test_dont_show_search_suggestions_in_private_window: pass
1718
test_google_search_counts_us:
@@ -156,6 +157,7 @@ menus:
156157
test_tab_context_menu_close: pass
157158
meta:
158159
test_version: pass
160+
test_selectors: unstable
159161
networking:
160162
test_default_dns_protection: pass
161163
test_http_site: pass

modules/browser_object_panel_ui.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,38 @@ def confirm_history_clear(self):
278278
"recent-history-content", "value", "(Empty)"
279279
)
280280

281+
@BasePage.context_chrome
282+
def verify_history_item_exists(self, item_title: str) -> BasePage:
283+
"""
284+
Verify that a history item with the specified title exists in the history menu.
285+
Note:
286+
This method uses the "bookmark-by-title" selector, which works for both
287+
bookmarks and history items because Firefox uses the same CSS class "bookmark-item"
288+
for both in the hamburger menu UI. This is intentional design in Firefox's UI.
289+
Argument:
290+
item_title (str): The title text to look for in the history item (can be partial match)
291+
"""
292+
self.open_history_menu()
293+
self.get_all_history()
294+
self.element_visible("bookmark-by-title", labels=[item_title])
295+
return self
296+
297+
@BasePage.context_chrome
298+
def verify_history_item_does_not_exist(self, item_title: str) -> BasePage:
299+
"""
300+
Verify that a history item with the specified title exists in the history menu.
301+
Note:
302+
This method uses the "bookmark-by-title" selector, which works for both
303+
bookmarks and history items because Firefox uses the same CSS class "bookmark-item"
304+
for both in the hamburger menu UI. This is intentional design in Firefox's UI.
305+
Argument:
306+
item_title (str): The title text to look for in the history item (can be partial match)
307+
"""
308+
self.open_history_menu()
309+
self.get_all_history()
310+
self.element_not_visible("bookmark-by-title", labels=[item_title])
311+
return self
312+
281313
# Bookmarks section
282314

283315
@BasePage.context_chrome
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
from selenium.webdriver.common.keys import Keys
4+
5+
from modules.browser_object import Navigation, PanelUi
6+
7+
8+
@pytest.fixture()
9+
def test_case():
10+
return "3028901"
11+
12+
13+
HISTORY_PAGES = [
14+
"https://www.imdb.com/",
15+
"https://www.youtube.com/",
16+
"https://www.nasa.gov/",
17+
]
18+
19+
SEARCH_TERM = "you"
20+
HISTORY_ENTRY = "YouTube"
21+
22+
23+
def test_delete_history_from_url_bar_completion_list(driver: Firefox):
24+
"""
25+
C3028901 - Verify that deleting an entry from the Firefox Suggest completion list also removes the same entry from
26+
the History menu.
27+
"""
28+
# Initialize page objects
29+
nav = Navigation(driver)
30+
panel = PanelUi(driver)
31+
32+
# Create history by navigating to each page sequentially
33+
for url in HISTORY_PAGES:
34+
driver.get(url)
35+
36+
# Ensure the targeted entry is visible in History menu
37+
panel.verify_history_item_exists(HISTORY_ENTRY)
38+
39+
# Type into the URL bar to trigger suggestions
40+
nav.type_in_awesome_bar(SEARCH_TERM)
41+
nav.wait_for_suggestions_present()
42+
43+
# Select the suggestion and delete using Shift+Backspace
44+
nav.perform_key_combo_chrome(Keys.ARROW_DOWN)
45+
nav.perform_key_combo_chrome(Keys.SHIFT, Keys.BACKSPACE)
46+
47+
# Verify the entry is removed from History menu
48+
panel.verify_history_item_does_not_exist(HISTORY_ENTRY)

0 commit comments

Comments
 (0)