@@ -182,19 +182,30 @@ Cypress.Commands.add('openReviewAssignment', (familyName) => {
182
182
} ) ;
183
183
184
184
185
- Cypress . Commands . add ( 'openWorkflowMenu' , ( name ) => {
186
- cy . get ( `[data-cy="active-modal"] nav a:contains("${ name } ")` ) . click ( ) ;
185
+ Cypress . Commands . add ( 'openWorkflowMenu' , ( name , subitem = null ) => {
186
+ if ( subitem ) {
187
+ cy . get ( `[data-cy="active-modal"] nav a:contains("${ name } ")` ) . contains ( subitem ) . click ( )
188
+ } else {
189
+ cy . get ( `[data-cy="active-modal"] nav a:contains("${ name } ")` ) . click ( ) ;
190
+
191
+ }
187
192
cy . get ( '[data-cy="active-modal"] h2' ) . contains ( name ) ;
188
193
} ) ;
189
194
190
195
196
+ Cypress . Commands . add ( 'openReviewAssignment' , ( familyName ) => {
197
+ cy . contains ( 'table tr' , familyName ) . within ( ( ) => {
198
+ cy . get ( 'button' ) . click ( )
199
+ } )
200
+ } ) ;
191
201
192
202
193
203
194
- Cypress . Commands . add ( 'findSubmissionAsEditor' , ( username , password , familyName , context ) => {
204
+ Cypress . Commands . add ( 'findSubmissionAsEditor' , ( username , password , familyName , context = null , viewName = null ) => {
195
205
context = context || 'publicknowledge' ;
206
+ viewName = viewName || 'Active submissions' ;
196
207
cy . login ( username , password , context ) ;
197
- cy . get ( 'nav' ) . contains ( 'Active submissions' ) . click ( ) ;
208
+ cy . get ( 'nav' ) . contains ( viewName ) . click ( ) ;
198
209
cy . contains ( 'table tr' , familyName ) . within ( ( ) => {
199
210
cy . get ( 'button' ) . contains ( 'View' ) . click ( )
200
211
} )
@@ -465,7 +476,7 @@ Cypress.Commands.add('submissionIsDeclined', () => {
465
476
} ) ;
466
477
467
478
Cypress . Commands . add ( 'isActiveStageTab' , ( stageName ) => {
468
- cy . get ( '[data-cy="active-modal"] nav .bg-selection-dark ' ) . contains ( stageName ) ;
479
+ cy . get ( '[data-cy="active-modal"] h2 ' ) . contains ( stageName ) ;
469
480
} ) ;
470
481
471
482
/**
0 commit comments