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
13 changes: 3 additions & 10 deletions SELECTOR_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3769,9 +3769,9 @@ Location: Bookmark panel
Path to .json: modules/data/pane_ui.components.json
```
```
Selector Name: toolbar-blank-space
Selector Data: customizableui-special-spring1
Description: Blank space in the toolbar
Selector Name: toolbarspring
Selector Data: customizableui-special-spring2
Description: toolbarspring
Location: Toolbar
Path to .json: modules/data/navigation.components.json
```
Expand Down Expand Up @@ -4156,13 +4156,6 @@ Description: Ungroup the tab group
Location: Menu that opens when right click on the tab group label
Path to .json: modules/data/tab_bar.components.json
```
```
Selector Name: tabgroup-save-and-close-group
Selector Data: "tabGroupEditor_saveAndCloseGroup"
Description: Save and close the tab group
Location: Menu that opens when right click on the tab group label
Path to .json: modules/data/tab_bar.components.json
```
#### text_area_form_autofill
```
Selector Name: street-address-textarea
Expand Down
4 changes: 4 additions & 0 deletions manifests/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ 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:
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()
8 changes: 8 additions & 0 deletions modules/data/navigation.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,5 +687,13 @@
"selectorData": "customizableui-special-spring1",
"strategy": "id",
"groups": []
},

"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(5)

# 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