Skip to content

Commit 39618c4

Browse files
Merge pull request #3044 from RedisInsight/e2e/feature/RI-5394-redis-upload
add verification for exporting bulk upload file
2 parents 329eb09 + b170153 commit 39618c4

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class ExploreTab {
3737
tutorialAccordionButton = Selector('[data-testid^=accordion-button-]');
3838
uploadDataBulkBtn = Selector('[data-testid=upload-data-bulk-btn]');
3939
uploadDataBulkApplyBtn = Selector('[data-testid=upload-data-bulk-apply-btn]');
40+
downloadFileBtn = Selector('[data-testid=download-redis-upload-file]');
4041

4142
//CSS
4243
cssTutorialDeleteIcon = '[data-testid^=delete-tutorial-icon-]';

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ test
4949
await t.expect(workbenchPage.submitCommandButton.exists).ok('Redirection to Workbench is not correct');
5050
});
5151

52+
//Verify that RedisInsight can work with the encoded redis URLs passed from Cloud via deep linking.
5253
test
5354
.before(async() => {
5455
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisGears);

tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import * as path from 'path';
2+
import * as fs from 'fs';
3+
import { join as joinPath } from 'path';
24
import { t } from 'testcafe';
35
import { ExploreTabs, rte } from '../../../../helpers/constants';
46
import { DatabaseHelper } from '../../../../helpers/database';
57
import { BrowserPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
6-
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch } from '../../../../helpers/conf';
8+
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch, fileDownloadPath } from '../../../../helpers/conf';
79
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
810
import { Common } from '../../../../helpers/common';
911
import { deleteAllKeysFromDB, verifyKeysDisplayingInTheList } from '../../../../helpers/keys';
12+
import { DatabasesActions } from '../../../../common-actions/databases-actions';
1013

1114
const myRedisDatabasePage = new MyRedisDatabasePage();
1215
const workbenchPage = new WorkbenchPage();
1316
const browserPage = new BrowserPage();
1417
const databaseHelper = new DatabaseHelper();
1518
const databaseAPIRequests = new DatabaseAPIRequests();
19+
const databasesActions = new DatabasesActions();
1620

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

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

203211
// Verify that user can bulk upload data by relative path
212+
213+
// Remember the number of files in Temp
214+
const numberOfDownloadFiles = await databasesActions.getFileCount(fileDownloadPath, fileStarts);
204215
await t.click(tutorials.uploadDataBulkBtn.withText('Upload relative'));
216+
await t.click(tutorials.downloadFileBtn);
217+
foundExportedFiles = await databasesActions.findFilesByFileStarts(fileDownloadPath, fileStarts);
218+
await t.expect(await databasesActions.getFileCount(fileDownloadPath, fileStarts)).gt(numberOfDownloadFiles, 'The Profiler logs not saved', { timeout: 5000 });
219+
205220
await t.click(tutorials.uploadDataBulkApplyBtn);
206221
// Verify that user can see the summary when the command execution is completed
207222
await verifyCompletedResultText(allKeysResults);
@@ -227,3 +242,4 @@ test
227242
await browserPage.searchByKeyName('*key1*');
228243
await verifyKeysDisplayingInTheList(keyNames, true);
229244
});
245+

0 commit comments

Comments
 (0)