@@ -25,13 +25,14 @@ function closeAnyOpenPopover() {
2525 cy . get ( 'body' ) . type ( '{esc}' , { force : true } ) ;
2626}
2727
28- function pickFirstType ( ) {
28+ function pickSampleResourceType ( ) {
2929 // Click the SuperSelect trigger (shows either selected text or "Select a type…")
3030 cy . contains ( 'button.euiSuperSelectControl' , / S e l e c t a t y p e … | .+ / ) . click ( ) ;
3131
32- // Choose the first real item in the dropdown (ignore placeholder)
33- // EUI renders items as listbox > button; pick the first enabled option
34- cy . get ( '[role="listbox"] button:enabled' ) . first ( ) . click ( ) ;
32+ // Click the "Sample Resource" option in the dropdown
33+ cy . get ( '[role="listbox"]' ) . within ( ( ) => {
34+ cy . contains ( 'button:enabled' , / ^ S a m p l e R e s o u r c e $ / ) . click ( ) ;
35+ } ) ;
3536
3637 // Close dropdown
3738 closeAnyOpenPopover ( ) ;
@@ -85,11 +86,11 @@ function openFirstRowModal() {
8586}
8687
8788function addRecipientAndSubmit ( expectLabel : 'Share' | 'Update Access' ) {
88- // Ensure there is at least one action-group panel (create one if missing)
89+ // Ensure there is at least one access-levels panel (create one if missing)
8990 cy . get ( '@overlay' ) . then ( ( $ov ) => {
90- if ( $ov . text ( ) . includes ( 'No action-groups added yet.' ) ) {
91+ if ( $ov . text ( ) . includes ( 'No access-levels added yet.' ) ) {
9192 cy . wrap ( $ov )
92- . contains ( 'button' , / A d d a c t i o n - g r o u p / i)
93+ . contains ( 'button' , / A d d a c c e s s - l e v e l / i)
9394 . click ( ) ;
9495 }
9596 } ) ;
@@ -164,14 +165,14 @@ describe('Resource Access Management Dashboard', () => {
164165
165166 it ( 'selects the first available type and loads the table (rows may be empty)' , ( ) => {
166167 cy . visit ( BASE + ROUTE ) ;
167- pickFirstType ( ) ;
168+ pickSampleResourceType ( ) ;
168169 // Table exists whether or not there are rows
169170 findTable ( ) ;
170171 } ) ;
171172
172173 it ( 'opens Share/Update modal on first row (if rows exist), adds a recipient, and submits' , ( ) => {
173174 cy . visit ( BASE + ROUTE ) ;
174- pickFirstType ( ) ;
175+ pickSampleResourceType ( ) ;
175176 findTable ( ) ;
176177
177178 // If there are zero rows, gracefully skip the modal flow
0 commit comments