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
2 changes: 1 addition & 1 deletion tests/e2e/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export enum ResourcePath {
}

export enum ExploreTabs {
Explore = 'Explore',
Tutorials = 'Tutorials',
Tips = 'Tips',
}

Expand Down
1 change: 1 addition & 0 deletions tests/e2e/pageObjects/components/explore-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class ExploreTab {
uploadDataBulkBtn = Selector('[data-testid=upload-data-bulk-btn]');
uploadDataBulkApplyBtn = Selector('[data-testid=upload-data-bulk-apply-btn]');
downloadFileBtn = Selector('[data-testid=download-redis-upload-file]');
tutorialLink = Selector('[data-testid=redisinsight-link]');

//CSS
cssTutorialDeleteIcon = '[data-testid^=delete-tutorial-icon-]';
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/pageObjects/components/insights-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export class InsightsPanel {
* Click on Panel tab
* @param type of the tab
*/
async setActiveTab(type: ExploreTabs.Explore): Promise<ExploreTab>
async setActiveTab(type: ExploreTabs.Tutorials): Promise<ExploreTab>
async setActiveTab(type: ExploreTabs.Tips): Promise<RecommendationsTab>
async setActiveTab(type: ExploreTabs): Promise<ExploreTab | RecommendationsTab> {
const activeTabName = await this.getActiveTabName();
if(type === ExploreTabs.Explore) {
if(type === ExploreTabs.Tutorials) {
if(type !== activeTabName) {
await t.click(this.exploreTab);
}
Expand Down
9 changes: 5 additions & 4 deletions tests/e2e/pageObjects/memory-efficiency-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export class MemoryEfficiencyPage extends InstancePage {
selectedReport = Selector('[data-testid=select-report]');
sortByLength = Selector('[data-testid=btn-change-table-keys]');
recommendationsTab = Selector('[data-testid=Recommendations-tab]');
veryUsefulVoteBtn = Selector('[data-testid=very-useful-vote-btn]').nth(0);
usefulVoteBtn = Selector('[data-testid=useful-vote-btn]').nth(0);
notUsefulVoteBtn = Selector('[data-testid=not-useful-vote-btn]').nth(0);
recommendationsFeedbackBtn = Selector('[data-testid=recommendation-feedback-btn]');
// ICONS
reportTooltipIcon = Selector('[data-testid=db-new-reports-icon]');
// TEXT ELEMENTS
Expand Down Expand Up @@ -56,10 +60,7 @@ export class MemoryEfficiencyPage extends InstancePage {
readMoreLink = Selector('[data-testid=read-more-link]');
workbenchLink = Selector('[data-test-subj=workbench-page-btn]');
// CONTAINERS
veryUsefulVoteBtn = Selector('[data-testid=very-useful-vote-btn]').nth(0);
usefulVoteBtn = Selector('[data-testid=useful-vote-btn]').nth(0);
notUsefulVoteBtn = Selector('[data-testid=not-useful-vote-btn]').nth(0);
recommendationsFeedbackBtn = Selector('[data-testid=recommendation-feedback-btn]');
analysisPage = Selector('[data-testid=database-analysis-page]');

/**
* Get recommendation selector by name
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
In very broad terms probabilistic data structures (PDS) allow us to get to a "close enough" result in a much shorter time and by using significantly less memory.
In very broad terms probabilistic data structures (PDS) allow us to get to a "close enough" result in a much shorter time and by using significantly less memory.

[linkTheSamePage](redisinsight:_?tutorialId=ds-json-create)

[link2AnalyticsPageWithTutorial](redisinsight:analytics/database-analysis?tutorialId=ds-json-intro)

[link3InvalidPage](redisinsight:invalidPage?tutorialId=ds-json-intro)

[link4InvalidTutorial](redisinsight:invalidPage?tutorialId=invalid-tutorial)

[link5JustAnalyticsPage](redisinsight:analytics/database-analysis)

[link6JustTheSamePage](redisinsight:_)
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (fs.existsSync(workingDirectory)) {

// Check Enablement area and validate that removed file is existed in Guides
await workbenchPage.InsightsPanel.togglePanel(true);
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tab.guidesGraphAccordion);
await t.click(tab.guidesIntroductionGraphLink.nth(1));
await t.expect(tab.enablementAreaEmptyContent.visible).notOk('Guides folder is not updated');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fixture `Redis Stack command in Workbench`
test.skip('Verify that user can switches between Graph and Text for GRAPH command and see results corresponding to their views', async t => {
// Send Graph command
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tutorials.redisStackTutorialsButton);
await t.click(tutorials.tutorialsWorkingWithGraphLink);
await tutorials.runBlockCode('Create a bike node');
Expand All @@ -46,7 +46,7 @@ test.skip('Verify that user can switches between Graph and Text for GRAPH comman
test.skip('Verify that user can see "No data to visualize" message for Graph command', async t => {
// Send Graph command
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tutorials.redisStackTutorialsButton);
await tutorials.runBlockCode('Show all sales per region');
await t.click(workbenchPage.submitCommandButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test
}
//Run Create hash index command to load network and memory
await clusterDetailsPage.InsightsPanel.togglePanel(true);
const tutorials = await clusterDetailsPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await clusterDetailsPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);

await t.click(tutorials.dataStructureAccordionTutorialButton);
await t.click(tutorials.internalLinkWorkingWithHashes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ test
await t.expect(browserPage.OverviewPanel.overviewCpu.exists).ok('CPU (%) is dispalyed in the Overview');
//Run Create hash index command
await browserPage.InsightsPanel.togglePanel(true);
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tutorials.dataStructureAccordionTutorialButton);
await t.click(tutorials.internalLinkWorkingWithHashes);
await tutorials.runBlockCode('Create a hash');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ test.skip
// Verify that tutorial opened
await t.click(memoryEfficiencyPage.getToTutorialBtnByRecomName(searchJsonRecommendation));
await workbenchPage.InsightsPanel.togglePanel(true);
await t.expect(await workbenchPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Explore);
const tutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
await t.expect(await workbenchPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
const tutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.expect(tutorial.preselectArea.visible).ok('Workbench Enablement area not opened');
// Verify that REDIS FOR TIME SERIES tutorial expanded
await t.expect(tutorial.getTutorialByName('INTRODUCTION').visible).ok('INTRODUCTION tutorial is not expanded');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test
await t.navigateTo(generateLink(connectUrlParams));
await t.wait(10_000);
await t.expect(workbenchPage.submitCommandButton.exists).ok('Redirection to Workbench is not correct');
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.expect(tab.preselectArea.textContent).contains('INTRODUCTION', 'the tutorial page is incorrect');
await t.expect(tab.preselectArea.textContent).contains('JSON', 'the tutorial is incorrect');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'));
// Run automatically added "FT._LIST" and "FT.INFO {index}" scripts
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tutorials.dataStructureAccordionTutorialButton);
await t.click(tutorials.internalLinkWorkingWithHashes);

Expand Down
74 changes: 68 additions & 6 deletions tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join as joinPath } from 'path';
import { t } from 'testcafe';
import { ExploreTabs, rte } from '../../../../helpers/constants';
import { DatabaseHelper } from '../../../../helpers/database';
import { BrowserPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
import { BrowserPage, MemoryEfficiencyPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch, fileDownloadPath } from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
Expand All @@ -17,6 +17,7 @@ const browserPage = new BrowserPage();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();
const databasesActions = new DatabasesActions();
const memoryEfficiencyPage = new MemoryEfficiencyPage();

const zipFolderName = 'customTutorials';
const folderPath = path.join('..', 'test-data', 'upload-tutorials', zipFolderName);
Expand Down Expand Up @@ -68,7 +69,7 @@ test

// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);

await t.expect(tutorials.customTutorials.visible).ok('custom tutorials sections is not visible');
await t.click(tutorials.tutorialOpenUploadButton);
Expand Down Expand Up @@ -123,7 +124,7 @@ test
test.skip
.after(async() => {
tutorialName = 'Tutorials with manifest';
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
if(await tutorials.tutorialAccordionButton.withText(tutorialName).exists) {
await tutorials.deleteTutorialByName(tutorialName);
}
Expand All @@ -136,7 +137,7 @@ test.skip
const summary = 'Summary for JSON';

await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.click(tutorials.tutorialOpenUploadButton);
// Verify that user can upload tutorials using a URL
await t.typeText(tutorials.tutorialLinkField, link);
Expand Down Expand Up @@ -180,7 +181,7 @@ test
// Clear and delete database
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await tutorials.deleteTutorialByName(tutorialName);
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).exists)
.notOk(`${tutorialName} tutorial is not deleted`);
Expand All @@ -195,7 +196,7 @@ test

// Upload custom tutorial
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t
.click(tutorials.tutorialOpenUploadButton)
.setFilesToUpload(tutorials.tutorialImport, [zipFilePath])
Expand Down Expand Up @@ -242,4 +243,65 @@ test
await browserPage.searchByKeyName('*key1*');
await verifyKeysDisplayingInTheList(keyNames, true);
});
test
.before(async() => {
await databaseHelper.acceptLicenseTerms();
await databaseAPIRequests.addNewStandaloneDatabaseApi(
ossStandaloneRedisearch
);
await myRedisDatabasePage.reloadPage();
tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
// Create zip file for uploading
await Common.createZipFromFolder(folderPath, zipFilePath);
})
.after(async() => {
await Common.deleteFileFromFolder(zipFilePath);
// Clear and delete database
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await tutorials.deleteTutorialByName(tutorialName);
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).exists)
.notOk(`${tutorialName} tutorial is not deleted`);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
})('Verify that user can open tutorial from links in other tutorials', async t => {
// Upload custom tutorial
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t
.click(tutorials.tutorialOpenUploadButton)
.setFilesToUpload(tutorials.tutorialImport, [zipFilePath])
.click(tutorials.tutorialSubmitButton);
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).visible).ok(`${tutorialName} tutorial is not uploaded`);
// Open tutorial
await t
.click(tutorials.tutorialAccordionButton.withText(tutorialName))
.click(tutorials.getAccordionButtonWithName(folder2))
.click(tutorials.getInternalLinkWithManifest(internalLinkName2));
await t.expect(tutorials.scrolledEnablementArea.visible).ok('Enablement area is not visible after clicked');

// Verify that user do not see the standard popover when open a tutorial page via the link
await t.click(tutorials.tutorialLink.withText('linkTheSamePage'));
await t.expect(tutorials.getTutorialByName('CREATE DOCUMENTS').exists).ok('Tutorial not opened by link');

// Verify that user can see a standard popover to open a database when clicking a link where page is inside of the database which is not opened
await t.click(tutorials.closeEnablementPage);
await t.click(tutorials.getInternalLinkWithManifest(internalLinkName2));
await t.click(tutorials.tutorialLink.withText('link2AnalyticsPageWithTutorial'));
await t.expect(tutorials.openDatabasePopover.exists).ok('Open a database popover is not displayed');

// Verify that user not redirected anywhere and do not see an error when clicking on the broken link
await t.click(tutorials.tutorialLink.withText('link3InvalidPage'));
await t.expect(tutorials.getTutorialByName('VECTOR 2').exists).ok('Tutorial page is changed');
// await t.expect(tutorials.openDatabasePopover.exists).notOk('Open a database popover is still displayed');
await t.click(tutorials.tutorialLink.withText('link4InvalidTutorial'));
await t.expect(tutorials.getTutorialByName('VECTOR 2').exists).ok('Tutorial page is changed');
// await t.expect(tutorials.openDatabasePopover.exists).notOk('Open a database popover is still displayed');

// Open existing database
await myRedisDatabasePage.clickOnDBByName(ossStandaloneRedisearch.databaseName);

// Verify that user can use '[link](redisinsight:_?tutorialId={tutorialId})' syntax to cross-reference tutorials
await t.click(tutorials.tutorialLink.withText('link2AnalyticsPageWithTutorial'));
await t.expect(tutorials.getTutorialByName('INTRODUCTION').exists).ok('Tutorial not opened by link');
await t.expect(memoryEfficiencyPage.analysisPage.visible).ok('Analysis page is not opened by link');
});
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test
// Verify that user can see the live recommendation "Optimize the use of time series"
await t.expect(await tab.getRecommendationByName(redisTimeSeriesRecom).visible).ok('Optimize Time Series recommendation not displayed');
await tab.clickOnTutorialLink(redisTimeSeriesRecom);
const tabTutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
const tabTutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.expect(tabTutorial.preselectArea.textContent).contains('INTRODUCTION', 'the tutorial page is incorrect');
await t.expect(tabTutorial.preselectArea.textContent).contains('Time Series', 'the tutorial is incorrect');
});
Expand Down
Loading