@@ -223,10 +223,8 @@ context('Create remote detector workflow', () => {
223223
224224 cy . getElementByTestId ( 'indicesFilter' ) . type ( TEST_INDEX_NAME ) ;
225225 cy . wait ( 500 ) ;
226- cy . contains (
227- '.euiComboBoxOption__content' ,
228- `${ remoteClusterName } :${ TEST_INDEX_NAME } `
229- ) . click ( ) ;
226+ cy . get ( `button[title="${ remoteClusterName } :${ TEST_INDEX_NAME } "]` ) . click ( ) ;
227+
230228 cy . wait ( 1500 ) ;
231229
232230 selectTopItemFromFilter ( 'timestampFilter' , false ) ;
@@ -256,6 +254,17 @@ context('Create remote detector workflow', () => {
256254 // Configure model step
257255 cy . getElementByTestId ( 'featureNameTextInput-0' ) . type ( TEST_FEATURE_NAME ) ;
258256 selectTopItemFromFilter ( 'featureFieldTextInput-0' , false ) ;
257+
258+ // Suggest parameters
259+ cy . getElementByTestId ( 'suggestParametersButton' ) . click ( ) ;
260+ cy . getElementByTestId ( 'suggestParametersDialogTitle' ) . should ( 'exist' ) ;
261+ cy . getElementByTestId ( 'generateSuggestionsButton' ) . click ( ) ;
262+ cy . getElementByTestId ( 'suggestedParametersResult' ) . should ( 'exist' ) ;
263+ cy . getElementByTestId ( 'useSuggestedParametersButton' ) . click ( ) ;
264+
265+ // The dialog should close and we're back on the model configuration page
266+ cy . getElementByTestId ( 'suggestParametersDialogTitle' ) . should ( 'not.exist' ) ;
267+
259268 cy . getElementByTestId ( 'configureModelNextButton' ) . click ( ) ;
260269 cy . getElementByTestId ( 'configureOrEditModelConfigurationTitle' ) . should (
261270 'not.exist'
@@ -324,10 +333,9 @@ context('Create remote detector workflow', () => {
324333 cy . getElementByTestId ( 'indicesFilter' ) . type ( 'sample-ad-index-t' ) ;
325334 cy . wait ( 1000 ) ;
326335
327- cy . get ( '.euiComboBoxOption__content' )
328- . contains ( `${ remoteClusterName } :${ TEST_SECOND_INDEX_NAME } ` )
329- . should ( 'exist' )
330- . click ( ) ;
336+ cy . get (
337+ `button[title="${ remoteClusterName } :${ TEST_SECOND_INDEX_NAME } "]`
338+ ) . click ( ) ;
331339
332340 selectTopItemFromFilter ( 'timestampFilter' , false ) ;
333341
@@ -354,6 +362,20 @@ context('Create remote detector workflow', () => {
354362 . should ( 'exist' )
355363 . click ( { force : true } ) ;
356364
365+ // wait for feature field to be populated
366+ // otherwise suggest API reports illegal arguments exception
367+ cy . wait ( 500 ) ;
368+
369+ // Suggest parameters
370+ cy . getElementByTestId ( 'suggestParametersButton' ) . click ( ) ;
371+ cy . getElementByTestId ( 'suggestParametersDialogTitle' ) . should ( 'exist' ) ;
372+ cy . getElementByTestId ( 'generateSuggestionsButton' ) . click ( ) ;
373+ cy . getElementByTestId ( 'suggestedParametersResult' ) . should ( 'exist' ) ;
374+ cy . getElementByTestId ( 'useSuggestedParametersButton' ) . click ( ) ;
375+
376+ // The dialog should close and we're back on the model configuration page
377+ cy . getElementByTestId ( 'suggestParametersDialogTitle' ) . should ( 'not.exist' ) ;
378+
357379 cy . getElementByTestId ( 'configureModelNextButton' ) . click ( ) ;
358380 cy . getElementByTestId ( 'configureOrEditModelConfigurationTitle' ) . should (
359381 'not.exist'
0 commit comments