Skip to content

Commit 2506f01

Browse files
committed
[E2E] Tests with AI groups and changed command group name added
1 parent 887895e commit 2506f01

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const userAgreementPage = new UserAgreementPage();
1717
const addRedisDatabasePage = new AddRedisDatabasePage();
1818
const COMMAND_GROUP_JSON = 'JSON';
1919
const COMMAND_GROUP_SEARCH = 'Search';
20+
const COMMAND_GROUP_HyperLogLog = 'HyperLogLog';
2021

2122
fixture `CLI Command helper`
2223
.meta({ type: 'regression' })
@@ -47,7 +48,6 @@ test('Verify that user can see in Command helper and click on new group "JSON",
4748
//Check that command info is displayed on the page
4849
await t.expect(cliPage.cliReadMoreJSONCommandDocumentation().textContent).contains('JSON.SET');
4950
});
50-
5151
test('Verify that user can see in Command helper and click on new group "Search", can choose it and see list of commands in the group', async t => {
5252
const commandForCheck = 'FT.EXPLAIN';
5353
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
@@ -65,3 +65,63 @@ test('Verify that user can see in Command helper and click on new group "Search"
6565
//Check that command info is displayed on the page
6666
await t.expect(cliPage.cliReadMoreRediSearchCommandDocumentation().textContent).contains('FT.EXPLAIN');
6767
});
68+
test('Verify that user can see HyperLogLog title in Command Helper for this command group', async t => {
69+
const commandForCheck = 'PFCOUNT';
70+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
71+
//Open CLI
72+
await t.click(cliPage.cliExpandButton);
73+
//Select one command from the list
74+
await cliPage.selectFilterGroupType(COMMAND_GROUP_HyperLogLog);
75+
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
76+
//Verify results of opened command
77+
await t.expect(cliPage.cliHelperTitleArgs.textContent).eql('PFCOUNT key [key ...]', 'Selected command title');
78+
//Click on Read More link for selected command
79+
await t.click(cliPage.readMoreButton);
80+
//Check new opened window page with the correct URL
81+
await t.expect(getPageUrl()).contains('/pfcount');
82+
});
83+
test('Verify that user can see all separated groups for AI json file (model, tensor, inference, script)', async t => {
84+
const AIGroups = [
85+
'Model',
86+
'Script',
87+
'Inference',
88+
'Tensor'
89+
];
90+
const commandsForCheck = [
91+
'AI.MODELDEL',
92+
'AI.SCRIPTSTORE',
93+
'AI.SCRIPTEXECUTE',
94+
'AI.TENSORSET'
95+
];
96+
const commandArgumentsCheck = [
97+
'AI.MODELDEL key',
98+
'AI.SCRIPTSTORE key CPU|GPU [TAG tag] ENTRY_POINTS entry_point_count entry_point [entry_point ...]',
99+
'AI.SCRIPTEXECUTE key function [KEYS key_count key [key ...]] [INPUTS input_count input [input ...]] [ARGS arg_count arg [arg ...]] [OUTPUTS output_count output [output ...]] [TIMEOUT timeout]',
100+
'AI.TENSORSET key FLOAT|DOUBLE|INT8|INT16|INT32|INT64|UINT8|UINT16|STRING|BOOL shape [shape ...] [BLOB blob] [VALUES value [VALUES value ...]]'
101+
];
102+
const ExternalPage = [
103+
'/#aimodeldel',
104+
'/#aiscriptstore',
105+
'/#aiscriptexecute',
106+
'/#aitensorset'
107+
];
108+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
109+
//Open CLI
110+
await t.click(cliPage.cliExpandButton);
111+
let i = 0;
112+
while (i <= 3) {
113+
//Select one group from the list
114+
await cliPage.selectFilterGroupType(AIGroups[i]);
115+
//Click on the group
116+
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandsForCheck[i]));
117+
//Verify results of opened command
118+
await t.expect(cliPage.cliHelperTitleArgs.textContent).eql(commandArgumentsCheck[i], 'Selected command title');
119+
//Click on Read More link for selected command
120+
await t.click(cliPage.readMoreButton);
121+
//Check new opened window page with the correct URL
122+
await t.expect(getPageUrl()).contains(ExternalPage[i]);
123+
//Close the window with external link to switch to the application window
124+
await t.closeWindow();
125+
i++;
126+
}
127+
});

0 commit comments

Comments
 (0)