Skip to content

Commit d213a37

Browse files
committed
Merge branch 'main' into feature/bugfix
2 parents 53c8759 + be97a69 commit d213a37

File tree

7 files changed

+176
-5
lines changed

7 files changed

+176
-5
lines changed

redisinsight/ui/src/pages/workbench/components/wb-results/WBResults/WBResults.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ const WBResults = ({ historyItems = [], onQueryRun, onQueryDelete, scrollDivRef
2525
<EuiIcon
2626
type={theme === Theme.Dark ? MultiPlayIconDark : MultiPlayIconLight}
2727
className={styles.playIcon}
28+
data-testid="wb_no-results__icon"
2829
/>
29-
<EuiText className={styles.noResultsTitle} color="subdued">No results to display</EuiText>
30-
<EuiText className={styles.noResultsText} color="subdued">
30+
<EuiText className={styles.noResultsTitle} color="subdued" data-testid="wb_no-results__title">No results to display</EuiText>
31+
<EuiText className={styles.noResultsText} color="subdued" data-testid="wb_no-results__summary">
3132
Run Redis commands to get results or see the left menu to learn more
3233
</EuiText>
3334
</div>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Selector } from 'testcafe';
2+
3+
export class HelpCenterPage {
4+
5+
//------------------------------------------------------------------------------------------
6+
//DECLARATION OF TYPES: DOM ELEMENTS and UI COMPONENTS
7+
//*Assign the 'Selector' type to any element/component nested within the constructor.
8+
//------------------------------------------------------------------------------------------
9+
helpCenterPanel: Selector
10+
helpCenterSubmitBugButton: Selector
11+
helpCenterShortcutButton: Selector
12+
helpCenterReleaseNotesButton: Selector
13+
14+
constructor() {
15+
//-------------------------------------------------------------------------------------------
16+
//DECLARATION OF SELECTORS
17+
//*Declare all elements/components of the relevant page.
18+
//*Target any element/component via data-id, if possible!
19+
//*The following categories are ordered alphabetically (Alerts, Buttons, Checkboxes, etc.).
20+
//-------------------------------------------------------------------------------------------
21+
// BUTTONS
22+
this.helpCenterSubmitBugButton = Selector('[data-testid=submit-bug-btn]');
23+
this.helpCenterShortcutButton = Selector('[data-testid=shortcuts-btn]');
24+
this.helpCenterReleaseNotesButton = Selector('[data-testid=release-notes-btn]');
25+
// Panel
26+
this.helpCenterPanel = Selector('[data-testid=help-center]')
27+
}
28+
}

tests/e2e/pageObjects/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { SettingsPage } from './settings-page';
77
import { UserAgreementPage } from './user-agreement-page';
88
import { WorkbenchPage } from './workbench-page';
99
import { DatabaseOverviewPage } from './database-overview-page';
10+
import { HelpCenterPage } from './help-center-page';
11+
import { ShortcutsPage } from './shortcuts-page';
1012

1113
export {
1214
AddRedisDatabasePage,
@@ -17,5 +19,7 @@ export {
1719
SettingsPage,
1820
UserAgreementPage,
1921
WorkbenchPage,
20-
DatabaseOverviewPage
22+
DatabaseOverviewPage,
23+
HelpCenterPage,
24+
ShortcutsPage
2125
}

tests/e2e/pageObjects/my-redis-databases-page.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export class MyRedisDatabasePage {
1010
dbNameList: Selector
1111
settingsButton: Selector
1212
workbenchButton: Selector
13+
helpCenterButton: Selector
1314
myRedisDBButton: Selector
1415
toastCloseButton: Selector
1516
deleteDatabaseButton: Selector
@@ -32,6 +33,7 @@ export class MyRedisDatabasePage {
3233
//BUTTONS
3334
this.settingsButton = Selector('[data-testid=settings-page-btn]');
3435
this.workbenchButton = Selector('[data-testid=workbench-page-btn]');
36+
this.helpCenterButton = Selector('[data-testid=help-menu-button]');
3537
this.browserButton = Selector('[data-testid=browser-page-btn]');
3638
this.myRedisDBButton = Selector('[data-test-subj=home-page-btn]');
3739
this.deleteDatabaseButton = Selector('[data-testid^=delete-instance-]');
@@ -70,7 +72,7 @@ export class MyRedisDatabasePage {
7072
await t.click(this.confirmDeleteButton);
7173
}
7274
if (await this.toastCloseButton.exists) {
73-
await t.click(this.toastCloseButton);
75+
await t.click(this.toastCloseButton);
7476
}
7577
}
7678

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Selector } from 'testcafe';
2+
3+
export class ShortcutsPage {
4+
5+
//------------------------------------------------------------------------------------------
6+
//DECLARATION OF TYPES: DOM ELEMENTS and UI COMPONENTS
7+
//*Assign the 'Selector' type to any element/component nested within the constructor.
8+
//------------------------------------------------------------------------------------------
9+
10+
shortcutsPanel: Selector
11+
shortcutsTitle: Selector
12+
shortcutsDesktopApplicationSection: Selector
13+
shortcutsCLISection: Selector
14+
shortcutsWorkbenchSection: Selector
15+
shortcutsCloseButton: Selector
16+
17+
constructor() {
18+
//-------------------------------------------------------------------------------------------
19+
//DECLARATION OF SELECTORS
20+
//*Declare all elements/components of the relevant page.
21+
//*Target any element/component via data-id, if possible!
22+
//*The following categories are ordered alphabetically (Alerts, Buttons, Checkboxes, etc.).
23+
//-------------------------------------------------------------------------------------------
24+
// BUTTONS
25+
this.shortcutsTitle = Selector('[data-testid=shortcuts-title]');
26+
this.shortcutsDesktopApplicationSection = Selector('[data-test-subj="shortcuts-section-Desktop application"]');
27+
this.shortcutsCLISection = Selector('[data-test-subj=shortcuts-section-CLI]');
28+
this.shortcutsWorkbenchSection = Selector('[data-test-subj=shortcuts-section-Workbench]');
29+
this.shortcutsCloseButton = Selector('[data-test-subj=euiFlyoutCloseButton]')
30+
// Panel
31+
this.shortcutsPanel = Selector('[data-test-subj=shortcuts-flyout]');
32+
}
33+
}

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+
});
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import {
2+
UserAgreementPage,
3+
MyRedisDatabasePage,
4+
HelpCenterPage,
5+
ShortcutsPage
6+
} from '../../../pageObjects';
7+
import {
8+
commonUrl
9+
} from '../../../helpers/conf';
10+
11+
const userAgreementPage = new UserAgreementPage();
12+
const myRedisDatabasePage = new MyRedisDatabasePage();
13+
const helpCenterPage = new HelpCenterPage();
14+
const shortcutsPage = new ShortcutsPage();
15+
16+
fixture `Shortcuts`
17+
.meta({ type: 'regression' })
18+
.page(commonUrl)
19+
.beforeEach(async t => {
20+
await t.maximizeWindow();
21+
await userAgreementPage.acceptLicenseTerms();
22+
})
23+
24+
test('Verify that user can see a summary of Shortcuts by clicking "Keyboard Shortcuts" button in Help Center', async t => {
25+
// Click on help center icon
26+
await t.click(myRedisDatabasePage.helpCenterButton);
27+
// Verify that Help Center panel is opened
28+
await t.expect(helpCenterPage.helpCenterPanel.exists).ok('Help Center panel is opened');
29+
// Click on Shortcuts option
30+
await t.click(helpCenterPage.helpCenterShortcutButton);
31+
// Validate that Shortcuts panel is opened
32+
await t.expect(shortcutsPage.shortcutsPanel.exists).ok('Shortcuts panel is opened');
33+
// Validate Title and sections of Shortcuts
34+
await t.expect(shortcutsPage.shortcutsPanel.exists).ok('Shortcuts panel is opened');
35+
await t.expect(shortcutsPage.shortcutsTitle.exists).ok('shortcutsTitle is opened');
36+
await t.expect(shortcutsPage.shortcutsDesktopApplicationSection.exists).ok('shortcutsDesktopApplicationSection is opened');
37+
await t.expect(shortcutsPage.shortcutsCLISection.exists).ok('shortcutsCLISection is displayed');
38+
await t.expect(shortcutsPage.shortcutsWorkbenchSection.exists).ok('shortcutsWorkbenchSection is displayed');
39+
// Verify that user can close the Shortcuts
40+
await t.click(shortcutsPage.shortcutsCloseButton);
41+
// Verify that Shortcuts panel is not displayed
42+
await t.expect(shortcutsPage.shortcutsPanel.exists).notOk('Shortcuts panel is not displayed');
43+
})

0 commit comments

Comments
 (0)