@@ -34,65 +34,37 @@ describe('More Page Actions', () => {
3434 // Find the Getting started page and hover to reveal the more actions
3535 cy . task ( 'log' , 'Looking for Getting started page' ) ;
3636
37- // Find the page by its text content
38- cy . contains ( 'Getting started' ) . should ( 'exist' ) . and ( 'be.visible' ) ;
39-
40- // Hover over the page item to reveal the more actions button
41- cy . task ( 'log' , 'Hovering over page item to reveal more actions' ) ;
37+ // Hover over the Getting started page to reveal more actions
38+ cy . task ( 'log' , 'Hovering over Getting started page' ) ;
4239 cy . contains ( 'Getting started' )
43- . parents ( '[data-testid*="view-item"]' )
44- . first ( )
40+ . parent ( )
41+ . parent ( )
4542 . trigger ( 'mouseenter' , { force : true } )
46- . wait ( 500 ) ;
43+ . trigger ( 'mouseover' , { force : true } ) ;
4744
48- // Find and click the more actions button (...)
49- cy . task ( 'log' , 'Looking for more actions button' ) ;
50- cy . contains ( 'Getting started' )
51- . parents ( '[data-testid*="view-item"]' )
52- . first ( )
53- . within ( ( ) => {
54- // Try multiple ways to find the more actions button
55- cy . get ( '[data-testid="view-item-more-actions"]' )
56- . should ( 'exist' )
57- . and ( 'be.visible' )
58- . click ( { force : true } ) ;
59- } ) ;
45+ cy . wait ( 1000 ) ;
46+
47+ // Click the more actions button
48+ cy . task ( 'log' , 'Clicking more actions button' ) ;
49+ PageSelectors . moreActionsButton ( ) . first ( ) . click ( { force : true } ) ;
6050
6151 waitForReactUpdate ( 500 ) ;
6252
63- // Verify the popover is open
64- cy . task ( 'log' , 'Verifying popover is open' ) ;
65- cy . get ( '[data-testid="more-actions-popover"]' ) . should ( 'exist' ) . and ( 'be.visible' ) ;
66- cy . wait ( 500 ) ;
53+ // Verify the menu is open
54+ cy . task ( 'log' , 'Verifying menu is open' ) ;
55+ cy . get ( '[data-slot="dropdown-menu-content"]' , { timeout : 5000 } ) . should ( 'exist' ) ;
6756
6857 // Now verify the expected menu items
69- cy . task ( 'log' , 'Verifying menu items in popover' ) ;
70- cy . get ( '[data-testid="more-actions-popover"]' ) . within ( ( ) => {
71- // Check for Delete option
72- cy . task ( 'log' , 'Checking for Delete option' ) ;
73- cy . get ( '[data-testid="delete-page-option"]' )
74- . should ( 'exist' )
75- . and ( 'be.visible' )
76- . and ( 'contain.text' , 'Delete' ) ;
77-
78- // Check for Rename option
79- cy . task ( 'log' , 'Checking for Rename option' ) ;
80- cy . get ( '[data-testid="rename-page-option"]' )
81- . should ( 'exist' )
82- . and ( 'be.visible' )
83- . and ( 'contain.text' , 'Rename' ) ;
84-
85- // Check for Duplicate option
86- cy . task ( 'log' , 'Checking for Duplicate option' ) ;
87- cy . get ( '[data-testid="duplicate-page-option"]' )
88- . should ( 'exist' )
89- . and ( 'be.visible' )
90- . and ( 'contain.text' , 'Duplicate' ) ;
91-
92- // Optional: Check for additional menu items
93- cy . task ( 'log' , 'Successfully verified all core menu items in More actions popover' ) ;
58+ cy . task ( 'log' , 'Verifying menu items' ) ;
59+ cy . get ( '[data-slot="dropdown-menu-content"]' ) . within ( ( ) => {
60+ // Look for items by text content since test ids might vary
61+ cy . contains ( 'Delete' ) . should ( 'exist' ) ;
62+ cy . contains ( 'Duplicate' ) . should ( 'exist' ) ;
63+ cy . contains ( 'Move to' ) . should ( 'exist' ) ;
9464 } ) ;
9565
66+ cy . task ( 'log' , 'Successfully verified all core menu items' ) ;
67+
9668 // Close the popover
9769 cy . task ( 'log' , 'Closing popover' ) ;
9870 cy . get ( 'body' ) . click ( 0 , 0 ) ;
@@ -128,30 +100,23 @@ describe('More Page Actions', () => {
128100 cy . task ( 'log' , 'Hovering over the created page' ) ;
129101 PageSelectors . names ( )
130102 . last ( )
131- . parents ( '[data-testid*="view-item"]' )
132- . first ( )
103+ . parent ( )
104+ . parent ( )
133105 . trigger ( 'mouseenter' , { force : true } )
134- . wait ( 500 ) ;
106+ . trigger ( 'mouseover' , { force : true } ) ;
107+
108+ cy . wait ( 1000 ) ;
135109
136110 // Click the more actions button
137111 cy . task ( 'log' , 'Clicking more actions button' ) ;
138- PageSelectors . names ( )
139- . last ( )
140- . parents ( '[data-testid*="view-item"]' )
141- . first ( )
142- . within ( ( ) => {
143- cy . get ( '[data-testid="view-item-more-actions"]' )
144- . should ( 'exist' )
145- . and ( 'be.visible' )
146- . click ( { force : true } ) ;
147- } ) ;
112+ PageSelectors . moreActionsButton ( ) . first ( ) . click ( { force : true } ) ;
148113
149114 waitForReactUpdate ( 500 ) ;
150115
151116 // Click Rename option
152117 cy . task ( 'log' , 'Clicking Rename option' ) ;
153- cy . get ( '[data-testid="more-actions-popover "]' ) . within ( ( ) => {
154- cy . get ( '[data-testid="rename-page-option"] ') . click ( ) ;
118+ cy . get ( '[data-slot="dropdown-menu-content "]' ) . within ( ( ) => {
119+ cy . contains ( 'Rename ') . click ( ) ;
155120 } ) ;
156121
157122 waitForReactUpdate ( 500 ) ;
0 commit comments