File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+ from selenium .webdriver import Firefox
3+
4+ from modules .browser_object import ContextMenu , TabBar
5+ from modules .page_object import ExamplePage
6+
7+
8+ @pytest .fixture ()
9+ def test_case ():
10+ return "134726"
11+
12+
13+ @pytest .mark .headed
14+ def test_close_pinned_tab_via_middle_click (driver : Firefox ):
15+ """
16+ C134726 - Verify middle-clicking pinned tab will close it
17+ """
18+
19+ example = ExamplePage (driver )
20+ example .open ()
21+ tabs = TabBar (driver )
22+ tab_menu = ContextMenu (driver )
23+
24+ # Open 2 new tabs
25+ for _ in range (2 ):
26+ tabs .new_tab_by_button ()
27+ tabs .wait_for_num_tabs (3 )
28+
29+ # Pin the first tab
30+ with driver .context (driver .CONTEXT_CHROME ):
31+ first_tab = tabs .get_tab (1 )
32+ tabs .context_click (first_tab )
33+ tab_menu .click_and_hide_menu ("context-menu-pin-tab" )
34+ assert tabs .is_pinned (first_tab ), "Expected the first tab to be pinned"
35+
36+ # Middle-click the pinned tab to close it
37+ tabs .middle_click (first_tab )
38+
39+ # Verify pinned tab was closed and 2 tabs remain
40+ tabs .wait_for_num_tabs (2 )
You can’t perform that action at this time.
0 commit comments