File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ Actual tests can be found in `cypress/integration/ui/`.
2727
2828ManageIQ implements the following cypress extensions:
2929
30+ ##### explorer
31+
32+ * ` cy.accordion(title) ` - open an accordion panel. title: String for the accordion title for the accordion panel to open.
33+ * ` cy.accordionItem(name) ` - click on a record in the accordion panel. name: String for the record to click in the accordion panel.
34+
3035##### login
3136
3237` cy.login() ` - logs in as admin
Original file line number Diff line number Diff line change 11/* eslint-disable no-undef */
2- // cy.accordion('Catalog Items') - click accordion, unless already expanded
2+ // title: String of the accordion title for the accordian panel to open.
33Cypress . Commands . add ( 'accordion' , ( text ) => {
4- cy . get ( '#main-content' ) ; // ensure screen loads first
5-
4+ cy . get ( '#main-content' ) ; // ensure screen loads first
65 let ret = cy . get ( '#accordion' )
76 . find ( '.panel-title a' )
87 . contains ( new RegExp ( `^${ text } $` ) ) ;
98
109 ret . then ( ( el ) => {
11- // do not collapse if expanded
10+ // Do not collapse if already expanded
1211 if ( el . is ( '.collapsed' ) ) {
13- el . click ( ) ;
12+ el . trigger ( 'click' ) ;
1413 }
1514 return el ;
1615 } ) ;
1716
1817 return ret . parents ( '.panel' ) ;
1918} ) ;
19+
20+ // name: String of the record in the accordion panel to click
21+ Cypress . Commands . add ( 'accordionItem' , ( name ) => {
22+ cy . get ( '#main-content' ) ; // ensure screen loads first
23+
24+ cy . get ( '.list-group-item' ) . contains ( name ) . click ( ) ;
25+ } ) ;
Original file line number Diff line number Diff line change 4040// ***********************************************************
4141
4242// Commands
43+ import './commands/explorer.js'
4344import './commands/gtl.js'
4445import './commands/login.js'
4546import './commands/menu.js'
You can’t perform that action at this time.
0 commit comments