Skip to content

Commit e2ea36b

Browse files
authored
Merge pull request #760 from krishpdev/test-customize-button-is-displayed
Add test to verify customize firefox tab displays
2 parents 3700207 + f0c93b3 commit e2ea36b

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

modules/data/customize_firefox.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@
2222
"selectorData": "wrapper-search-container",
2323
"strategy": "id",
2424
"groups": []
25+
},
26+
27+
"customize-page": {
28+
"selectorData": "customization-container",
29+
"strategy": "id",
30+
"groups": []
2531
}
2632
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_panel_ui import PanelUi
5+
from modules.browser_object_tabbar import TabBar
6+
from modules.page_object import ExamplePage
7+
from modules.page_object_customize_firefox import CustomizeFirefox
8+
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "134463"
13+
14+
15+
def test_customize_button_displayed_in_tab_bar(driver: Firefox):
16+
"""
17+
C134463 - Verify that the Customize button is displayed in the tab bar
18+
and the Customize tab persists when switching tabs.
19+
"""
20+
21+
panel_ui = PanelUi(driver)
22+
tabs = TabBar(driver)
23+
custom_page = CustomizeFirefox(driver)
24+
25+
# Open an initial example page
26+
example = ExamplePage(driver)
27+
example.open()
28+
29+
# Open customize firefox toolbar tab
30+
panel_ui.open_panel_menu()
31+
panel_ui.navigate_to_customize_toolbar()
32+
33+
tabs.click_tab_by_index(1)
34+
35+
# Verify that the customize firefox tab is open in background
36+
with driver.context(driver.CONTEXT_CHROME):
37+
customize_tab = tabs.get_tab(2)
38+
assert customize_tab is not None, "Customize tab should still exist."
39+
assert tabs.get_tab_title(customize_tab) == "Customize Firefox"
40+
assert customize_tab.get_attribute("visuallyselected") != "true", (
41+
"Customize tab should be unfocused."
42+
)
43+
44+
# Verify that the customize firefox tab is opened and correct
45+
example.switch_to_new_tab()
46+
with driver.context(driver.CONTEXT_CHROME):
47+
element = custom_page.get_element("customize-page")
48+
assert element, "element not found"

0 commit comments

Comments
 (0)