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
1 change: 1 addition & 0 deletions manifests/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ address_bar_and_search:
- test_switch_to_existing_tab_when_having_the_same_URL
- test_search_suggestions
- test_delete_history_entry_via_firefox_suggest_completion_list
- test_searchmode_update_on_alias_prefix
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 @@ -8,6 +8,7 @@ address_bar_and_search:
- test_searchmode_cleared_on_engine_removal
- test_switch_to_existing_tab_when_having_the_same_URL
- test_delete_history_entry_via_firefox_suggest_completion_list
- test_searchmode_update_on_alias_prefix

tabs:
- test_change_position_of_pinned_tabs
Expand Down
1 change: 1 addition & 0 deletions manifests/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ address_bar_and_search:
test_searchbar_results_shown_in_a_new_tab: pass
test_searchmode_change_tab: pass
test_searchmode_cleared_on_engine_removal: pass
test_searchmode_update_on_alias_prefix : pass
test_server_not_found_error: pass
test_server_not_found_error_pb: pass
test_suggestion_engine_selection: pass
Expand Down
18 changes: 14 additions & 4 deletions modules/browser_object_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,20 @@ def clear_awesome_bar(self) -> BasePage:
return self

@BasePage.context_chrome
def type_in_awesome_bar(self, term: str) -> BasePage:
"""Enter text into the Awesome Bar. You probably want self.search()"""
self.set_awesome_bar()
self.awesome_bar.click()
def type_in_awesome_bar(self, term: str, reset=True) -> BasePage:
"""
Type text into the Awesome Bar.
reset=True (default): refocuses and clicks the Awesome Bar before typing,
which moves the cursor to the end.
reset=False: keeps the current cursor position (useful when tests manually
move the caret with arrow keys).
"""
if reset:
self.set_awesome_bar()
self.awesome_bar.click()

self.awesome_bar.send_keys(term)
return self

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import pytest
from selenium.webdriver import Firefox, Keys

from modules.browser_object_navigation import Navigation

ENGINE_KEYWORD = "@bing"
TEXT = "QA"
ENGINE = "Bing"


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


def test_searchmode_update_on_alias_prefix(driver: Firefox):
"""
C3028841 - Search mode is updated after typing a keyword/alias at the beginning of a non-empty search string
"""

# Instantiate object
nav = Navigation(driver)

# TODO: Go to about:preferences#search and set a keyword for bing, for example: bang

# Open a new tab, focus the urlbar and enter any string
nav.type_in_awesome_bar(TEXT)

# Start pressing LEFT KEY on the keyboard so the text insertion cursor is at the beginning
for _ in range(2):
nav.perform_key_combo_chrome(Keys.LEFT)

# Type @bing and press SPACE
nav.type_in_awesome_bar(ENGINE_KEYWORD, reset=False)
nav.perform_key_combo_chrome(Keys.SPACE)

# Search shortcut should be identified and translated to search mode for bing with the original text
# remaining as search query
nav.verify_engine_returned(ENGINE)
nav.verify_plain_text_in_input_awesome_bar(TEXT)