Skip to content

Commit 1723f44

Browse files
Merge pull request #2986 from RedisInsight/e2e/feature/RI-4950_tutorials-home-page
E2e/feature/ri 4950 tutorials home page
2 parents c855726 + a43e3e2 commit 1723f44

File tree

13 files changed

+53
-82
lines changed

13 files changed

+53
-82
lines changed

tests/e2e/pageObjects/components/explore-tab.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import { Selector, t } from 'testcafe';
22

33
export class ExploreTab {
44

5-
documentButtonInQuickGuides = Selector('[data-testid=accordion-button-document]');
6-
internalLinkWorkingWithHashes = Selector('[data-testid=internal-link-working-with-hashes]');
5+
dataStructureAccordionTutorialButton = Selector('[data-testid=accordion-button-ds]');
6+
triggersFunctionsAccordionTutorialButton = Selector('[data-testid=accordion-button-tf]');
7+
internalLinkWorkingWithHashes = Selector('[data-testid=internal-link-ds-hashes]');
8+
internalTriggersAndFunctionsLink = Selector('[data-testid=internal-link-tf-load]');
79
redisStackTutorialsButton = Selector('[data-testid=accordion-button-redis_stack]');
8-
timeSeriesLink = Selector('[data-testid=internal-link-redis_for_time_series]');
10+
timeSeriesLink = Selector('[data-testid=accordion-button-ds-ts]');
11+
internalTimeSeriesLink = Selector('[data-testid=internal-link-ds-ts-ret-compact]');
912
scrolledEnablementArea = Selector('[data-testid=enablement-area__page]');
1013
closeEnablementPage = Selector('[data-testid=enablement-area__page-close]');
1114
tutorialLinkField = Selector('[data-testid=tutorial-link-field]');
@@ -15,8 +18,6 @@ export class ExploreTab {
1518
enablementAreaPagination = Selector('[data-testid=enablement-area__pagination-popover-btn]');
1619
paginationPopoverButtons = Selector('[data-testid=enablement-area__pagination-popover] button');
1720
enablementAreaPaginationPopover = Selector('[data-testid=enablement-area__pagination-popover]');
18-
redisStackLinks = Selector('[data-testid=accordion-redis_stack] [data-testid^=internal-link]');
19-
vectorSimilitaritySearchButton = Selector('[data-testid=internal-link-vector_similarity_search]');
2021
nextPageButton = Selector('[data-testid=enablement-area__next-page-btn]');
2122
prevPageButton = Selector('[data-testid=enablement-area__prev-page-btn]');
2223
guidesGraphAccordion = Selector('[data-testid=accordion-button-graph]');

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export class MyRedisDatabasePage extends BasePage {
7979
failedResultsAccordion = Selector('[data-testid^=failed-results-]');
8080
// CONTAINERS
8181
databaseContainer = Selector('.databaseContainer');
82+
connectionTypeTitle = Selector('[data-test-subj=tableHeaderCell_connectionType_2]');
8283

8384
/**
8485
* Click on the database by name

tests/e2e/tests/web/critical-path/cluster-details/cluster-details.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ test
7878
await clusterDetailsPage.InsightsPanel.togglePanel(true);
7979
const tutorials = await clusterDetailsPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
8080

81-
await t.click(tutorials.documentButtonInQuickGuides);
81+
await t.click(tutorials.dataStructureAccordionTutorialButton);
8282
await t.click(tutorials.internalLinkWorkingWithHashes);
83-
await tutorials.runBlockCode('Create');
83+
await tutorials.runBlockCode('Create a hash');
8484
// Go to Analysis Tools page
8585
await t.click(myRedisDatabasePage.NavigationPanel.analysisPageButton);
8686
// Verify that values in table are dynamic

tests/e2e/tests/web/critical-path/database-overview/database-overview.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ test
159159
//Run Create hash index command
160160
await browserPage.InsightsPanel.togglePanel(true);
161161
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
162-
await t.click(tutorials.documentButtonInQuickGuides);
162+
await t.click(tutorials.dataStructureAccordionTutorialButton);
163163
await t.click(tutorials.internalLinkWorkingWithHashes);
164-
await tutorials.runBlockCode('Create');
164+
await tutorials.runBlockCode('Create a hash');
165165
//Verify that CPU and commands per second parameters are changed
166166
const commandsSecAfterEdit = await browserPage.OverviewPanel.overviewCommandsSec.textContent;
167167
await browserPage.OverviewPanel.waitForCpuIsCalculated();

tests/e2e/tests/web/critical-path/database/modules.e2e.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ test('Verify that user can see DB modules on DB list page for Standalone DB', as
6262
});
6363
test('Verify that user can see full module list in the Edit mode', async t => {
6464
// Verify that module column is displayed
65-
await t.expect(myRedisDatabasePage.moduleColumn.visible).ok('Module column not found');
65+
await t.expect(myRedisDatabasePage.connectionTypeTitle.visible).ok('connection type column not found');
6666
// Open Edit mode
6767
await t.click(myRedisDatabasePage.editDatabaseButton);
68+
await myRedisDatabasePage.InsightsPanel.togglePanel(true);
6869
// Verify that module column is not displayed
69-
await t.expect(myRedisDatabasePage.moduleColumn.exists).notOk('Module column not found');
70+
await t.expect(myRedisDatabasePage.connectionTypeTitle.exists).notOk('connection type column not found');
7071
// Verify modules in Edit mode
7172
await myRedisDatabasePage.checkModulesOnPage(moduleList);
7273
});

tests/e2e/tests/web/critical-path/url-handling/url-handling.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test
6868
const connectUrlParams = {
6969
redisUrl: `redis://${databaseUsername}:${databasePassword}@${host}:${port}`,
7070
databaseAlias: databaseName,
71-
redirect: 'workbench?guidePath=/quick-guides/document/introduction.md',
71+
redirect: 'workbench?guidePath=/sq/introduction.md',
7272
cloudBdbId: '1232',
7373
subscriptionType: 'fixed',
7474
planMemoryLimit: '30',
@@ -81,7 +81,7 @@ test
8181
await t.expect(workbenchPage.submitCommandButton.exists).ok('Redirection to Workbench is not correct');
8282
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
8383
await t.expect(tab.preselectArea.textContent).contains('INTRODUCTION', 'the tutorial page is incorrect');
84-
await t.expect(tab.preselectArea.textContent).contains('Document', 'the tutorial is incorrect');
84+
await t.expect(tab.preselectArea.textContent).contains('How To Query Your Data', 'the tutorial is incorrect');
8585

8686
//Verify that the same db is not added
8787
await t.navigateTo(generateLink(connectUrlParams));

tests/e2e/tests/web/critical-path/workbench/default-scripts-area.e2e.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const telemetry = new Telemetry();
1616
let indexName = chance.word({ length: 5 });
1717
let keyName = chance.word({ length: 5 });
1818
const logger = telemetry.createLogger();
19-
const telemetryEvent = 'WORKBENCH_ENABLEMENT_AREA_GUIDE_OPENED';
20-
const telemetryPath = 'static/guides/quick-guides/document/working-with-hashes.md';
19+
const telemetryEvent = 'EXPLORE_PANEL_TUTORIAL_OPENED';
20+
const telemetryPath = 'static/tutorials/ds/hashes.md';
2121
const expectedProperties = [
2222
'databaseId',
2323
'path'
@@ -37,7 +37,7 @@ fixture `Default scripts area at Workbench`
3737
await workbenchPage.sendCommandInWorkbench(`FT.DROPINDEX ${indexName} DD`);
3838
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
3939
});
40-
test
40+
test.only
4141
.requestHooks(logger)('Verify that user can run automatically "FT._LIST" and "FT.INFO {index}" scripts in Workbench and see the results', async t => {
4242
indexName = 'idx:schools';
4343
keyName = chance.word({ length: 5 });
@@ -46,18 +46,23 @@ test
4646
`HMSET product:1 name "${keyName}"`,
4747
`HMSET product:2 name "${keyName}"`
4848
];
49+
const addedScript = 'FT._LIST \n' +
50+
51+
`FT.INFO "${indexName}"`;
4952
// Send commands
5053
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'));
5154
// Run automatically added "FT._LIST" and "FT.INFO {index}" scripts
5255
await workbenchPage.InsightsPanel.togglePanel(true);
5356
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
54-
await t.click(tutorials.documentButtonInQuickGuides);
57+
await t.click(tutorials.dataStructureAccordionTutorialButton);
5558
await t.click(tutorials.internalLinkWorkingWithHashes);
5659

5760
// Verify that telemetry event 'WORKBENCH_ENABLEMENT_AREA_GUIDE_OPENED' sent and has all expected properties
5861
await telemetry.verifyEventHasProperties(telemetryEvent, expectedProperties, logger);
5962
await telemetry.verifyEventPropertyValue(telemetryEvent, 'path', telemetryPath, logger);
60-
await tutorials.runBlockCode('Additional index information');
63+
64+
await workbenchPage.sendCommandInWorkbench(addedScript);
65+
6166
// Check the FT._LIST result
6267
await t.expect(workbenchPage.queryTextResult.textContent).contains(indexName, 'The result of the FT._LIST command not found');
6368
// Check the FT.INFO result
@@ -76,13 +81,7 @@ test('Verify that user can edit and run automatically added "Search" script in W
7681
// Send commands
7782
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'));
7883
// Run automatically added FT.SEARCH script with edits
79-
await workbenchPage.InsightsPanel.togglePanel(true);
80-
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
81-
await t.click(tutorials.documentButtonInQuickGuides);
82-
await t.click(tutorials.internalLinkWorkingWithHashes);
83-
await tutorials.runBlockCode('Exact text search');
8484

85-
await t.pressKey('ctrl+a delete');
8685
await workbenchPage.sendCommandInWorkbench(searchCommand);
8786
// Check the FT.SEARCH result
8887
await t.switchToIframe(workbenchPage.iframe);
@@ -103,13 +102,6 @@ test('Verify that user can edit and run automatically added "Aggregate" script i
103102
// Send commands
104103
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'), 0.5);
105104
// Run automatically added FT.Aggregate script with edits
106-
await workbenchPage.InsightsPanel.togglePanel(true);
107-
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
108-
await t.click(tab.documentButtonInQuickGuides);
109-
await t.click(tab.internalLinkWorkingWithHashes);
110-
await tab.runBlockCode('Group by & sort by aggregation: COUNT');
111-
//await t.click(workbenchPage.preselectGroupBy);
112-
await t.pressKey('ctrl+a delete');
113105
await workbenchPage.sendCommandInWorkbench(searchCommand);
114106
// Check the FT.Aggregate result
115107
await t.switchToIframe(workbenchPage.iframe);

tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ test
5555
await t.click(browserPage.NavigationPanel.myRedisDBButton);
5656
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
5757
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('the panel is opened');
58-
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Search and Query capability', 'popover is not displayed');
58+
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Search and query capability', 'popover is not displayed');
5959
const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
60-
await t.expect(tab.preselectArea.textContent).contains('VECTOR SIMILARITY SEARCH', 'the tutorial is incorrect');
60+
await t.expect(tab.preselectArea.textContent).contains('How To Query Your Data', 'the tutorial is incorrect');
6161

6262
await t.click(browserPage.NavigationPanel.myRedisDBButton);
6363
await myRedisDatabasePage.clickOnDBByName(ossStandaloneV5Config.databaseName);
@@ -67,8 +67,8 @@ test
6767
await t.click(browserPage.NavigationPanel.myRedisDBButton);
6868
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
6969
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('the panel is opened');
70-
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('time series', 'popover is not displayed');
71-
await t.expect(tab.preselectArea.textContent).contains('REDIS FOR TIME SERIES', 'the tutorial is incorrect');
70+
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Time series data', 'popover is not displayed');
71+
await t.expect(tab.preselectArea.textContent).contains('Time Series', 'the tutorial is incorrect');
7272
});
7373

7474
test

tests/e2e/tests/web/regression/workbench/autoexecute-button.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test.skip('Verify that when user clicks on auto-execute button, command is run',
2828
// Verify that admin can use redis-auto format in .md file for Guides for auto-executed button
2929
await workbenchPage.InsightsPanel.togglePanel(true);
3030
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
31-
await t.click(tutorials.documentButtonInQuickGuides);
31+
await t.click(tutorials.dataStructureAccordionTutorialButton);
3232
await t.click(tutorials.internalLinkWorkingWithHashes);
3333
await tutorials.runBlockCode('Create');
3434
await t.expect(workbenchPage.queryInput.textContent).eql(command, 'Editor is changed');

tests/e2e/tests/web/regression/workbench/default-scripts-area.e2e.ts

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,35 @@ test('Verify that user can see the [Manual] option in the Enablement area', asyn
4444
test('Verify that user can see saved article in Enablement area when he leaves Workbench page and goes back again', async t => {
4545
await workbenchPage.InsightsPanel.togglePanel(true);
4646
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
47-
await t.click(tutorials.documentButtonInQuickGuides);
48-
await t.expect(tutorials.internalLinkWorkingWithHashes.visible).ok('The working with hachs link is not visible', { timeout: 5000 });
47+
await t.click(tutorials.dataStructureAccordionTutorialButton);
48+
await t.expect(tutorials.internalLinkWorkingWithHashes.visible).ok('The working with hashes link is not visible', { timeout: 5000 });
4949
// Open Working with Hashes section
5050
await t.click(tutorials.internalLinkWorkingWithHashes);
5151
// Check the button from Hash page is visible
52-
await tutorials.runBlockCode('Create');
53-
let selector = await tutorials.getRunSelector('Create');
52+
await tutorials.runBlockCode('Create a hash');
53+
let selector = await tutorials.getRunSelector('Create a hash');
5454
await t.expect(selector.visible).ok('The end of the page is not visible');
5555
// Go to Browser page
5656
await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
5757
// Go back to Workbench page
5858
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
5959
// Verify that the same article is opened in Enablement area
60-
selector = await tutorials.getRunSelector('Create');
60+
selector = await tutorials.getRunSelector('Create a hash');
6161
await t.expect(selector.visible).ok('The end of the page is not visible');
6262
// Go to list of DBs page
6363
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
6464
// Go back to active DB again
6565
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
6666
// Check that user is on Workbench page and "Working with Hashes" page is displayed
67-
selector = await tutorials.getRunSelector('Create');
67+
selector = await tutorials.getRunSelector('Create a hash');
6868
await t.expect(selector.visible).ok('The end of the page is not visible');
6969
});
7070
//skipped due the issue RI-2384
7171
test.skip('Verify that user can see saved scroll position in Enablement area when he leaves Workbench page and goes back again', async t => {
7272
// Open Working with Hashes section
7373
await workbenchPage.InsightsPanel.togglePanel(true);
7474
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
75-
await t.click(tutorials.documentButtonInQuickGuides);
75+
await t.click(tutorials.dataStructureAccordionTutorialButton);
7676
await t.click(tutorials.internalLinkWorkingWithHashes);
7777
// Evaluate the last button in Enablement Area
7878
const buttonsQuantity = await workbenchPage.preselectButtons.count;
@@ -96,16 +96,17 @@ test.skip('Verify that user can see saved scroll position in Enablement area whe
9696
});
9797
test('Verify that user can see the siblings menu by clicking on page counter element between Back and Next buttons', async t => {
9898
const popoverButtons = [
99-
'Introduction',
100-
'Working with Hashes',
101-
'Working with JSON',
102-
'Learn More'
99+
'Strings',
100+
'Hashes',
101+
'Lists',
102+
'Sets',
103+
'Sorted sets'
103104
];
104105

105106
// Open Working with Hashes section and click on the on page counter
106107
await workbenchPage.InsightsPanel.togglePanel(true);
107108
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
108-
await t.click(tutorials.documentButtonInQuickGuides);
109+
await t.click(tutorials.dataStructureAccordionTutorialButton);
109110
await t.expect(tutorials.internalLinkWorkingWithHashes.visible).ok('The working with hachs link is not visible', { timeout: 5000 });
110111
await t.click(tutorials.internalLinkWorkingWithHashes);
111112
// Verify that user can see the quick navigation section to navigate between siblings under the scrolling content
@@ -120,29 +121,3 @@ test('Verify that user can see the siblings menu by clicking on page counter ele
120121
await t.expect(popoverButton.textContent).eql(popoverButtons[i], `The siblings menu button ${popoverButtons[i]} is not displayed`);
121122
}
122123
});
123-
test('Verify that the same type of content is supported in the “Tutorials” as in the “Quick Guides”', async t => {
124-
const tutorialsContent = [
125-
'Working with JSON',
126-
'Vector Similarity Search',
127-
'Redis for time series',
128-
'Probabilistic data structures'
129-
];
130-
const command = 'HSET bikes:10000 ';
131-
132-
// Verify the redis stack links
133-
await workbenchPage.InsightsPanel.togglePanel(true);
134-
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
135-
await t.click(tutorials.redisStackTutorialsButton);
136-
const linksCount = await tutorials.redisStackLinks.count;
137-
for (let i = 0; i < linksCount; i++) {
138-
await t.expect(tutorials.redisStackLinks.nth(i).textContent).eql(tutorialsContent[i], `The link ${tutorialsContent[i]} is in the Enablement area`);
139-
}
140-
// Verify the load script to Editor
141-
await t.click(tutorials.vectorSimilitaritySearchButton);
142-
// Verify that user can see the pagination for redis stack pages in Tutorials
143-
await t.expect(tutorials.enablementAreaPagination.visible).ok('The user can not see the pagination for redis stack pages');
144-
await t.expect(tutorials.nextPageButton.visible).ok('The user can not see the next page for redis stack pages');
145-
await t.expect(tutorials.prevPageButton.visible).ok('The user can not see the prev page for redis stack pages');
146-
147-
await t.expect(workbenchPage.queryInputScriptArea.textContent).eql('', 'The editor is not empty');
148-
});

0 commit comments

Comments
 (0)