@@ -37,7 +37,6 @@ fixture `Autocomplete for entered commands in search and query`
37
37
// Create 3 keys and index
38
38
await browserPage . Cli . sendCommandsInCli ( commands ) ;
39
39
await t . click ( browserPage . NavigationPanel . workbenchButton ) ;
40
- await t . pressKey ( 'ctrl+space' ) ;
41
40
} )
42
41
. afterEach ( async ( ) => {
43
42
// Clear and delete database
@@ -51,7 +50,7 @@ test('Verify that tutorials can be opened from Workbench', async t => {
51
50
await t . click ( workbenchPage . getTutorialLinkLocator ( 'sq-intro' ) ) ;
52
51
await t . expect ( workbenchPage . InsightsPanel . sidePanel . exists ) . ok ( 'Insight panel is not opened' ) ;
53
52
const tab = await browserPage . InsightsPanel . setActiveTab ( ExploreTabs . Tutorials ) ;
54
- await t . expect ( tab . preselectArea . textContent ) . contains ( 'EXACT MATCH ' , 'the tutorial page is incorrect' ) ;
53
+ await t . expect ( tab . preselectArea . textContent ) . contains ( 'INTRODUCTION ' , 'the tutorial page is incorrect' ) ;
55
54
} ) ;
56
55
test ( 'Verify that user can use show more to see command fully in 2nd tooltip' , async t => {
57
56
const commandDetails = [
@@ -92,12 +91,13 @@ test('Verify full commands suggestions with index and query for FT.AGGREGATE', a
92
91
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withText ( 'FT.AGGREGATE' ) . exists ) . ok ( 'FT.AGGREGATE auto-suggestions are not displayed' ) ;
93
92
94
93
// Select command and check result
94
+ await t . typeText ( workbenchPage . queryInput , '.AG' , { replace : false } ) ;
95
95
await t . pressKey ( 'enter' ) ;
96
96
let script = await workbenchPage . queryInputScriptArea . textContent ;
97
97
await t . expect ( script . replace ( / \s / g, ' ' ) ) . contains ( 'FT.AGGREGATE ' , 'Result of sent command exists' ) ;
98
98
99
99
// Verify that user can see the list of all the indexes in database when put a space after only FT.SEARCH and FT.AGGREGATE commands
100
- await t . expect ( script . replace ( / \s / g, ' ' ) ) . contains ( `" ${ indexName1 } " "" ` , 'Index not suggested into input' ) ;
100
+ await t . expect ( script . replace ( / \s / g, ' ' ) ) . contains ( `' ${ indexName1 } ' 'query to search' ` , 'Index not suggested into input' ) ;
101
101
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( indexName1 ) . exists ) . ok ( 'Index not auto-suggested' ) ;
102
102
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( indexName2 ) . exists ) . ok ( 'All indexes not auto-suggested' ) ;
103
103
@@ -115,10 +115,12 @@ test('Verify full commands suggestions with index and query for FT.AGGREGATE', a
115
115
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( 'city' ) . exists ) . ok ( 'Index field not auto-suggested after starting typing' ) ;
116
116
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . count ) . eql ( 1 , 'Wrong index fields suggested after typing first letter' ) ;
117
117
118
- // Verify contextual suggestions after typing letters for commands
118
+ // Go out of index field
119
+ await t . pressKey ( 'tab' ) ;
119
120
await t . pressKey ( 'tab' ) ;
120
121
await t . pressKey ( 'right' ) ;
121
122
await t . pressKey ( 'space' ) ;
123
+ // Verify contextual suggestions after typing letters for commands
122
124
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( 'APPLY' ) . exists ) . ok ( 'FT.AGGREGATE arguments not suggested' ) ;
123
125
await t . typeText ( workbenchPage . queryInput , 'g' , { replace : false } ) ;
124
126
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . nth ( 0 ) . textContent ) . contains ( 'GROUPBY' , 'Argument not suggested after typing first letters' ) ;
@@ -141,23 +143,22 @@ test('Verify full commands suggestions with index and query for FT.AGGREGATE', a
141
143
await t . typeText ( workbenchPage . queryInput , 'stud' , { replace : false } ) ;
142
144
143
145
await t . pressKey ( 'space' ) ;
144
- await t . debug ( ) ;
145
146
// Verify multiple argument option suggestions
146
147
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . nth ( 0 ) . textContent ) . contains ( 'REDUCE' , 'Incorrect order of suggested arguments' ) ;
147
148
// Verify complex command sequences like nargs and properties are suggested accurately for GROUPBY
148
- const expectedText = `FT.AGGREGATE " ${ indexName1 } " " @city" GROUPBY 1 "London" REDUCE SUM 1 @students AS stud REDUCE` . trim ( ) . replace ( / \s + / g, ' ' ) ;
149
+ const expectedText = `FT.AGGREGATE ' ${ indexName1 } ' ' @city:{tag} ' GROUPBY 1 "London" REDUCE SUM 1 @students AS stud REDUCE` . trim ( ) . replace ( / \s + / g, ' ' ) ;
149
150
await t . expect ( ( await workbenchPage . queryInputForText . innerText ) . trim ( ) . replace ( / \s + / g, ' ' ) ) . contains ( expectedText , 'Incorrect order of entered arguments' ) ;
150
151
} ) ;
151
152
test ( 'Verify full commands suggestions with index and query for FT.SEARCH' , async t => {
152
- await t . typeText ( workbenchPage . queryInput , 'FT.SE ' , { replace : true } ) ;
153
+ await t . typeText ( workbenchPage . queryInput , 'FT.SEA ' , { replace : true } ) ;
153
154
// Select command and check result
154
155
await t . pressKey ( 'enter' ) ;
155
156
const script = await workbenchPage . queryInputScriptArea . textContent ;
156
157
await t . expect ( script . replace ( / \s / g, ' ' ) ) . contains ( 'FT.SEARCH ' , 'Result of sent command exists' ) ;
157
158
158
- await t . pressKey ( 'tab' ) ;
159
+ await t . pressKey ( 'tab' )
159
160
// Select '@city' field
160
- await workbenchPage . selectFieldUsingAutosuggest ( 'city' ) ;
161
+ await workbenchPage . selectFieldUsingAutosuggest ( 'city' )
161
162
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( 'DIALECT' ) . exists ) . ok ( 'FT.SEARCH arguments not suggested' ) ;
162
163
await t . typeText ( workbenchPage . queryInput , 'n' , { replace : false } ) ;
163
164
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . nth ( 0 ) . textContent ) . contains ( 'NOCONTENT' , 'Argument not suggested after typing first letters' ) ;
@@ -199,7 +200,7 @@ test('Verify full commands suggestions with index and query for FT.PROFILE(SEARC
199
200
await workbenchPage . selectFieldUsingAutosuggest ( 'city' ) ;
200
201
// Verify that there are no more suggestions
201
202
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . exists ) . notOk ( 'Additional invalid commands suggested' ) ;
202
- const expectedText = `FT.PROFILE " ${ indexName1 } " SEARCH QUERY " @city" ` . trim ( ) . replace ( / \s + / g, ' ' ) ;
203
+ const expectedText = `FT.PROFILE ' ${ indexName1 } ' SEARCH QUERY ' @city:{tag} ' ` . trim ( ) . replace ( / \s + / g, ' ' ) ;
203
204
// Verify command entered correctly
204
205
await t . expect ( ( await workbenchPage . queryInputForText . innerText ) . trim ( ) . replace ( / \s + / g, ' ' ) ) . contains ( expectedText , 'Incorrect order of entered arguments' ) ;
205
206
} ) ;
@@ -220,7 +221,7 @@ test('Verify full commands suggestions with index and query for FT.PROFILE(AGGRE
220
221
await workbenchPage . selectFieldUsingAutosuggest ( 'city' ) ;
221
222
// Verify that there are no more suggestions
222
223
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . exists ) . notOk ( 'Additional invalid commands suggested' ) ;
223
- const expectedText = `FT.PROFILE " ${ indexName1 } " AGGREGATE QUERY " @city" ` . trim ( ) . replace ( / \s + / g, ' ' ) ;
224
+ const expectedText = `FT.PROFILE ' ${ indexName1 } ' AGGREGATE QUERY ' @city:{tag} ' ` . trim ( ) . replace ( / \s + / g, ' ' ) ;
224
225
// Verify command entered correctly
225
226
await t . expect ( ( await workbenchPage . queryInputForText . innerText ) . trim ( ) . replace ( / \s + / g, ' ' ) ) . contains ( expectedText , 'Incorrect order of entered arguments' ) ;
226
227
} ) ;
@@ -238,7 +239,7 @@ test('Verify full commands suggestions with index and query for FT.EXPLAIN', asy
238
239
// Verify that there are no more suggestions
239
240
await t . pressKey ( 'space' ) ;
240
241
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . exists ) . notOk ( 'Additional invalid commands suggested' ) ;
241
- const expectedText = `FT.EXPLAIN " ${ indexName1 } " " @city" DIALECT dialectTest` . trim ( ) . replace ( / \s + / g, ' ' ) ;
242
+ const expectedText = `FT.EXPLAIN ' ${ indexName1 } ' ' @city:{tag} ' DIALECT dialectTest` . trim ( ) . replace ( / \s + / g, ' ' ) ;
242
243
// Verify command entered correctly
243
244
await t . expect ( ( await workbenchPage . queryInputForText . innerText ) . trim ( ) . replace ( / \s + / g, ' ' ) ) . contains ( expectedText , 'Incorrect order of entered arguments' ) ;
244
245
} ) ;
@@ -259,11 +260,12 @@ test('Verify commands suggestions for APPLY and FILTER', async t => {
259
260
await t . typeText ( workbenchPage . queryInput , '@' , { replace : false } ) ;
260
261
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . visible ) . ok ( 'Suggestions not displayed' ) ;
261
262
await t . typeText ( workbenchPage . queryInput , 'location' , { replace : false } ) ;
262
- await t . typeText ( workbenchPage . queryInput , ', \' 40.7128,-74.0060\' ' ) ;
263
+ await t . typeText ( workbenchPage . queryInput , ', " 40.7128,-74.0060" ' ) ;
263
264
for ( let i = 0 ; i < 3 ; i ++ ) {
264
265
await t . pressKey ( 'right' ) ;
265
266
}
266
267
await t . pressKey ( 'space' ) ;
268
+ await t . typeText ( workbenchPage . queryInput , 'a' ) ;
267
269
await t . pressKey ( 'tab' ) ;
268
270
await t . typeText ( workbenchPage . queryInput , 'apply_key' , { replace : false } ) ;
269
271
@@ -277,7 +279,6 @@ test('Verify commands suggestions for APPLY and FILTER', async t => {
277
279
await t . pressKey ( 'space' ) ;
278
280
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( 'GROUPBY' ) . exists ) . ok ( 'query can not be prolong' ) ;
279
281
} ) ;
280
-
281
282
test ( 'Verify REDUCE commands' , async t => {
282
283
await t . typeText ( workbenchPage . queryInput , `FT.AGGREGATE ${ indexName1 } "*" GROUPBY 1 @location` , { replace : true } ) ;
283
284
await t . pressKey ( 'space' ) ;
@@ -288,6 +289,7 @@ test('Verify REDUCE commands', async t => {
288
289
289
290
// set value of reduce
290
291
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . visible ) . ok ( 'Suggestions not displayed' ) ;
292
+ // Select COUNT
291
293
await t . typeText ( workbenchPage . queryInput , 'CO' ) ;
292
294
await t . pressKey ( 'enter' ) ;
293
295
await t . typeText ( workbenchPage . queryInput , '0' ) ;
@@ -325,7 +327,7 @@ test('Verify suggestions for fields', async t => {
325
327
// verify suggestions for geo
326
328
await t . typeText ( workbenchPage . queryInput , 'l' ) ;
327
329
await t . pressKey ( 'tab' ) ;
328
- await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.AGGREGATE " ${ indexName1 } " " @location:[lon lat radius unit]" ` ) ;
330
+ await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.AGGREGATE ' ${ indexName1 } ' ' @location:[lon lat radius unit] ' ` ) ;
329
331
330
332
// verify for numeric
331
333
await t . typeText ( workbenchPage . queryInput , 'FT.AGGREGATE ' , { replace : true } ) ;
@@ -336,10 +338,10 @@ test('Verify suggestions for fields', async t => {
336
338
await t . typeText ( workbenchPage . queryInput , '@' ) ;
337
339
await t . typeText ( workbenchPage . queryInput , 's' ) ;
338
340
await t . pressKey ( 'tab' ) ;
339
- await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.AGGREGATE " ${ indexName1 } " " @students:[range]" ` ) ;
341
+ await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.AGGREGATE ' ${ indexName1 } ' ' @students:[range] ' ` ) ;
340
342
} ) ;
341
-
342
- test
343
+ // Unskip after fixing https://redislabs.atlassian.net/browse/RI-6212
344
+ test . skip
343
345
. after ( async ( ) => {
344
346
// Clear and delete database
345
347
await apiKeyRequests . deleteKeyByNameApi ( keyName , ossStandaloneConfig . databaseName ) ;
349
351
await databaseAPIRequests . deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
350
352
} ) ( 'Verify commands suggestions for CREATE' , async t => {
351
353
await t . typeText ( workbenchPage . queryInput , 'FT.CREATE ' , { replace : true } ) ;
352
- await t . pressKey ( 'enter' ) ;
353
354
// Verify that indexes are not suggested for FT.CREATE
354
355
await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . exists ) . notOk ( 'Existing index suggested' ) ;
355
356
@@ -376,5 +377,15 @@ test
376
377
// Select SORTABLE
377
378
await t . typeText ( workbenchPage . queryInput , 'so' , { replace : false } ) ;
378
379
await t . pressKey ( 'tab' ) ;
379
- await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.CREATE ${ indexName3 } FILTER filterNew SCHEMA field_name TEXT SORTABLE` ) ;
380
+
381
+ // Enter second field to SCHEMA
382
+ await t . typeText ( workbenchPage . queryInput , 'field2_num' , { replace : false } ) ;
383
+ await t . pressKey ( 'space' ) ;
384
+ await t . expect ( workbenchPage . MonacoEditor . monacoSuggestion . withExactText ( 'NUMERIC' ) . exists ) . ok ( 'query can not be prolong' ) ;
385
+
386
+ // Select NUMERIC keyword
387
+ await t . typeText ( workbenchPage . queryInput , 'so' , { replace : false } ) ;
388
+ await t . pressKey ( 'tab' ) ;
389
+
390
+ await t . expect ( ( await workbenchPage . MonacoEditor . getTextFromMonaco ( ) ) . trim ( ) ) . eql ( `FT.CREATE ${ indexName3 } FILTER filterNew SCHEMA field_name TEXT SORTABLE field2_num NUMERIC` ) ;
380
391
} ) ;
0 commit comments