diff --git a/SELECTOR_INFO.md b/SELECTOR_INFO.md index 3c9009042..6009a0a6d 100644 --- a/SELECTOR_INFO.md +++ b/SELECTOR_INFO.md @@ -1845,20 +1845,6 @@ Description: Context menu option to move a tab to the start of the tab bar. Location: Context menu - Tab Path to .json: modules/data/context_menu.components.json ``` -``` -Selector Name: context-menu-bookmark-link -Selector Data: context-bookmarklink -Description: Context menu option to bookmark a link -Location: Context menu - topsite context menu -Path to .json: modules/data/context_menu.components.json -``` -``` -Selector Name: context-menu-search-select -Selector Data: coontext-searchselect -Description: Context menu option to search selected text with the engine set as default -Location: Context menu - topsite context menu -Path to .json: modules/data/context_menu.components.json -``` #### credit_card_fill ``` Selector Name: form-field @@ -3161,13 +3147,6 @@ Description: Developer tool icon Location: Navigation bar Path to .json: modules/data/navigation.components.json ``` -``` -Selector Name: status-panel-label -Selector Data: statuspanel-label -Description: Status panel URL label -Location: newtab page bottom left corner on link hover -Path to .json: modules/data/navigation.components.json -``` #### panel_ui ``` Selector name: panel-ui-button @@ -3545,7 +3524,7 @@ Description: Edit bookmark panel Location: Bookmark panel Path to .json: modules/data/pane_ui.components.json ``` - +``` #### print_preview ``` Selector name: print-preview-browser diff --git a/modules/browser_object_navigation.py b/modules/browser_object_navigation.py index 38e11b7a5..83c68a134 100644 --- a/modules/browser_object_navigation.py +++ b/modules/browser_object_navigation.py @@ -827,3 +827,8 @@ def verify_status_panel_url(self, expected_url: str): assert expected_url in actual_url, ( f"Expected '{expected_url}' in status panel URL, got '{actual_url}'" ) + + def verify_engine_returned_default(self) -> None: + self.wait.until( + lambda d: self.element_visible("google-default-engine") + ) diff --git a/modules/data/navigation.components.json b/modules/data/navigation.components.json index 3165f2a5e..70d572904 100644 --- a/modules/data/navigation.components.json +++ b/modules/data/navigation.components.json @@ -609,5 +609,11 @@ "selectorData": "statuspanel-label", "strategy": "id", "groups": [] + }, + + "google-default-engine": { + "selectorData": "toolbarbutton#urlbar-searchmode-switcher[label='Google, pick a search engine']", + "strategy": "css", + "groups": [] } } diff --git a/modules/page_base.py b/modules/page_base.py index e1d4fca55..0ebc3a0aa 100644 --- a/modules/page_base.py +++ b/modules/page_base.py @@ -190,6 +190,17 @@ def perform_key_combo(self, *keys) -> Page: return self + @context_chrome + def perform_key_combo_chrome(self, *keys) -> Page: + """ + Perform a keyboard shortcut in the browser chrome context (e.g., address bar). + This method should be used for actions that target browser UI elements such as the + awesome bar or toolbar buttons — not web content. + Example: + self.perform_key_combo_chrome(Keys.COMMAND, "c") # Copy from address bar + """ + return self.perform_key_combo(*keys) + def load_element_manifest(self, manifest_loc): """Populate self.elements with the parse of the elements JSON""" logging.info(f"Loading element manifest: {manifest_loc}") diff --git a/tests/address_bar_and_search/test_insertion_point_no_search_terms_display.py b/tests/address_bar_and_search/test_insertion_point_no_search_terms_display.py new file mode 100644 index 000000000..8de58c6be --- /dev/null +++ b/tests/address_bar_and_search/test_insertion_point_no_search_terms_display.py @@ -0,0 +1,44 @@ +import pytest +from selenium.webdriver import Firefox, Keys + +from modules.browser_object_navigation import Navigation + + +@pytest.fixture() +def test_case(): + return "3028716" + + +@pytest.mark.parametrize("engine", ["Bing"]) +def test_insertion_point_no_search_terms_display(driver: Firefox, engine): + """ + C3028716 - Verify that Insertion Point without search terms is correctly displayed + """ + + # Instantiate objects + nav = Navigation(driver) + + # Click on the USB and select one of the engines + nav.click_search_mode_switcher() + nav.set_search_mode(engine) + + # Click on the url bar + nav.click_in_awesome_bar() + + # Press [backspace/Delete in macOS] + nav.perform_key_combo_chrome(Keys.BACKSPACE) + + # Check that the selected engine is returned to using default engine + nav.verify_engine_returned_default() + + # Type anything in the url bar (example fire) + nav.type_in_awesome_bar("fire") + + # Check that there is no Bing "Search Mode", search suggestions populate with default engine + nav.verify_engine_returned_default() + + # Press enter key + nav.perform_key_combo_chrome(Keys.ENTER) + + # Check that the search is done for "moza" using the default search engine + nav.verify_engine_returned_default() \ No newline at end of file