From d55cd47566824d1071b336cd9e060c10a298e6f0 Mon Sep 17 00:00:00 2001 From: kp <175162338+krishpdev@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:51:09 -0400 Subject: [PATCH 1/2] Add test to verify customize firefox tab displays --- tests/tabs/test_display_customize_button.py | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/tabs/test_display_customize_button.py diff --git a/tests/tabs/test_display_customize_button.py b/tests/tabs/test_display_customize_button.py new file mode 100644 index 000000000..5e83f88c9 --- /dev/null +++ b/tests/tabs/test_display_customize_button.py @@ -0,0 +1,47 @@ +import pytest +from selenium.webdriver import Firefox +from selenium.webdriver.common.by import By + +from modules.browser_object_panel_ui import PanelUi +from modules.browser_object_tabbar import TabBar +from modules.page_object import ExamplePage + + +@pytest.fixture() +def test_case(): + return "134463" + + +def test_customize_button_displayed_in_tab_bar(driver: Firefox): + """ + C134463 - Verify that the Customize button is displayed in the tab bar + and the Customize tab persists when switching tabs. + """ + + panel_ui = PanelUi(driver) + tabs = TabBar(driver) + + # Open an initial example page + example = ExamplePage(driver) + example.open() + + # Open customize firefox toolbar tab + panel_ui.open_panel_menu() + panel_ui.navigate_to_customize_toolbar() + + tabs.click_tab_by_index(1) + + # Verify that the customize firefox tab is open in background + with driver.context(driver.CONTEXT_CHROME): + customize_tab = tabs.get_tab(2) + assert customize_tab is not None, "Customize tab should still exist." + assert tabs.get_tab_title(customize_tab) == "Customize Firefox" + assert customize_tab.get_attribute("visuallyselected") != "true", ( + "Customize tab should be unfocused." + ) + + # Verify that the customize firefox tab is opened and correct + example.switch_to_new_tab() + with driver.context(driver.CONTEXT_CHROME): + element = driver.find_element(By.ID, "customization-container") + assert element, "element not found" From f0c93b328d82937e8f29a061cbebeed2fbe1e416 Mon Sep 17 00:00:00 2001 From: kp <175162338+krishpdev@users.noreply.github.com> Date: Thu, 28 Aug 2025 14:21:02 -0400 Subject: [PATCH 2/2] create selector for customize_firefox.components.json --- modules/data/customize_firefox.components.json | 6 ++++++ tests/tabs/test_display_customize_button.py | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/data/customize_firefox.components.json b/modules/data/customize_firefox.components.json index 5caa8f2ee..c20269f1d 100644 --- a/modules/data/customize_firefox.components.json +++ b/modules/data/customize_firefox.components.json @@ -22,5 +22,11 @@ "selectorData": "wrapper-search-container", "strategy": "id", "groups": [] + }, + + "customize-page": { + "selectorData": "customization-container", + "strategy": "id", + "groups": [] } } \ No newline at end of file diff --git a/tests/tabs/test_display_customize_button.py b/tests/tabs/test_display_customize_button.py index 5e83f88c9..38e14fdae 100644 --- a/tests/tabs/test_display_customize_button.py +++ b/tests/tabs/test_display_customize_button.py @@ -1,10 +1,10 @@ import pytest from selenium.webdriver import Firefox -from selenium.webdriver.common.by import By from modules.browser_object_panel_ui import PanelUi from modules.browser_object_tabbar import TabBar from modules.page_object import ExamplePage +from modules.page_object_customize_firefox import CustomizeFirefox @pytest.fixture() @@ -20,6 +20,7 @@ def test_customize_button_displayed_in_tab_bar(driver: Firefox): panel_ui = PanelUi(driver) tabs = TabBar(driver) + custom_page = CustomizeFirefox(driver) # Open an initial example page example = ExamplePage(driver) @@ -43,5 +44,5 @@ def test_customize_button_displayed_in_tab_bar(driver: Firefox): # Verify that the customize firefox tab is opened and correct example.switch_to_new_tab() with driver.context(driver.CONTEXT_CHROME): - element = driver.find_element(By.ID, "customization-container") + element = custom_page.get_element("customize-page") assert element, "element not found"