Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const addRedisDatabasePage = new AddRedisDatabasePage();
const defaultHelperText = 'Enter any command in CLI or use search to see detailed information.';
const COMMAND_APPEND = 'APPEND';
const COMMAND_GROUP_SET = 'Set';
const COMMAND_GROUP_TIMESERIES = 'TimeSeries';
const COMMAND_GROUP_GRAPH = 'Graph';

fixture `CLI Command helper`
.meta({ type: 'critical_path' })
Expand Down Expand Up @@ -112,3 +114,47 @@ test('Verify that when user has used search and apply filters, search results in
//Check that command from 'Set' group was found
await t.expect(cliPage.cliHelperOutputTitles.withText('SADD').exists).ok('Proper command was found');
});
test('Verify that user can type TS. in Command helper and see commands from RedisTimeSeries commands.json', async t => {
const commandForSearch = 'TS.';
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
//Open CLI
await t.click(cliPage.cliExpandButton);
//Select group from list and remeber commands
await cliPage.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
let timeSeriesCommands = [];
for(let i = 0; i < commandsFilterCount; i++) {
timeSeriesCommands.push(await cliPage.cliHelperOutputTitles.nth(i).textContent);
}
//Unselect group from list
await cliPage.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
//Search per command
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
//Verify results in the output
const commandsCount = await cliPage.cliHelperOutputTitles.count;
for(let i = 0; i < commandsCount; i++){
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(timeSeriesCommands[i], 'Results in the output contains searched value');
}
});
test('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
const commandForSearch = 'GRAPH.';
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
//Open CLI
await t.click(cliPage.cliExpandButton);
//Select group from list and remeber commands
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
let graphCommands = [];
for(let i = 0; i < commandsFilterCount; i++) {
graphCommands.push(await cliPage.cliHelperOutputTitles.nth(i).textContent);
}
//Unselect group from list
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
//Search per command
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
//Verify results in the output
const commandsCount = await cliPage.cliHelperOutputTitles.count;
for(let i = 0; i < commandsCount; i++){
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
}
});
11 changes: 11 additions & 0 deletions tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,14 @@ test('Verify that when user enters in CLI RediSearch/JSON commands (FT.CREATE, F
await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHints[commands.indexOf(command)], `The hints with arguments for command ${command}`);
}
});
test('Verify that user can type AI command in CLI and see agruments in hints from RedisAI commands.json', async t => {
const commandHints = 'key [META] [BLOB]';
const command = 'ai.modelget';
await addNewStandaloneDatabase(ossStandaloneConfig);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
//Open CLI and type AI command
await t.click(cliPage.cliExpandButton);
await t.typeText(cliPage.cliCommandInput, command, { replace: true });
//Verify the hints
await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHints, `The hints with arguments for command ${command}`);
});