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
Binary file removed tests/e2e/test-data/upload-tutorials/sample.zip
Binary file not shown.
Binary file not shown.
9 changes: 3 additions & 6 deletions tests/e2e/tests/critical-path/browser/bulk-delete.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BrowserPage, BulkActionsPage, MyRedisDatabasePage } from '../../../page
import { commonUrl, ossStandaloneRedisearch } from '../../../helpers/conf';
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
import { Common } from '../../../helpers/common';
import { addHashKeyApi, addSetKeyApi } from '../../../helpers/api/api-keys';
import { deleteAllKeysFromDB, populateDBWithHashes } from '../../../helpers/keys';

const browserPage = new BrowserPage();
Expand All @@ -13,8 +12,6 @@ const common = new Common();
const myRedisDatabasePage = new MyRedisDatabasePage();

const keyNames = [common.generateWord(20), common.generateWord(20)];
const hashKeyParameters = { keyName: keyNames[0], fields: [{ field: common.generateWord(20), value: common.generateWord(20) }] };
const setKeyParameters = { keyName: keyNames[1], members: [common.generateWord(20)] };
const dbParameters = { host: ossStandaloneRedisearch.host, port: ossStandaloneRedisearch.port };
const keyToAddParameters = { keysCount: 10000, keyNameStartWith: 'hashKey'};
const keyToAddParameters2 = { keysCount: 500000, keyNameStartWith: 'hashKey'};
Expand All @@ -24,8 +21,8 @@ fixture `Bulk Delete`
.page(commonUrl)
.beforeEach(async() => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
await addHashKeyApi(hashKeyParameters, ossStandaloneRedisearch);
await addSetKeyApi(setKeyParameters, ossStandaloneRedisearch);
await browserPage.addHashKey(keyNames[0], '100000', common.generateWord(20), common.generateWord(20));
await browserPage.addSetKey(keyNames[1], '100000', common.generateWord(20));
})
.afterEach(async() => {
// Clear and delete database
Expand Down Expand Up @@ -134,7 +131,7 @@ test('Verify that when bulk deletion is completed, status Action completed is di
test
.before(async() => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
await addSetKeyApi(setKeyParameters, ossStandaloneRedisearch);
await browserPage.addSetKey(keyNames[1], '100000', common.generateWord(20));
// Add 10000 Hash keys
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
// Filter by Hash keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ test
await myRedisDatabasePage.clickOnDBByName(simpleDbName); // click standalone database
await cliPage.sendCommandInCli(`FT.DROPINDEX ${indexNameSimpleDb}`);
await t.click(browserPage.patternModeBtn);
await t.click(browserPage.browserViewButton);
await browserPage.deleteKeysByNames(keyNames);

//delete database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ test('Verify that user can edit and run automatically added "Aggregate" script i
await t.expect(workbenchPage.queryTableResult.textContent).contains(aggregationResultField, 'The aggregation field name is not in the Search result');
await t.expect(workbenchPage.queryTableResult.textContent).contains('100', 'The aggregation max value is in not the Search result');
});
test('Verify that when the “Manual” option clicked, user can see the Editor is automatically prepopulated with the information', async t => {
// Outdated after https://redislabs.atlassian.net/browse/RI-4279
test.skip('Verify that when the “Manual” option clicked, user can see the Editor is automatically prepopulated with the information', async t => {
const information = [
'// Workbench is the advanced Redis command-line interface that allows to send commands to Redis, read and visualize the replies sent by the server.',
'// Enter multiple commands at different rows to run them at once.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fixture `Scripting area at Workbench`
// Update after resolving https://redislabs.atlassian.net/browse/RI-3299
test('Verify that user can resize scripting area in Workbench', async t => {
const commandForSend = 'info';
const offsetY = 100;
const offsetY = 130;

await workbenchPage.sendCommandInWorkbench(commandForSend);
// Verify that user can run any script from CLI in Workbench and see the results
Expand All @@ -41,9 +41,9 @@ test('Verify that user can resize scripting area in Workbench', async t => {
const inputHeightStart = await workbenchPage.queryInput.clientHeight;

await t.hover(workbenchPage.resizeButtonForScriptingAndResults);
await t.drag(workbenchPage.resizeButtonForScriptingAndResults, 0, offsetY, { speed: 0.4 });
await t.drag(workbenchPage.resizeButtonForScriptingAndResults, 0, offsetY, { speed: 0.1 });
// Verify that user can resize scripting area
const inputHeightEnd = inputHeightStart + 20;
const inputHeightEnd = inputHeightStart + 15;
await t.expect(await workbenchPage.queryInput.clientHeight).gt(inputHeightEnd, 'Scripting area after resize has incorrect size');
});
test('Verify that user when he have more than 10 results can request to view more results in Workbench', async t => {
Expand Down
37 changes: 19 additions & 18 deletions tests/e2e/tests/regression/workbench/import-tutorials.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {
import { MyRedisDatabasePage, WorkbenchPage } from '../../../pageObjects';
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
import {Common} from '../../../helpers/common';

const myRedisDatabasePage = new MyRedisDatabasePage();
const workbenchPage = new WorkbenchPage();
const common = new Common();
const filePath = path.join('..', '..', '..', 'test-data', 'upload-tutorials', 'sample.zip');
const tutorialName = `tutorialName-${common.generateWord(10)}`;
const link = 'https://drive.google.com/uc?export=download&id=1mlyDKWLu12L02FblOPh15EwG2Vy_FhJ7';
const filePath = path.join('..', '..', '..', 'test-data', 'upload-tutorials', 'testTutorials.zip');
const tutorialName = 'testTutorials';
const tutorialName2 = 'tutorialTestByLink';
const link = 'https://drive.google.com/uc?id=1puRUoT8HmyZCekkeWNxBzXe_48TzXcJc&export=download';
let folder1 = 'folder-1';
let folder2 = 'folder-2';
let internalLinkName1 = 'probably-1';
Expand All @@ -29,7 +28,7 @@ fixture `Upload custom tutorials`
.afterEach(async() => {
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
});
// https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198
// https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198, https://redislabs.atlassian.net/browse/RI-4302
test('Verify that user can upload tutorial with local zip file without manifest.json', async t => {
// Verify that user can upload custom tutorials on docker version
folder1 = 'folder-1';
Expand All @@ -39,8 +38,6 @@ test('Verify that user can upload tutorial with local zip file without manifest.
// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
await t.expect(workbenchPage.customTutorials.visible).ok('custom tutorials sections is not visible');
await t.click(workbenchPage.tutorialOpenUploadButton);
// Verify that User can enter a tutorial name
await t.typeText(workbenchPage.tutorialNameField, tutorialName);
await t.expect(workbenchPage.tutorialSubmitButton.hasAttribute('disabled')).ok('submit button is not disabled');
// Verify that User can request to add a new custom Tutorial by uploading a .zip archive from a local folder
await t.setFilesToUpload(workbenchPage.tutorialImport, [filePath]);
Expand All @@ -50,10 +47,12 @@ test('Verify that user can upload tutorial with local zip file without manifest.
await t.click(workbenchPage.tutorialAccordionButton.withText(tutorialName));
await t.expect((await workbenchPage.getAccordionButtonWithName(folder1)).visible).ok(`${folder1} is not visible`);
await t.expect((await workbenchPage.getAccordionButtonWithName(folder2)).visible).ok(`${folder2} is not visible`);
await t.click(await workbenchPage.getAccordionButtonWithName(folder1));
await t.expect((await workbenchPage.getInternalLinkWithManifest(internalLinkName1)).visible)
.ok(`${internalLinkName1} is not visible`);
await t.click(await workbenchPage.getAccordionButtonWithName(folder2));
await t.expect((await workbenchPage.getInternalLinkWithManifest(internalLinkName2)).visible)
.ok(`${internalLinkName2} is not visible`);
.ok(`${internalLinkName1} is not visible`);
await t.expect(workbenchPage.scrolledEnablementArea.exists).notOk('enablement area is visible before clicked');
await t.click((await workbenchPage.getInternalLinkWithManifest(internalLinkName1)));
await t.expect(workbenchPage.scrolledEnablementArea.visible).ok('enablement area is not visible after clicked');
Expand All @@ -66,21 +65,23 @@ test('Verify that user can upload tutorial with local zip file without manifest.
await t.expect((workbenchPage.tutorialAccordionButton.withText(tutorialName).exists))
.notOk(`${tutorialName} tutorial is not uploaded`);
});
// https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213
// https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213, https://redislabs.atlassian.net/browse/RI-4302
test('Verify that user can upload tutorial with URL with manifest.json', async t => {
internalLinkName1 = 'working_probably';
const labelFromManifest = 'LabelFromManifest';
internalLinkName1 = 'manifest-id';

await t.click(workbenchPage.tutorialOpenUploadButton);
await t.typeText(workbenchPage.tutorialNameField, tutorialName);
// Verify that user can upload tutorials using a URL
await t.typeText(workbenchPage.tutorialLinkField, link);
await t.click(workbenchPage.tutorialSubmitButton);
await t.expect(workbenchPage.tutorialAccordionButton.withText(tutorialName).with({ timeout: 20000 }).visible)
.ok(`${tutorialName} tutorial is not uploaded`);
await t.click(workbenchPage.tutorialAccordionButton.withText(tutorialName));
await t.expect(workbenchPage.tutorialAccordionButton.withText(tutorialName2).with({ timeout: 20000 }).visible)
.ok(`${tutorialName2} tutorial is not uploaded`);
await t.click(workbenchPage.tutorialAccordionButton.withText(tutorialName2));
// Verify that User can see the same structure in the tutorial uploaded as described in the .json manifest
await t.expect((await workbenchPage.getInternalLinkWithoutManifest(internalLinkName1)).visible)
.ok(`${internalLinkName1} folder is not visible`);
.ok(`${internalLinkName1} folder specified in manifest is not visible`);
await t.expect(await (await workbenchPage.getInternalLinkWithoutManifest(internalLinkName1)).textContent)
.eql(labelFromManifest, `${labelFromManifest} tutorial specified in manifest is not visible`);
await t.click((await workbenchPage.getInternalLinkWithoutManifest(internalLinkName1)));
await t.expect(workbenchPage.scrolledEnablementArea.visible).ok('enablement area is not visible after clicked');
await t.click(workbenchPage.closeEnablementPage);
Expand All @@ -89,6 +90,6 @@ test('Verify that user can upload tutorial with URL with manifest.json', async t
await t.click(workbenchPage.tutorialDeleteButton);
await t.expect(workbenchPage.tutorialDeleteButton.exists).notOk('Delete popup is still visible');
// Verify that when User delete the tutorial, then User can see this tutorial and relevant markdown files are deleted from: the Enablement area in Workbench
await t.expect((workbenchPage.tutorialAccordionButton.withText(tutorialName).exists))
.notOk(`${tutorialName} tutorial is not uploaded`);
await t.expect((workbenchPage.tutorialAccordionButton.withText(tutorialName2).exists))
.notOk(`${tutorialName2} tutorial is not uploaded`);
});