Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions SELECTOR_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3490,10 +3490,9 @@ Location: On the hamburger menu
Path to .json: modules/data/panel_ui.components.json
```
```
Selector name: bookmark-by-title
Selector Data: toolbarbutton.bookmark-item[label*='{title}']
Description: Bookmark item
Location: On the hamburger menu > Bookmarks
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.
Location: On the hamburger menu > Bookmarks or History
Path to .json: modules/data/panel_ui.components.json
```
```
Expand Down
1 change: 1 addition & 0 deletions manifests/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ address_bar_and_search:
- test_search_code_google_us
- test_searchmode_cleared_on_engine_removal
- test_search_suggestions
- test_delete_history_entry_via_firefox_suggest_completion_list
audio_video:
- test_block_audio_video_functionality
- test_allow_audio_video_functionality
Expand Down
1 change: 1 addition & 0 deletions manifests/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ address_bar_and_search:
- test_ctrl_enter_completes_link_and_can_refresh
- test_disable_websearch_from_awesome_bar
- test_searchmode_cleared_on_engine_removal
- test_delete_history_entry_via_firefox_suggest_completion_list
tabs:
- test_change_position_of_pinned_tabs
- test_close_pinned_tab_via_mouse
Expand Down
2 changes: 2 additions & 0 deletions manifests/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ address_bar_and_search:
test_ctrl_enter_fixes_url: pass
test_default_search_provider_change_awesome_bar: unstable
test_default_search_provider_change_legacy_search_bar: deprecated
test_delete_history_entry_via_firefox_suggest_completion_list: pass
test_disable_websearch_from_awesome_bar: pass
test_dont_show_search_suggestions_in_private_window: pass
test_google_search_counts_us:
Expand Down Expand Up @@ -155,6 +156,7 @@ menus:
test_tab_context_menu_close: pass
meta:
test_version: pass
test_selectors: unstable
networking:
test_default_dns_protection: pass
test_http_site: pass
Expand Down
32 changes: 32 additions & 0 deletions modules/browser_object_panel_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,38 @@ def confirm_history_clear(self):
"recent-history-content", "value", "(Empty)"
)

@BasePage.context_chrome
def verify_history_item_exists(self, item_title: str) -> BasePage:
"""
Verify that a history item with the specified title exists in the history menu.
Note:
This method uses the "bookmark-by-title" selector, which works for both
bookmarks and history items because Firefox uses the same CSS class "bookmark-item"
for both in the hamburger menu UI. This is intentional design in Firefox's UI.
Argument:
item_title (str): The title text to look for in the history item (can be partial match)
"""
self.open_history_menu()
self.get_all_history()
self.element_visible("bookmark-by-title", labels=[item_title])
return self

@BasePage.context_chrome
def verify_history_item_does_not_exist(self, item_title: str) -> BasePage:
"""
Verify that a history item with the specified title exists in the history menu.
Note:
This method uses the "bookmark-by-title" selector, which works for both
bookmarks and history items because Firefox uses the same CSS class "bookmark-item"
for both in the hamburger menu UI. This is intentional design in Firefox's UI.
Argument:
item_title (str): The title text to look for in the history item (can be partial match)
"""
self.open_history_menu()
self.get_all_history()
self.element_not_visible("bookmark-by-title", labels=[item_title])
return self

# Bookmarks section

@BasePage.context_chrome
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import pytest
from selenium.webdriver import Firefox
from selenium.webdriver.common.keys import Keys

from modules.browser_object import Navigation, PanelUi


@pytest.fixture()
def test_case():
return "3028901"


HISTORY_PAGES = [
"https://www.imdb.com/",
"https://www.youtube.com/",
"https://www.nasa.gov/",
]

SEARCH_TERM = "you"
HISTORY_ENTRY = "YouTube"


def test_delete_history_from_url_bar_completion_list(driver: Firefox):
"""
C3028901 - Verify that deleting an entry from the Firefox Suggest completion list also removes the same entry from
the History menu.
"""
# Initialize page objects
nav = Navigation(driver)
panel = PanelUi(driver)

# Create history by navigating to each page sequentially
for url in HISTORY_PAGES:
driver.get(url)

# Ensure the targeted entry is visible in History menu
panel.verify_history_item_exists(HISTORY_ENTRY)

# Type into the URL bar to trigger suggestions
nav.type_in_awesome_bar(SEARCH_TERM)
nav.wait_for_suggestions_present()

# Select the suggestion and delete using Shift+Backspace
nav.perform_key_combo_chrome(Keys.ARROW_DOWN)
nav.perform_key_combo_chrome(Keys.SHIFT, Keys.BACKSPACE)

# Verify the entry is removed from History menu
panel.verify_history_item_does_not_exist(HISTORY_ENTRY)