@@ -40,7 +40,7 @@ describe('Creating Workflows Using Various Methods', () => {
40
40
cy . visit ( FF_URL . WORKFLOWS , { timeout : FF_TIMEOUT } ) ;
41
41
} ) ;
42
42
43
- it ( 'create workflow using import ' , ( ) => {
43
+ it ( 'Import workflow with valid configuration ' , ( ) => {
44
44
CURRENT_TENANT . newTenant = 'global' ;
45
45
cy . wait ( 20000 ) ;
46
46
cy . getElementByDataTestId ( 'importWorkflowButton' , { timeout : FF_TIMEOUT } )
@@ -67,7 +67,7 @@ describe('Creating Workflows Using Various Methods', () => {
67
67
. click ( ) ;
68
68
} ) ;
69
69
70
- it ( 'Workflow Creation with Improper Import File ' , ( ) => {
70
+ it ( 'Attempt to import workflow with invalid configuration ' , ( ) => {
71
71
cy . getElementByDataTestId ( 'importWorkflowButton' , { timeout : FF_TIMEOUT } )
72
72
. should ( 'be.visible' )
73
73
. click ( ) ;
@@ -82,15 +82,20 @@ describe('Creating Workflows Using Various Methods', () => {
82
82
) ;
83
83
} ) ;
84
84
85
- it ( 'create workflow using Semantic Search template' , ( ) => {
85
+ it ( 'Create workflow using semantic search template' , ( ) => {
86
86
cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
87
87
. should ( 'be.visible' )
88
88
. click ( ) ;
89
89
cy . contains ( 'h3' , 'Semantic Search' , { timeout : FF_TIMEOUT } )
90
90
. should ( 'be.visible' )
91
91
. parents ( '.euiCard' )
92
92
. within ( ( ) => {
93
- cy . contains ( 'button' , 'Go' ) . click ( ) ;
93
+ cy . contains ( 'button' , 'Create' ) . click ( ) ;
94
+ } ) ;
95
+ cy . contains ( 'label' , 'Name' )
96
+ . invoke ( 'attr' , 'for' )
97
+ . then ( ( id ) => {
98
+ cy . get ( `#${ id } ` ) . clear ( ) . type ( 'semantic_search' ) ;
94
99
} ) ;
95
100
cy . getElementByDataTestId ( 'optionalConfigurationButton' , {
96
101
timeout : FF_TIMEOUT ,
@@ -100,7 +105,6 @@ describe('Creating Workflows Using Various Methods', () => {
100
105
cy . getElementByDataTestId ( 'selectDeployedModel' )
101
106
. should ( 'be.visible' )
102
107
. click ( ) ;
103
- cy . get ( '.euiSuperSelect__item' ) . should ( 'be.visible' ) ;
104
108
cy . get ( '.euiSuperSelect__item' ) . contains ( 'BedRock' ) . click ( ) ;
105
109
cy . contains ( 'label' , 'Text field' )
106
110
. invoke ( 'attr' , 'for' )
@@ -114,16 +118,14 @@ describe('Creating Workflows Using Various Methods', () => {
114
118
cy . getElementByDataTestId ( 'selectDataToImportButton' )
115
119
. should ( 'be.visible' )
116
120
. click ( ) ;
117
- cy . getElementByDataTestId ( 'uploadSourceDataButton' )
118
- . should ( 'be.visible' )
119
- . click ( ) ;
121
+ cy . get ( `[data-text="Upload file"]` ) . should ( 'be.visible' ) . click ( ) ;
120
122
const filePath = `cypress/fixtures/${ FF_FIXTURE_BASE_PATH } semantic_search/source_data.json` ;
121
123
cy . get ( 'input[type=file]' ) . selectFile ( filePath ) ;
122
124
cy . getElementByDataTestId ( 'updateSourceDataButton' )
123
125
. should ( 'be.visible' )
124
126
. click ( ) ;
125
127
cy . mockIngestion ( ( ) => {
126
- cy . getElementByDataTestId ( 'runIngestionButton ')
128
+ cy . getElementByTestId ( 'updateAndRunIngestButton ')
127
129
. should ( 'be.visible' )
128
130
. click ( ) ;
129
131
} ) ;
@@ -161,85 +163,21 @@ describe('Creating Workflows Using Various Methods', () => {
161
163
cy . getElementByDataTestId ( 'updateSearchQueryButton' )
162
164
. should ( 'be.visible' )
163
165
. click ( ) ;
164
- cy . mockSemanticSearchIndexSearch ( ( ) => {
165
- cy . getElementByDataTestId ( 'runQueryButton' ) . should ( 'be.visible' ) . click ( ) ;
166
- } ) ;
167
- // Checking Run query response
168
- cy . sa_getElementByText ( 'button.euiTab' , 'Search response' )
169
- . should ( 'be.visible' )
170
- . click ( ) ;
171
-
172
- cy . fixture ( FF_FIXTURE_BASE_PATH + 'semantic_search/search_response' ) . then (
173
- ( ) => {
174
- cy . get ( '#tools_panel_id' ) . should ( 'be.visible' ) ;
175
- }
176
- ) ;
177
- } ) ;
178
-
179
- it ( 'create workflow using Sentiment Analysis template' , ( ) => {
180
- cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
181
- . should ( 'be.visible' )
182
- . click ( ) ;
183
- cy . contains ( 'h3' , 'Sentiment Analysis' , { timeout : FF_TIMEOUT } )
184
- . should ( 'be.visible' )
185
- . parents ( '.euiCard' )
186
- . within ( ( ) => {
187
- cy . contains ( 'button' , 'Go' ) . click ( ) ;
188
- } ) ;
189
- cy . getElementByDataTestId ( 'quickConfigureCreateButton' )
190
- . should ( 'be.visible' )
191
- . click ( ) ;
192
- cy . url ( ) . should ( 'include' , WORKFLOW_DETAIL_URL_SEGMENT ) ;
166
+ cy . getElementByTestId ( 'updateSearchButton' ) . should ( 'be.visible' ) . click ( ) ;
167
+ cy . getElementByTestId ( 'searchButton' ) . should ( 'be.visible' ) . click ( ) ;
168
+ // TODO: further search response validation can be completed when the UI is finalized in how it is displayed.
193
169
} ) ;
194
170
195
- it ( 'create workflow using Hybrid Search template' , ( ) => {
196
- cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
197
- . should ( 'be.visible' )
198
- . click ( ) ;
199
- cy . contains ( 'h3' , 'Hybrid Search' , { timeout : FF_TIMEOUT } )
200
- . should ( 'be.visible' )
201
- . parents ( '.euiCard' )
202
- . within ( ( ) => {
203
- cy . contains ( 'button' , 'Go' ) . click ( ) ;
204
- } ) ;
205
- cy . getElementByDataTestId ( 'quickConfigureCreateButton' )
206
- . should ( 'be.visible' )
207
- . click ( ) ;
208
- cy . url ( ) . should ( 'include' , WORKFLOW_DETAIL_URL_SEGMENT ) ;
171
+ it ( 'Create workflow from hybrid search template' , ( ) => {
172
+ createPreset ( 'Hybrid Search' ) ;
209
173
} ) ;
210
174
211
- it ( 'create workflow using Multimodal Search template' , ( ) => {
212
- cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
213
- . should ( 'be.visible' )
214
- . click ( ) ;
215
- cy . contains ( 'h3' , 'Multimodal Search' , { timeout : FF_TIMEOUT } )
216
- . should ( 'be.visible' )
217
- . parents ( '.euiCard' )
218
- . within ( ( ) => {
219
- cy . contains ( 'button' , 'Go' ) . click ( ) ;
220
- } ) ;
221
- cy . getElementByDataTestId ( 'quickConfigureCreateButton' )
222
- . should ( 'be.visible' )
223
- . click ( ) ;
224
- cy . url ( ) . should ( 'include' , WORKFLOW_DETAIL_URL_SEGMENT ) ;
175
+ it ( 'Create workflow from multimodal template' , ( ) => {
176
+ createPreset ( 'Multimodal Search' ) ;
225
177
} ) ;
226
178
227
- it ( 'create workflow using Retrieval-Augmented Generation (RAG) template' , ( ) => {
228
- cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
229
- . should ( 'be.visible' )
230
- . click ( ) ;
231
- cy . contains ( 'h3' , 'Retrieval-Augmented Generation (RAG)' , {
232
- timeout : FF_TIMEOUT ,
233
- } )
234
- . should ( 'be.visible' )
235
- . parents ( '.euiCard' )
236
- . within ( ( ) => {
237
- cy . contains ( 'button' , 'Go' ) . click ( ) ;
238
- } ) ;
239
- cy . getElementByDataTestId ( 'quickConfigureCreateButton' )
240
- . should ( 'be.visible' )
241
- . click ( ) ;
242
- cy . url ( ) . should ( 'include' , WORKFLOW_DETAIL_URL_SEGMENT ) ;
179
+ it ( 'Create workflow from custom template' , ( ) => {
180
+ createPreset ( 'Custom' ) ;
243
181
} ) ;
244
182
245
183
after ( ( ) => {
@@ -249,3 +187,27 @@ describe('Creating Workflows Using Various Methods', () => {
249
187
}
250
188
} ) ;
251
189
} ) ;
190
+
191
+ // Reusable fn to check the preset exists, and able to create it, and navigate to its details page.
192
+ function createPreset ( presetName ) {
193
+ cy . getElementByDataTestId ( 'createWorkflowButton' , { timeout : FF_TIMEOUT } )
194
+ . should ( 'be.visible' )
195
+ . click ( ) ;
196
+ cy . contains ( 'h3' , presetName , { timeout : FF_TIMEOUT } )
197
+ . should ( 'be.visible' )
198
+ . parents ( '.euiCard' )
199
+ . within ( ( ) => {
200
+ cy . contains ( 'button' , 'Create' ) . click ( ) ;
201
+ } ) ;
202
+ cy . contains ( 'label' , 'Name' )
203
+ . invoke ( 'attr' , 'for' )
204
+ . then ( ( id ) => {
205
+ cy . get ( `#${ id } ` )
206
+ . clear ( )
207
+ . type ( presetName . toLowerCase ( ) . replace ( / \s / g, '' ) ) ;
208
+ } ) ;
209
+ cy . getElementByDataTestId ( 'quickConfigureCreateButton' )
210
+ . should ( 'be.visible' )
211
+ . click ( ) ;
212
+ cy . url ( ) . should ( 'include' , WORKFLOW_DETAIL_URL_SEGMENT ) ;
213
+ }
0 commit comments