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
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 @@ -37,6 +37,7 @@ export class ExploreTab {
tutorialAccordionButton = Selector('[data-testid^=accordion-button-]');
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]');

//CSS
cssTutorialDeleteIcon = '[data-testid^=delete-tutorial-icon-]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test
await t.expect(workbenchPage.submitCommandButton.exists).ok('Redirection to Workbench is not correct');
});

//Verify that RedisInsight can work with the encoded redis URLs passed from Cloud via deep linking.
test
.before(async() => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisGears);
Expand Down
18 changes: 17 additions & 1 deletion tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import * as path from 'path';
import * as fs from 'fs';
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 { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch } from '../../../../helpers/conf';
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch, fileDownloadPath } from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
import { deleteAllKeysFromDB, verifyKeysDisplayingInTheList } from '../../../../helpers/keys';
import { DatabasesActions } from '../../../../common-actions/databases-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const workbenchPage = new WorkbenchPage();
const browserPage = new BrowserPage();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();
const databasesActions = new DatabasesActions();

const zipFolderName = 'customTutorials';
const folderPath = path.join('..', 'test-data', 'upload-tutorials', zipFolderName);
Expand All @@ -22,6 +26,7 @@ const internalLinkName2 = 'vector-2';
let tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
let zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
let internalLinkName1 = 'probably-1';
let foundExportedFiles: string[];
const verifyCompletedResultText = async(resultsText: string[]): Promise<void> => {
for (const result of resultsText) {
await t.expect(workbenchPage.Toast.toastBody.textContent).contains(result, 'Bulk upload completed summary not correct');
Expand Down Expand Up @@ -168,6 +173,8 @@ test
await Common.createZipFromFolder(folderPath, zipFilePath);
})
.after(async() => {
// Delete exported file
fs.unlinkSync(joinPath(fileDownloadPath, foundExportedFiles[0]));
await Common.deleteFileFromFolder(zipFilePath);
await deleteAllKeysFromDB(ossStandaloneRedisearch.host, ossStandaloneRedisearch.port);
// Clear and delete database
Expand All @@ -184,6 +191,7 @@ test
const invalidPathes = ['Invalid relative', 'Invalid absolute'];
const keyNames = ['hashkey1', 'listkey1', 'setkey1', 'zsetkey1', 'stringkey1', 'jsonkey1', 'streamkey1', 'graphkey1', 'tskey1', 'stringkey1test'];
internalLinkName1 = 'probably-1';
const fileStarts = 'bulk';

// Upload custom tutorial
await workbenchPage.InsightsPanel.togglePanel(true);
Expand All @@ -201,7 +209,14 @@ test
await t.expect(tutorials.scrolledEnablementArea.visible).ok('Enablement area is not visible after clicked');

// Verify that user can bulk upload data by relative path

// Remember the number of files in Temp
const numberOfDownloadFiles = await databasesActions.getFileCount(fileDownloadPath, fileStarts);
await t.click(tutorials.uploadDataBulkBtn.withText('Upload relative'));
await t.click(tutorials.downloadFileBtn);
foundExportedFiles = await databasesActions.findFilesByFileStarts(fileDownloadPath, fileStarts);
await t.expect(await databasesActions.getFileCount(fileDownloadPath, fileStarts)).gt(numberOfDownloadFiles, 'The Profiler logs not saved', { timeout: 5000 });

await t.click(tutorials.uploadDataBulkApplyBtn);
// Verify that user can see the summary when the command execution is completed
await verifyCompletedResultText(allKeysResults);
Expand All @@ -227,3 +242,4 @@ test
await browserPage.searchByKeyName('*key1*');
await verifyKeysDisplayingInTheList(keyNames, true);
});