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
22 changes: 7 additions & 15 deletions SELECTOR_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -1949,20 +1949,6 @@ Selector Data: coontext-searchselect
Description: Context menu option to search selected text with the engine set as default
Location: Context menu - topsite context menu
```
```
Selector Name: context-menu-open-link-in-new_container_tab
Selector Data: context-openlinkinusercontext-menu"
Description: Open linkin new container tab context menu item
Location: Newpage topsites tile context menu
Path to .json: modules/data/context_menu.components.json
```
```
Selector Name: context-menu-open-link-in-container-work
Selector Data: menuitem[data-l10n-id='user-context-work']"
Description: Open link in container "Work" context submenu item
Location: Newpage topsites tile submenu context menu, secodn option
Path to .json: modules/data/context_menu.components.json
```
#### credit_card_fill
```
Selector Name: form-field
Expand Down Expand Up @@ -3384,6 +3370,13 @@ Description: Tab container label
Location: URL bar when a tab container is active
Path to .json: modules/data/navigation.components.json
```
```
Selector Name: back-button
Selector Data: back-button
Description: Back button from the toolbar
Location: Toolbar
Path to .json: modules/data/navigation.components.json
```
#### panel_ui
```
Selector name: panel-ui-button
Expand Down Expand Up @@ -3573,7 +3566,6 @@ Location: On the hamburger menu
Path to .json: modules/data/panel_ui.components.json
```
```
Selector name: panel-menu-item-by-title
Selector Data: toolbarbutton.bookmark-item[label*='{title}']
Description: Bookmark or history item by title. This selector works for both bookmarks and history items since Firefox uses the same CSS class "bookmark-item" for both in the hamburger menu UI.
Location: On the hamburger menu > Bookmarks or History
Expand Down
6 changes: 5 additions & 1 deletion manifests/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ address_bar_and_search:
result: pass
splits:
- functional1
test_searchengine_result_page_load_on_reload_or_back:
result: pass
splits:
- functional1
test_searchbar_results_shown_in_a_new_tab:
result: unstable
splits:
- functional1
- functional1
test_searchmode_change_tab:
result: pass
splits:
Expand Down
12 changes: 12 additions & 0 deletions modules/browser_object_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,3 +1232,15 @@ def expect_container_label(self, label_expected: str):
"""
actual_label = self.get_element("tab-container-label").text
assert actual_label == label_expected

@BasePage.context_chrome
def click_back_button(self) -> None:
"""
Click the 'Back' button.
Waits until the button is visible and clickable before performing the click.
"""
# Wait until the element is visible and clickable
self.expect(lambda _: self.get_element("back-button").is_displayed())

# Click the button
self.get_element("back-button").click()
9 changes: 9 additions & 0 deletions modules/data/navigation.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,5 +681,14 @@
"selectorData": "#urlbar-results > div.urlbarView-row[type='clipboard']",
"strategy": "css",
"groups": ["doNotCache"]
},

"back-button": {
"selectorData": "back-button",
"strategy": "id",
"groups": [
"doNotCache"
]
}

}
17 changes: 17 additions & 0 deletions modules/page_object_about_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@ class AboutTelemetry(BasePage):

URL_TEMPLATE = "about:telemetry"

def open_raw_json_data(self):
"""
Opens the Raw JSON telemetry view:
- Click Raw category
- Switch to the new tab
- Click the Raw Data tab
"""

# Click "Raw" category
self.get_element("category-raw").click()

# Switching to the new tab opened by Raw
self.switch_to_new_tab()

# Click "Raw Data" tab
self.get_element("rawdata-tab").click()


class AboutNetworking(BasePage):
"""
Expand Down
4 changes: 1 addition & 3 deletions tests/address_bar_and_search/test_google_search_counts_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def test_google_search_counts_us(driver: Firefox):

telemetry = AboutTelemetry(driver).open()
sleep(WAIT_TELEMETRY_LOAD)
telemetry.get_element("category-raw").click()
telemetry.switch_to_new_tab()
telemetry.get_element("rawdata-tab").click()
telemetry.open_raw_json_data()

json_data = utils.decode_url(driver)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def test_google_withads_url_bar_us(driver):

about_telemetry = AboutTelemetry(driver).open()
sleep(5)
about_telemetry.get_element("category-raw").click()
about_telemetry.switch_to_new_tab()
about_telemetry.get_element("rawdata-tab").click()
about_telemetry.open_raw_json_data()

json_data = util.decode_url(driver)
if util.assert_json_value(json_data, path, 1):
Expand Down
4 changes: 1 addition & 3 deletions tests/address_bar_and_search/test_sap_google_adclick.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def test_sap_google_adclick(driver: Firefox):

telemetry = AboutTelemetry(driver).open()
sleep(SLEEP_BEFORE_VERIFICATION)
telemetry.get_element("category-raw").click()
telemetry.switch_to_new_tab()
telemetry.get_element("rawdata-tab").click()
telemetry.open_raw_json_data()

json_data = utils.decode_url(driver)
assert utils.assert_json_value(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
from time import sleep

import pytest
from selenium.webdriver import Firefox

from modules.browser_object_navigation import Navigation
from modules.browser_object_tabbar import TabBar
from modules.page_object_about_pages import AboutTelemetry
from modules.util import Utilities

TEXT = "Firefox"
SEARCHBAR_PATH = (
'$..["browser.search.content.searchbar"].["google:tagged:firefox-b-1-d"]'
)


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


def test_searchengine_result_page_load_on_reload_or_back(driver: Firefox):
"""
C3028909 - Search Engine Result Page loads as a result of a reload or a back-button press
"""

# Instantiate objects
nav = Navigation(driver)
telemetry = AboutTelemetry(driver)
utils = Utilities()
tab = TabBar(driver)

# Go to "Customize Toolbar", drag Search bar to Toolbar and click Done
nav.add_search_bar_to_toolbar()

# Using the search bar perform a search
nav.search_bar_search(TEXT)
sleep(3)

# Press back button from the browser menu
nav.click_back_button()

# Go to about:telemetry -> Raw JSON -> Raw data
telemetry.open()
telemetry.open_raw_json_data()

# Verify "browser.search.content.searchbar": { "google:tagged:firefox-b-d": 1}*
json_data = utils.decode_url(driver)
searchbar_ping = utils.assert_json_value(json_data, SEARCHBAR_PATH, 1)
assert searchbar_ping, f"Telemetry path not found: {SEARCHBAR_PATH}"

# Open new tab and perform a new search in the search bar
tab.new_tab_by_button()
nav.search_bar_search(TEXT)

# Press reload button
nav.refresh_page()

# Go back to raw data page and reload it
driver.switch_to.window(driver.window_handles[1])
nav.refresh_page()
telemetry.get_element("rawdata-tab").click()

# Verify "browser.search.content.searchbar": { "google:tagged:firefox-b-d": 2}*
json_data = utils.decode_url(driver)
ping_value = utils.assert_json_value(json_data, SEARCHBAR_PATH, 2)
assert ping_value, f"Telemetry path not found or value mismatch: {SEARCHBAR_PATH}"
Loading