Skip to content

Commit ccb697c

Browse files
e2e - CLI and Workbench
1 parent cadd93d commit ccb697c

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const addRedisDatabasePage = new AddRedisDatabasePage();
1818
const defaultHelperText = 'Enter any command in CLI or use search to see detailed information.';
1919
const COMMAND_APPEND = 'APPEND';
2020
const COMMAND_GROUP_SET = 'Set';
21+
const COMMAND_GROUP_TIMESERIES = 'TimeSeries';
22+
const COMMAND_GROUP_GRAPH = 'Graph';
2123

2224
fixture `CLI Command helper`
2325
.meta({ type: 'critical_path' })
@@ -112,3 +114,49 @@ test('Verify that when user has used search and apply filters, search results in
112114
//Check that command from 'Set' group was found
113115
await t.expect(cliPage.cliHelperOutputTitles.withText('SADD').exists).ok('Proper command was found');
114116
});
117+
test('Verify that user can type TS. in Command helper and see commands from RedisTimeSeries commands.json', async t => {
118+
const commandForSearch = 'TS.';
119+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
120+
//Open CLI
121+
await t.click(cliPage.cliExpandButton);
122+
//Select group from list and remeber commands
123+
await cliPage.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
124+
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
125+
let timeSeriesCommands = [];
126+
for(let i = 0; i < commandsFilterCount; i++) {
127+
timeSeriesCommands.push(await cliPage.cliHelperOutputTitles.nth(i).textContent);
128+
}
129+
//Reload Page
130+
await t.eval(() => location.reload());
131+
//Search per command
132+
await t.click(cliPage.cliExpandButton);
133+
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
134+
//Verify results in the output
135+
const commandsCount = await cliPage.cliHelperOutputTitles.count;
136+
for(let i = 0; i < commandsCount; i++){
137+
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(timeSeriesCommands[i], 'Results in the output contains searched value');
138+
}
139+
});
140+
test('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
141+
const commandForSearch = 'GRAPH.';
142+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
143+
//Open CLI
144+
await t.click(cliPage.cliExpandButton);
145+
//Select group from list and remeber commands
146+
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
147+
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
148+
let graphCommands = [];
149+
for(let i = 0; i < commandsFilterCount; i++) {
150+
graphCommands.push(await cliPage.cliHelperOutputTitles.nth(i).textContent);
151+
}
152+
//Reload Page
153+
await t.eval(() => location.reload());
154+
//Search per command
155+
await t.click(cliPage.cliExpandButton);
156+
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
157+
//Verify results in the output
158+
const commandsCount = await cliPage.cliHelperOutputTitles.count;
159+
for(let i = 0; i < commandsCount; i++){
160+
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
161+
}
162+
});

tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,14 @@ test('Verify that when user enters in CLI RediSearch/JSON commands (FT.CREATE, F
109109
await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHints[commands.indexOf(command)], `The hints with arguments for command ${command}`);
110110
}
111111
});
112+
test('Verify that user can type AI command in CLI and see agruments in hints from RedisAI commands.json', async t => {
113+
const commandHints = 'key [META] [BLOB]';
114+
const command = 'ai.modelget';
115+
await addNewStandaloneDatabase(ossStandaloneConfig);
116+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
117+
//Open CLI and type AI command
118+
await t.click(cliPage.cliExpandButton);
119+
await t.typeText(cliPage.cliCommandInput, command, { replace: true });
120+
//Verify the hints
121+
await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHints, `The hints with arguments for command ${command}`);
122+
});

0 commit comments

Comments
 (0)