Skip to content

Commit c0ac1a5

Browse files
Merge pull request #87 from RedisInsight/feature/e2e
e2e - CLI and Workbench
2 parents e0e5cdc + 1eb664f commit c0ac1a5

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

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

Lines changed: 46 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,47 @@ 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+
//Unselect group from list
130+
await cliPage.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
131+
//Search per command
132+
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
133+
//Verify results in the output
134+
const commandsCount = await cliPage.cliHelperOutputTitles.count;
135+
for(let i = 0; i < commandsCount; i++){
136+
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(timeSeriesCommands[i], 'Results in the output contains searched value');
137+
}
138+
});
139+
test('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
140+
const commandForSearch = 'GRAPH.';
141+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
142+
//Open CLI
143+
await t.click(cliPage.cliExpandButton);
144+
//Select group from list and remeber commands
145+
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
146+
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
147+
let graphCommands = [];
148+
for(let i = 0; i < commandsFilterCount; i++) {
149+
graphCommands.push(await cliPage.cliHelperOutputTitles.nth(i).textContent);
150+
}
151+
//Unselect group from list
152+
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
153+
//Search per command
154+
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
155+
//Verify results in the output
156+
const commandsCount = await cliPage.cliHelperOutputTitles.count;
157+
for(let i = 0; i < commandsCount; i++){
158+
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
159+
}
160+
});

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)