File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed 
cypress/e2e/ui/Settings/Application-Settings Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable no-undef */ 
2+ 
3+ // Menu options 
4+ const  SETTINGS_MENU_OPTION  =  'Settings' ; 
5+ const  APP_SETTINGS_MENU_OPTION  =  'Application Settings' ; 
6+ 
7+ // Accordion items 
8+ const  DIAGNOSTICS_ACCORDION_ITEM  =  'Diagnostics' ; 
9+ const  MANAGEIQ_REGION_ACCORDION_ITEM  =  / ^ M a n a g e I Q   R e g i o n : / ; 
10+ 
11+ // Tab names 
12+ const  DATABASE_TAB_LABEL  =  'Database' ; 
13+ 
14+ describe ( 'Settings > Application Settings > Diagnostics' ,  ( )  =>  { 
15+   beforeEach ( ( )  =>  { 
16+     cy . login ( ) ; 
17+     cy . menu ( SETTINGS_MENU_OPTION ,  APP_SETTINGS_MENU_OPTION ) ; 
18+     cy . accordion ( DIAGNOSTICS_ACCORDION_ITEM ) ; 
19+   } ) ; 
20+ 
21+   describe ( 'ManageIQ Region' ,  ( )  =>  { 
22+     beforeEach ( ( )  =>  { 
23+       cy . selectAccordionItem ( [ MANAGEIQ_REGION_ACCORDION_ITEM ] ) ; 
24+     } ) ; 
25+ 
26+     it ( 'should navigate to the Database tab' ,  ( )  =>  { 
27+       // Intercept the API call when clicking on the Database tab 
28+       cy . interceptApi ( { 
29+         alias : 'getDatabaseTabInfo' , 
30+         urlPattern : '/ops/change_tab?tab_id=diagnostics_database' , 
31+         triggerFn : ( )  =>  cy . tabs ( {  tabLabel : DATABASE_TAB_LABEL  } ) , 
32+       } ) ; 
33+ 
34+       // Verify the Database tab content is loaded 
35+       cy . get ( `@getDatabaseTabInfo` ) . then ( ( getCall )  =>  { 
36+         expect ( getCall . state ) . to . equal ( 'Complete' ) ; 
37+       } ) ; 
38+ 
39+       // Verify we're on the Database tab 
40+       cy . get ( '.tab-content' ) . contains ( DATABASE_TAB_LABEL ) . should ( 'be.visible' ) ; 
41+     } ) ; 
42+   } ) ; 
43+ } ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments