@@ -17,7 +17,7 @@ context('Create remote detector workflow', () => {
17
17
const TEST_TIMESTAMP_NAME = 'timestamp' ; // coming from single_index_response.json fixture
18
18
const TEST_INDEX_NAME = 'sample-ad-index' ;
19
19
const TEST_SECOND_INDEX_NAME = 'sample-ad-index-two' ;
20
- const TEST_REMOTE_INDEX = 'followCluster:sample-ad-index' ;
20
+ // const TEST_REMOTE_INDEX = 'followCluster:sample-ad-index';
21
21
22
22
// Clean up created resources
23
23
afterEach ( ( ) => {
@@ -97,6 +97,8 @@ context('Create remote detector workflow', () => {
97
97
// Index some sample data in local and follower cluster (remote)
98
98
beforeEach ( ( ) => {
99
99
cy . visit ( AD_URL . OVERVIEW , { timeout : 10000 } ) ;
100
+ cy . deleteAllIndices ( ) ;
101
+ cy . deleteADSystemIndices ( ) ;
100
102
const remoteEndpointTestData = `${ Cypress . env (
101
103
'remoteDataSourceNoAuthUrl'
102
104
) } /${ TEST_INDEX_NAME } /_bulk`;
@@ -178,10 +180,10 @@ context('Create remote detector workflow', () => {
178
180
179
181
cy . getElementByTestId ( 'indicesFilter' ) . click ( ) ;
180
182
cy . wait ( 1000 ) ;
181
- cy . contains (
182
- '.euiComboBoxOption__content' ,
183
+
184
+ cy . getElementByTestId ( 'indicesFilter' ) . type (
183
185
`${ remoteClusterName } :sample-ad-index`
184
- ) . click ( ) ;
186
+ ) ;
185
187
186
188
selectTopItemFromFilter ( 'timestampFilter' , false ) ;
187
189
@@ -213,7 +215,9 @@ context('Create remote detector workflow', () => {
213
215
cy . getElementByTestId ( 'detectorDescriptionCell' ) . contains (
214
216
TEST_DETECTOR_DESCRIPTION
215
217
) ;
216
- cy . getElementByTestId ( 'indexNameCell' ) . contains ( TEST_REMOTE_INDEX ) ;
218
+ cy . getElementByTestId ( 'indexNameCell' ) . contains (
219
+ `${ remoteClusterName } :sample-ad-index`
220
+ ) ;
217
221
cy . getElementByTestId ( 'timestampNameCell' ) . contains ( TEST_TIMESTAMP_NAME ) ;
218
222
cy . getElementByTestId ( 'featureTable' ) . contains ( TEST_FEATURE_NAME ) ;
219
223
@@ -250,19 +254,28 @@ context('Create remote detector workflow', () => {
250
254
251
255
cy . wait ( 3000 ) ;
252
256
257
+ // Open the combo box
253
258
cy . getElementByTestId ( 'indicesFilter' ) . click ( ) ;
254
- cy . wait ( 1000 ) ;
259
+ cy . wait ( 500 ) ;
255
260
256
- cy . contains (
257
- '.euiComboBoxOption__content' ,
258
- `${ remoteClusterName } :sample-ad-index`
259
- ) . click ( ) ;
260
- cy . contains ( '.euiComboBoxOption__content' , 'sample-ad-index' ) . click ( ) ;
261
+ // Type and select the first option
262
+ cy . getElementByTestId ( 'indicesFilter' ) . type ( `sample-ad-index` ) ;
263
+ cy . wait ( 500 ) ; // Wait for the dropdown to populate
264
+ cy . get ( '.euiComboBoxOption__content' )
265
+ . contains ( `${ remoteClusterName } :sample-ad-index` )
266
+ . click ( ) ;
261
267
262
- cy . contains (
263
- '.euiComboBoxOption__content' ,
264
- `${ remoteClusterName } :sample-ad-index-two`
265
- ) . click ( ) ;
268
+ // Type and select the second option
269
+ cy . getElementByTestId ( 'indicesFilter' ) . type ( 'sample-ad-index' ) ;
270
+ cy . wait ( 500 ) ;
271
+ cy . get ( '.euiComboBoxOption__content' ) . contains ( 'sample-ad-index' ) . click ( ) ;
272
+
273
+ // Type and select the third option
274
+ cy . getElementByTestId ( 'indicesFilter' ) . type ( `sample-ad-index-two` ) ;
275
+ cy . wait ( 500 ) ;
276
+ cy . get ( '.euiComboBoxOption__content' )
277
+ . contains ( `${ remoteClusterName } :sample-ad-index-two` )
278
+ . click ( ) ;
266
279
267
280
selectTopItemFromFilter ( 'timestampFilter' , false ) ;
268
281
0 commit comments