@@ -241,4 +241,87 @@ describe("Transforms", () => {
241
241
cy . contains ( `"${ TRANSFORM_ID } " is enabled` ) ;
242
242
} ) ;
243
243
} ) ;
244
+
245
+ describe ( "can be created in continuous mode" , ( ) => {
246
+ it ( "successfully" , ( ) => {
247
+ // Confirm we loaded empty state
248
+ cy . contains ( "Transform jobs help you create a materialized view on top of existing data." ) ;
249
+
250
+ // Route to create transform page
251
+ cy . contains ( "Create transform" ) . click ( { force : true } ) ;
252
+
253
+ // Type in transform ID
254
+ cy . get ( `input[placeholder="my-transformjob1"]` ) . type ( TRANSFORM_ID , { force : true } ) ;
255
+
256
+ // Get description input box
257
+ cy . get ( `textarea[data-test-subj="description"]` ) . focus ( ) . type ( "some description" ) ;
258
+
259
+ // Enter source index
260
+ cy . get ( `div[data-test-subj="sourceIndexCombobox"]` )
261
+ . find ( `input[data-test-subj="comboBoxSearchInput"]` )
262
+ . focus ( )
263
+ . type ( "opensearch_dashboards_sample_data_ecommerce{enter}" ) ;
264
+
265
+ // Enter target index
266
+ cy . get ( `div[data-test-subj="targetIndexCombobox"]` )
267
+ . find ( `input[data-test-subj="comboBoxSearchInput"]` )
268
+ . focus ( )
269
+ . type ( "test_transform{enter}" ) ;
270
+
271
+ // Click the next button
272
+ cy . get ( "button" ) . contains ( "Next" ) . click ( { force : true } ) ;
273
+
274
+ // Confirm that we got to step 2 of creation page
275
+ cy . contains ( "Select fields to transform" ) ;
276
+
277
+ cy . get ( `button[data-test-subj="category.keywordOptionsPopover"]` ) . click ( { force : true } ) ;
278
+
279
+ cy . contains ( "Group by terms" ) . click ( { force : true } ) ;
280
+
281
+ // Confirm group was added
282
+ cy . contains ( "category.keyword_terms" ) ;
283
+
284
+ // Add aggregable field
285
+ cy . contains ( "50 columns hidden" ) . click ( { force : true } ) ;
286
+ cy . contains ( "taxless_total_price" ) . click ( { force : true } ) ;
287
+ // Click out of the window
288
+ cy . contains ( "Select fields to transform" ) . click ( { force : true } ) ;
289
+
290
+ cy . get ( `button[data-test-subj="taxless_total_priceOptionsPopover"]` ) . click ( { force : true } ) ;
291
+
292
+ cy . contains ( "Aggregate by avg" ) . click ( { force : true } ) ;
293
+
294
+ // Confirm agg was added
295
+ cy . contains ( "avg_taxless_total_price" ) ;
296
+
297
+ // Click the next button
298
+ cy . get ( "button" ) . contains ( "Next" ) . click ( { force : true } ) ;
299
+
300
+ // Confirm that we got to step 3 of creation page
301
+ cy . contains ( "Job enabled by default" ) ;
302
+
303
+ // Make the transform continuous
304
+ cy . get ( "[id=yes]" ) . click ( { force : true } ) ;
305
+
306
+ // Click the next button
307
+ cy . get ( "button" ) . contains ( "Next" ) . click ( { force : true } ) ;
308
+
309
+ // Confirm that we got to step 4 of creation page
310
+ cy . contains ( "Review and create" ) ;
311
+
312
+ // Confirm that the transform is continuous
313
+ cy . contains ( "Continuous, every" ) ;
314
+
315
+ // Click the create button
316
+ cy . get ( "button" ) . contains ( "Create" ) . click ( { force : true } ) ;
317
+
318
+ // Verify that sample data is add by checking toast notification
319
+ cy . contains ( `Transform job "${ TRANSFORM_ID } " successfully created.` ) ;
320
+ cy . location ( "hash" ) . should ( "contain" , "transforms" ) ;
321
+ cy . get ( `button[data-test-subj="transformLink_${ TRANSFORM_ID } "]` ) ;
322
+
323
+ // The continuous column should say 'Yes'
324
+ cy . contains ( "Yes" ) ;
325
+ } ) ;
326
+ } ) ;
244
327
} ) ;
0 commit comments