Skip to content

Commit 431d296

Browse files
sv-hyacoubHani Yacoub
authored andcommitted
Hani/Test insertion point no search terms display (#862)
* Test insertion point no search terms display * Edit comment --------- Co-authored-by: Hani Yacoub <[email protected]>
1 parent eef4a82 commit 431d296

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

modules/page_base.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ def perform_key_combo(self, *keys) -> Page:
190190

191191
return self
192192

193+
@context_chrome
194+
def perform_key_combo_chrome(self, *keys) -> Page:
195+
"""
196+
Perform a keyboard shortcut in the browser chrome context (e.g., address bar).
197+
This method should be used for actions that target browser UI elements such as the
198+
awesome bar or toolbar buttons — not web content.
199+
Example:
200+
self.perform_key_combo_chrome(Keys.COMMAND, "c") # Copy from address bar
201+
"""
202+
return self.perform_key_combo(*keys)
203+
193204
def load_element_manifest(self, manifest_loc):
194205
"""Populate self.elements with the parse of the elements JSON"""
195206
logging.info(f"Loading element manifest: {manifest_loc}")
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import pytest
2+
from selenium.webdriver import Firefox, Keys
3+
4+
from modules.browser_object_navigation import Navigation
5+
6+
7+
TEXT = "Moza"
8+
DEFAULT_ENGINE = "Google"
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "3028716"
13+
14+
15+
@pytest.mark.parametrize("engine", ["Bing"])
16+
def test_insertion_point_no_search_terms_display(driver: Firefox, engine):
17+
"""
18+
C3028716 - Verify that Insertion Point without search terms is correctly displayed
19+
"""
20+
21+
# Instantiate objects
22+
nav = Navigation(driver)
23+
24+
# Click on the USB and select one of the engines
25+
nav.click_search_mode_switcher()
26+
nav.set_search_mode(engine)
27+
28+
# Click on the url bar
29+
nav.click_in_awesome_bar()
30+
31+
# Press [backspace/Delete in macOS]
32+
nav.perform_key_combo_chrome(Keys.BACKSPACE)
33+
34+
# Check that the selected engine is returned to using default engine
35+
nav.verify_engine_returned(DEFAULT_ENGINE)
36+
37+
# Type anything in the url bar (example fire)
38+
nav.type_in_awesome_bar(TEXT)
39+
40+
# Check that there is no Bing "Search Mode", search suggestions populate with default engine
41+
nav.verify_engine_returned(DEFAULT_ENGINE)
42+
43+
# Press enter key
44+
nav.perform_key_combo_chrome(Keys.ENTER)
45+
46+
# Check that the search is done for "moza" using the default search engine
47+
nav.verify_engine_returned(DEFAULT_ENGINE)

0 commit comments

Comments
 (0)