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/`.
27
27
28
28
ManageIQ implements the following cypress extensions:
29
29
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
+
30
35
##### login
31
36
32
37
` cy.login() ` - logs in as admin
Original file line number Diff line number Diff line change 1
1
/* 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.
3
3
Cypress . Commands . add ( 'accordion' , ( text ) => {
4
- cy . get ( '#main-content' ) ; // ensure screen loads first
5
-
4
+ cy . get ( '#main-content' ) ; // ensure screen loads first
6
5
let ret = cy . get ( '#accordion' )
7
6
. find ( '.panel-title a' )
8
7
. contains ( new RegExp ( `^${ text } $` ) ) ;
9
8
10
9
ret . then ( ( el ) => {
11
- // do not collapse if expanded
10
+ // Do not collapse if already expanded
12
11
if ( el . is ( '.collapsed' ) ) {
13
- el . click ( ) ;
12
+ el . trigger ( 'click' ) ;
14
13
}
15
14
return el ;
16
15
} ) ;
17
16
18
17
return ret . parents ( '.panel' ) ;
19
18
} ) ;
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 40
40
// ***********************************************************
41
41
42
42
// Commands
43
+ import './commands/explorer.js'
43
44
import './commands/gtl.js'
44
45
import './commands/login.js'
45
46
import './commands/menu.js'
You can’t perform that action at this time.
0 commit comments