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
12 changes: 12 additions & 0 deletions modules/browser_object_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,3 +827,15 @@ 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}'"
)

@BasePage.context_chrome
def verify_engine_returned(self, engine: str) -> None:
"""
Verify that the given search engine is visible in the search mode switcher.
"""
engine_locator = (
self.elements["searchmode-engine"]["selectorData"].format(engine=engine)
)
self.wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, engine_locator))
)
6 changes: 6 additions & 0 deletions modules/data/navigation.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,5 +609,11 @@
"selectorData": "statuspanel-label",
"strategy": "id",
"groups": []
},

"searchmode-engine": {
"selectorData": "toolbarbutton#urlbar-searchmode-switcher[label*='{engine}, pick a search engine']",
"strategy": "css",
"groups": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pytest
from selenium.webdriver import Firefox

from modules.browser_object_navigation import Navigation


TEXT = "@bing mozilla"
SEARCH_ENGINE = "Bing"


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


def test_addressbar_search_engine_keywords(driver: Firefox):
"""
C3028779 - Verify that addressbar results displays the correct search engine when searching with search engine keywords
"""

# Instantiate objects
nav = Navigation(driver)

# TODO: Add a keyword for one search engine (e.g. for Bing add "bn" keyword) and search for (e.g. "bn mozilla")

# In the address bar type the default search engine keyword and a search term (e.g. "@bing mozilla")
nav.type_in_awesome_bar(TEXT)

# Results from URL bar state that the search will be performed with "Bing" (e.g. "mozilla - Search with Bing")
nav.verify_engine_returned(SEARCH_ENGINE)