@@ -149,35 +149,12 @@ function addSchedule() {
149149}
150150
151151function clickScheduleItem ( scheduleName ) {
152- // TODO: Replace with cy.interceptApi after it's enhanced to wait conditionally on request trigger
153- // Flag to check if the request is fired
154- let requestFired = false ;
155- // Intercepting the API call
156- cy . intercept (
157- {
158- method : 'POST' ,
159- pathname : '/ops/tree_select' ,
160- query : { text : scheduleName } ,
161- } ,
162- // This callback function will be called when the request is fired,
163- // from which the requestFired flag will be set to true
164- ( ) => ( requestFired = true )
165- ) . as ( 'getCreatedScheduleApi' ) ;
166- // Triggering the action that will fire the API call,
167- // which is selecting the created schedule
152+ // Selecting the created schedule
168153 cy . selectAccordionItem ( [
169154 MANAGEIQ_REGION_ACCORDION_ITEM ,
170155 SCHEDULES_ACCORDION_ITEM ,
171156 scheduleName ,
172157 ] ) ;
173- // Wait for the API call to complete if it was fired
174- // This is to ensure that the test does not fail if the request was not fired
175- cy . then ( ( ) => {
176- // If the request was fired, wait for the alias
177- if ( requestFired ) {
178- cy . wait ( '@getCreatedScheduleApi' ) ;
179- }
180- } ) ;
181158}
182159
183160function deleteSchedule ( scheduleName ) {
@@ -199,15 +176,10 @@ describe('Automate Schedule form operations: Settings > Application Settings > S
199176 // Expand Settings accordion panel
200177 cy . accordion ( SETTINGS_OPTION ) ;
201178 // Select Schedules accordion item
202- cy . interceptApi ( {
203- alias : 'treeSelectApi' ,
204- urlPattern : / \/ o p s \/ t r e e _ s e l e c t \? i d = .* & t e x t = .* / ,
205- triggerFn : ( ) =>
206- cy . selectAccordionItem ( [
207- MANAGEIQ_REGION_ACCORDION_ITEM ,
208- SCHEDULES_ACCORDION_ITEM ,
209- ] ) ,
210- } ) ;
179+ cy . selectAccordionItem ( [
180+ MANAGEIQ_REGION_ACCORDION_ITEM ,
181+ SCHEDULES_ACCORDION_ITEM ,
182+ ] ) ;
211183 } ) ;
212184
213185 it ( 'Validate visibility of elements and dynamic rendering based on dropdown changes' , ( ) => {
0 commit comments