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..d7e33da88 --- /dev/null +++ b/tests/address_bar_and_search/test_insertion_point_no_search_terms_display.py @@ -0,0 +1,47 @@ +import pytest +from selenium.webdriver import Firefox, Keys + +from modules.browser_object_navigation import Navigation + + +TEXT = "Moza" +DEFAULT_ENGINE = "Google" + +@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_ENGINE) + + # Type anything in the url bar (example fire) + nav.type_in_awesome_bar(TEXT) + + # Check that there is no Bing "Search Mode", search suggestions populate with default engine + nav.verify_engine_returned(DEFAULT_ENGINE) + + # 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_ENGINE)