@@ -124,6 +124,9 @@ function addSchedule() {
124
124
. should ( 'be.enabled' ) // Checks if Save button is enabled once all required fields are filled
125
125
. click ( ) ,
126
126
} ) ;
127
+ return cy . then ( ( ) => {
128
+ return INITIAL_SCHEDULE_NAME ;
129
+ } ) ;
127
130
}
128
131
129
132
function clickScheduleItem ( scheduleName ) {
@@ -481,12 +484,15 @@ describe('Automate Schedule form operations: Settings > Application Settings > S
481
484
482
485
it ( 'Checking whether add, edit & delete schedule works' , ( ) => {
483
486
/* ===== Adding a schedule ===== */
484
- addSchedule ( ) ;
485
- cy . expect_flash ( flashClassMap . success , FLASH_MESSAGE_SCHEDULE_SAVED ) ;
487
+ addSchedule ( ) . then ( ( createdScheduleName ) => {
488
+ // createdScheduleName value will be "Test-name"
489
+ // Assert schedule saved flash message
490
+ cy . expect_flash ( flashClassMap . success , FLASH_MESSAGE_SCHEDULE_SAVED ) ;
491
+ // Selecting the schedule and intercepting the API call to get schedule details
492
+ clickScheduleItem ( createdScheduleName ) ;
493
+ } ) ;
486
494
487
495
/* ===== Editing a schedule ===== */
488
- // Selecting the schedule and intercepting the API call to get schedule details
489
- clickScheduleItem ( INITIAL_SCHEDULE_NAME ) ;
490
496
// Open edit schedule form
491
497
selectConfigMenu ( EDIT_SCHEDULE_CONFIG_OPTION ) ;
492
498
// Editing name and description
@@ -503,11 +509,13 @@ describe('Automate Schedule form operations: Settings > Application Settings > S
503
509
504
510
it ( 'Checking whether Cancel & Reset buttons work fine in the Edit form' , ( ) => {
505
511
/* ===== Adding a schedule ===== */
506
- addSchedule ( ) ;
512
+ addSchedule ( ) . then ( ( createdScheduleName ) => {
513
+ // createdScheduleName value will be "Test-name"
514
+ // Selecting the schedule and intercepting the API call to get schedule details
515
+ clickScheduleItem ( createdScheduleName ) ;
516
+ } ) ;
507
517
508
518
/* ===== Checking whether Reset button works ===== */
509
- // Selecting the schedule and intercepting the API call to get schedule details
510
- clickScheduleItem ( INITIAL_SCHEDULE_NAME ) ;
511
519
// Open edit schedule form
512
520
selectConfigMenu ( EDIT_SCHEDULE_CONFIG_OPTION ) ;
513
521
// Editing description and start date
0 commit comments