|
| 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