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
24 changes: 10 additions & 14 deletions tests/e2e/tests/critical-path/browser/bulk-delete.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,26 @@ test('Verify that user can access the bulk actions screen in the Browser', async
await t.expect(bulkActionsPage.bulkApplyButton.visible).ok('Confirm deletion button not displayed');

});
test('Verify that user can see no pattern selected message when no key type and pattern applied for Bulk Delete', async t => {
test('Verify that user can see summary of scanned level', async t => {
const expectedAmount = new RegExp('Expected amount: ~' + '10 ' + '.');
const scannedKeys = new RegExp('Scanned 5% \\(....10 ...\\) and found ... keys');
const messageTitle = 'No pattern or key type set';
const messageText = 'To perform a bulk action, set the pattern or select the key type';

// Add 10000 Hash keys
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
// Open bulk actions
await t.click(browserPage.bulkActionsButton);
// Verify that user can see no pattern selected message when no key type and pattern applied for Bulk Delete
await t.expect(bulkActionsPage.bulkActionsPlaceholder.textContent).contains(messageTitle, 'No pattern title not displayed');
await t.expect(bulkActionsPage.bulkActionsPlaceholder.textContent).contains(messageText, 'No pattern message not displayed');
});
test('Verify that user can see summary of scanned level', async t => {
const expectedAmount = new RegExp('Expected amount: ~' + '10 ' + '.');
const scannedKeys = new RegExp('Scanned 5% \\(....10 ...\\) and found ... keys');
// Add 10000 Hash keys
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
// Filter by Hash keys
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
// Open bulk actions
await t.click(browserPage.bulkActionsButton);
// Verify that prediction of # of keys matching the filter in the entire database displayed
await t.expect(bulkActionsPage.bulkActionsSummary.textContent).match(expectedAmount, 'Bulk actions summary is not correct');
// Verify that % of total keys scanned, # of keys scanned / total # of keys in the database, # of keys matching the filter displayed
await t.expect(bulkActionsPage.bulkDeleteSummary.innerText).match(scannedKeys, 'Bulk delete summary is not correct');

});
test('Verify that user can see blue progress line during the process of bulk deletion', async t => {
// Add 500000 Hash keys
Expand Down Expand Up @@ -136,7 +135,7 @@ test
.before(async() => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
await addSetKeyApi(setKeyParameters, ossStandaloneRedisearch);
//Add 10000 Hash keys
// Add 10000 Hash keys
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
// Filter by Hash keys
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
Expand Down Expand Up @@ -166,10 +165,7 @@ test('Verify that when user clicks on Close button when bulk delete is completed
// Verify context not saved
await t.expect(bulkActionsPage.bulkDeleteCompletedSummary.visible).notOk('Bulk delete completed summary still displayed');
await t.expect(bulkActionsPage.bulkDeleteSummary.textContent).contains('Scanned 100% (2/2) and found 1 keys', 'Bulk delete summary is not correct');
});
test('Verify that when user clicks on cross icon when bulk delete is completed, panel is closed, no context is saved', async t => {
// Filter by Hash keys
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
// Verify that when user clicks on cross icon when bulk delete is completed, panel is closed, no context is saved
await bulkActionsPage.startBulkDelete();
await t.click(bulkActionsPage.bulkClosePanelButton);
await t.click(browserPage.bulkActionsButton);
Expand Down
118 changes: 39 additions & 79 deletions tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Chance } from 'chance';
import { rte } from '../../../helpers/constants';
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
import { BrowserPage, CliPage } from '../../../pageObjects';
Expand All @@ -7,15 +6,16 @@ import {
ossStandaloneConfig
} from '../../../helpers/conf';
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
import { Common } from '../../../helpers/common';

const browserPage = new BrowserPage();
const cliPage = new CliPage();
const chance = new Chance();
const common = new Common();

let keyName = chance.word({ length: 20 });
let consumerGroupName = chance.word({ length: 20 });
const keyField = chance.word({ length: 20 });
const keyValue = chance.word({ length: 20 });
let keyName = common.generateWord(20);
let consumerGroupName = common.generateWord(20);
const keyField = common.generateWord(20);
const keyValue = common.generateWord(20);
const entryIds = [
'0',
'$',
Expand All @@ -29,7 +29,7 @@ fixture `Consumer group`
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
})
.afterEach(async t => {
//Clear and delete database
// Clear and delete database
if (await browserPage.closeKeyButton.visible) {
await t.click(browserPage.closeKeyButton);
}
Expand All @@ -46,69 +46,62 @@ test('Verify that user can create a new Consumer Group in the current Stream', a
'0',
'fetches the entire stream from the beginning.'
];
keyName = chance.word({ length: 20 });
consumerGroupName = `qwerty123456${chance.word({ length: 20 })}!@#$%^&*()_+=`;
keyName = common.generateWord(20);
consumerGroupName = `qwerty123456${common.generateWord(20)}!@#$%^&*()_+=`;
// Add New Stream Key
await browserPage.addStreamKey(keyName, keyField, keyValue);
await t.click(browserPage.fullScreenModeButton);
// Open Stream consumer groups and add group
await t.click(browserPage.streamTabGroups);
await browserPage.createConsumerGroup(consumerGroupName);
await t.expect(browserPage.streamGroupsContainer.textContent).contains(consumerGroupName, 'The new Consumer Group is added');
await t.expect(browserPage.streamGroupsContainer.textContent).contains(consumerGroupName, 'The new Consumer Group is not added');
// Verify the tooltip under 'i' element
await t.click(browserPage.addKeyValueItemsButton);
await t.hover(browserPage.entryIdInfoIcon);
for (const text of toolTip) {
await t.expect(await browserPage.tooltip.innerText).contains(text, 'The toolTip message');
await t.expect(await browserPage.tooltip.innerText).contains(text, 'The toolTip message not displayed');
}
});
test('Verify that user can input the 0, $ and Valid Entry ID in the ID field', async t => {
keyName = chance.word({ length: 20 });
consumerGroupName = chance.word({ length: 20 });
keyName = common.generateWord(20);
consumerGroupName = common.generateWord(20);
// Add New Stream Key
await browserPage.addStreamKey(keyName, keyField, keyValue);
await t.click(browserPage.fullScreenModeButton);
// Open Stream consumer groups and add group with different IDs
await t.click(browserPage.streamTabGroups);
for (const entryId of entryIds) {
await browserPage.createConsumerGroup(`${consumerGroupName}${entryId}`, entryId);
await t.expect(browserPage.streamGroupsContainer.textContent).contains(`${consumerGroupName}${entryId}`, 'The new Consumer Group is added');
await t.expect(browserPage.streamGroupsContainer.textContent).contains(`${consumerGroupName}${entryId}`, 'The new Consumer Group is not added');
}
});
test('Verify that user can see the Consumer group columns (Group Name, Consumers, Pending, Last Delivered ID)', async t => {
keyName = chance.word({ length: 20 });
consumerGroupName = chance.word({ length: 20 });
keyName = common.generateWord(20);
consumerGroupName = common.generateWord(20);
const groupColumns = [
'Group Name',
'Consumers',
'Pending',
'Last Delivered ID'
];
const message = 'Your Consumer Group has no Consumers available.';

// Add New Stream Key
await browserPage.addStreamKey(keyName, keyField, keyValue);
await t.click(browserPage.fullScreenModeButton);
// Open Stream consumer groups and add group with different IDs
await t.click(browserPage.streamTabGroups);
await browserPage.createConsumerGroup(consumerGroupName);
for (let i = 0; i < groupColumns.length; i++) {
await t.expect(browserPage.scoreButton.nth(i).textContent).eql(groupColumns[i], `The ${i} Consumer group column name`);
await t.expect(browserPage.scoreButton.nth(i).textContent).eql(groupColumns[i], `The ${i} Consumer group column name not correct`);
}
});
test('Verify that user can see the message when there are no Consumers in the Consumer Group', async t => {
keyName = chance.word({ length: 20 });
consumerGroupName = chance.word({ length: 20 });
const message = 'Your Consumer Group has no Consumers available.';
// Add New Stream Key
await browserPage.addStreamKey(keyName, keyField, keyValue);
// Open Stream consumer group and check message
await t.click(browserPage.streamTabGroups);
await browserPage.createConsumerGroup(consumerGroupName);
// Verify that user can see the message when there are no Consumers in the Consumer Group
await t.click(browserPage.consumerGroup);
await t.expect(browserPage.streamConsumersContainer.textContent).contains(message, 'The message for empty Consumer Group');
await t.expect(browserPage.streamConsumersContainer.textContent).contains(message, 'The message for empty Consumer Group not displayed');
});
test('Verify that user can see the Consumer information columns (Consumer Name, Pendings, Idle Time,ms)', async t => {
keyName = chance.word({ length: 20 });
consumerGroupName = chance.word({ length: 20 });
keyName = common.generateWord(20);
consumerGroupName = common.generateWord(20);
const cliCommands = [
`XGROUP CREATE ${keyName} ${consumerGroupName} $ MKSTREAM`,
`XADD ${keyName} * message apple`,
Expand All @@ -128,33 +121,16 @@ test('Verify that user can see the Consumer information columns (Consumer Name,
await t.click(browserPage.streamTabGroups);
await t.click(browserPage.consumerGroup);
for (let i = 0; i < consumerColumns.length; i++) {
await t.expect(browserPage.scoreButton.nth(i).textContent).eql(consumerColumns[i], `The ${i} Consumers info column name`);
await t.expect(browserPage.scoreButton.nth(i).textContent).eql(consumerColumns[i], `The ${i} Consumers info column name not correct`);
}
});
test('Verify that user can navigate to Consumer Groups screen using the link in the breadcrumbs', async t => {
keyName = chance.word({ length: 20 });
consumerGroupName = chance.word({ length: 20 });
const cliCommands = [
`XGROUP CREATE ${keyName} ${consumerGroupName} $ MKSTREAM`,
`XADD ${keyName} * message apple`,
`XREADGROUP GROUP ${consumerGroupName} Alice COUNT 1 STREAMS ${keyName} >`
];
// Add New Stream Key with groups and consumers
for (const command of cliCommands) {
await cliPage.sendCommandInCli(command);
}
// Open Stream consumer info view
await browserPage.openKeyDetails(keyName);
await t.click(browserPage.streamTabGroups);
await t.click(browserPage.consumerGroup);
// Check navigation
// Verify that user can navigate to Consumer Groups screen using the link in the breadcrumbs
await t.expect(browserPage.streamTabs.visible).ok('Stream navigation tabs visibility');
await t.click(browserPage.streamTabGroups);
await t.expect(browserPage.streamTabGroups.withAttribute('aria-selected', 'true').exists).ok('The Consumer Groups screen is opened');
await t.expect(browserPage.streamTabGroups.withAttribute('aria-selected', 'true').exists).ok('The Consumer Groups screen is not opened');
});
test('Verify that user can delete the Consumer from the Consumer Group', async t => {
keyName = chance.word({ length: 20 });
let consumerGroupName = chance.word({ length: 20 });
keyName = common.generateWord(20);
const consumerGroupName = common.generateWord(20);
const cliCommands = [
`XGROUP CREATE ${keyName} ${consumerGroupName} $ MKSTREAM`,
`XADD ${keyName} * message apple`,
Expand All @@ -173,34 +149,13 @@ test('Verify that user can delete the Consumer from the Consumer Group', async t
// Delete consumer and check results
const consumerCountBefore = await browserPage.streamConsumerName.count;
await t.click(browserPage.removeConsumerButton);
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(`will be removed from Consumer Group ${consumerGroupName}`, 'The confirmation message');
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(`will be removed from Consumer Group ${consumerGroupName}`, 'The confirmation message not displayed');
await t.click(browserPage.removeConsumerButton.nth(2));
await t.expect(browserPage.streamConsumerName.count).eql(consumerCountBefore - 1, 'The Consumers number after deletion');
await t.expect(browserPage.streamConsumerName.count).eql(consumerCountBefore - 1, 'The Consumers number after deletion not correct');
});
test('Verify that user can delete a Consumer Group', async t => {
keyName = chance.word({ length: 20 });
let consumerGroupName = chance.word({ length: 20 });
const cliCommands = [
`XGROUP CREATE ${keyName} ${consumerGroupName} $ MKSTREAM`,
`XADD ${keyName} * message apple`,
`XREADGROUP GROUP ${consumerGroupName} Alice COUNT 1 STREAMS ${keyName} >`
];
// Add New Stream Key with groups and consumers
for (const command of cliCommands) {
await cliPage.sendCommandInCli(command);
}
// Open Stream consumer info view
await browserPage.openKeyDetails(keyName);
await t.click(browserPage.streamTabGroups);
// Delete consumer group and check results
await t.click(browserPage.removeConsumerGroupButton);
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(`${consumerGroupName}and all its consumers will be removed from ${keyName}`, 'The confirmation message');
await t.click(browserPage.removeConsumerGroupButton.nth(1));
await t.expect(browserPage.streamGroupsContainer.textContent).contains('Your Key has no Consumer Groups available.', 'The Consumer Group is removed from the table');
});
test('Verify that user can change the ID set for the Consumer Group when click on the Pencil button', async t => {
keyName = chance.word({ length: 20 });
let consumerGroupName = chance.word({ length: 20 });
keyName = common.generateWord(20);
const consumerGroupName = common.generateWord(20);
const cliCommands = [
`XGROUP CREATE ${keyName} ${consumerGroupName} $ MKSTREAM`,
`XADD ${keyName} * message apple`,
Expand All @@ -213,12 +168,17 @@ test('Verify that user can change the ID set for the Consumer Group when click o
// Open Stream consumer info view
await browserPage.openKeyDetails(keyName);
await t.click(browserPage.streamTabGroups);
// Change the ID set for the Consumer Group
// Verify that user can change the ID set for the Consumer Group when click on the Pencil button
for (const id of entryIds) {
const idBefore = await browserPage.streamGroupId.textContent;
await t.click(browserPage.editStreamLastIdButton);
await t.typeText(browserPage.lastIdInput, id, { replace: true });
await t.click(browserPage.saveButton);
await t.expect(browserPage.streamGroupId.textContent).notEql(idBefore, 'The last delivered ID is modified and the table is reloaded');
await t.expect(browserPage.streamGroupId.textContent).notEql(idBefore, 'The last delivered ID is modified and the table is not reloaded');
}
// Delete consumer group and check results
await t.click(browserPage.removeConsumerGroupButton);
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(`${consumerGroupName}and all its consumers will be removed from ${keyName}`, 'The confirmation message not displayed');
await t.click(browserPage.removeConsumerGroupButton.nth(1));
await t.expect(browserPage.streamGroupsContainer.textContent).contains('Your Key has no Consumer Groups available.', 'The Consumer Group is not removed from the table');
});
Loading