@@ -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 ) {
@@ -215,15 +192,10 @@ describe('Automate Schedule form operations: Settings > Application Settings > S
215192 // Expand Settings accordion panel
216193 cy . accordion ( SETTINGS_OPTION ) ;
217194 // Select Schedules accordion item
218- cy . interceptApi ( {
219- alias : 'treeSelectApi' ,
220- urlPattern : / \/ o p s \/ t r e e _ s e l e c t \? i d = .* & t e x t = .* / ,
221- triggerFn : ( ) =>
222- cy . selectAccordionItem ( [
223- MANAGEIQ_REGION_ACCORDION_ITEM ,
224- SCHEDULES_ACCORDION_ITEM ,
225- ] ) ,
226- } ) ;
195+ cy . selectAccordionItem ( [
196+ MANAGEIQ_REGION_ACCORDION_ITEM ,
197+ SCHEDULES_ACCORDION_ITEM ,
198+ ] ) ;
227199 } ) ;
228200
229201 it ( 'Validate visibility of elements and dynamic rendering based on dropdown changes' , ( ) => {
0 commit comments