Skip to content
Open
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 Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ google-auth = "2.32.0"
psutil = "<6.1"
pytest-json-report = "==1.5.0"
beautifulsoup4 = "4.12.3"
autopy = "*"

[dev-packages]
werkzeug = "==3.0.3"
Expand Down
1 change: 0 additions & 1 deletion manifests/incident.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ profile:
- test_set_default_profile
reader_view:
- test_improved_type_control_panel
- test_reader_view_location_bar
scrolling_panning_zooming:
- test_default_zoom_persists
- test_mouse_wheel_zoom
Expand Down
9 changes: 5 additions & 4 deletions manifests/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ address_bar_and_search:
result: pass
splits:
- functional1
test_bing_search_codes:
result: pass
splits:
- functional1
test_copied_url_contains_https:
result: pass
splits:
Expand Down Expand Up @@ -748,10 +752,7 @@ password_manager:
- ci-extended
pdf_viewer:
test_add_image_pdf:
result:
linux: unstable
mac: pass
win: pass
result: pass
splits:
- smoke
test_download_pdf_with_form_fields:
Expand Down
4 changes: 2 additions & 2 deletions modules/browser_object_reader_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def open_reader_view_keys(self) -> BasePage:
self.wait_for_reader_view_open()
return self

@BasePage.context_chrome
def close_reader_view_searchbar(self) -> BasePage:
"""
Closes the reader view using the search bar
"""
before_page_source = self.driver.page_source
with self.driver.context(self.driver.CONTEXT_CHROME):
self.get_element("reader-view-button").click()
self.get_element("reader-view-button").click()
self.wait.until(lambda _: self.driver.page_source != before_page_source)
self.wait_for_reader_view_closed()
return self
Expand Down
19 changes: 8 additions & 11 deletions modules/page_object_generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,24 @@ def add_image(self, image_path: str, sys_platform: str) -> BasePage:
self.get_element("toolbar-add-image").click()
self.get_element("toolbar-add-image-confirm").click()
sleep(1.5)
from pynput.keyboard import Controller, Key
import autopy

keyboard = Controller()
if sys_platform == "Darwin" or sys_platform == "Linux":
keyboard.type("/")
autopy.key.tap("/")
sleep(1.5)
keyboard.type(image_path.lstrip("/"))
autopy.key.type_string(image_path.lstrip("/"), wpm=90)
else:
sleep(1.5)
keyboard.type(image_path)
autopy.key.type_string(image_path, wpm=50)
sleep(1)
keyboard.press(Key.enter)
keyboard.release(Key.enter)
autopy.key.tap(autopy.key.Code.RETURN)
sleep(1)
keyboard.press(Key.enter)
keyboard.release(Key.enter)
autopy.key.tap(autopy.key.Code.RETURN)
sleep(1.5)
for _ in range(3):
keyboard.tap(Key.tab)
autopy.key.tap(autopy.key.Code.TAB)
sleep(0.5)
keyboard.tap(Key.enter)
autopy.key.tap(autopy.key.Code.RETURN)
sleep(1)
return self

Expand Down
37 changes: 37 additions & 0 deletions tests/address_bar_and_search/test_bing_search_codes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pytest
from selenium.webdriver import Firefox

from modules.browser_object import Navigation, TabBar
from modules.page_object import AboutPrefs

SEARCH_ENGINE = "Bing"
SEARCH_TERM = "earth"
TAB_TITLE = f"{SEARCH_TERM} - Search"
BING_CODES = ["form=MOZLBR&pc=MOZI", "pc=MOZI&form=MOZLBR"]


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


def test_bing_search_codes(driver: Firefox):
"""
C3029767 - Verify that Search Code Testing: Bing - US is correctly displayed and functional.
"""
nav = Navigation(driver)
prefs = AboutPrefs(driver)
tab = TabBar(driver)

# Go to search engine settings
nav.open_searchmode_switcher_settings()

# Change the default search engine
prefs.search_engine_dropdown().select_option(SEARCH_ENGINE)

# Open a tab and verify Bing search code
driver.get("about:newtab")
nav.search(SEARCH_TERM)
tab.expect_title_contains(TAB_TITLE)
assert any(code in driver.current_url for code in BING_CODES)
nav.clear_awesome_bar()
Loading