Skip to content

Commit 583d526

Browse files
authored
Merge pull request #1147 from RedisInsight/e2e/bugfix/bulk-delete-fixes
e2e/bufix/fixes for bulk delete unstable test
2 parents febc14f + ee0474b commit 583d526

File tree

1 file changed

+17
-31
lines changed

1 file changed

+17
-31
lines changed

tests/e2e/tests/critical-path/browser/bulk-delete.e2e.ts

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,21 @@ test('Verify that user can access the bulk actions screen in the Browser', async
3838
// Open bulk actions
3939
await t.click(browserPage.bulkActionsButton);
4040
await t.expect(bulkActionsPage.bulkActionsContainer.visible).ok('Bulk actions screen not opened');
41-
});
42-
test('Verify that user can see pattern summary of the keys selected: key type, pattern', async t => {
43-
// Filter by Hash keys
44-
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
45-
// Open bulk actions
46-
await t.click(browserPage.bulkActionsButton);
41+
// Verify that user can see pattern summary of the keys selected: key type, pattern
4742
await t.expect(bulkActionsPage.infoFilter.innerText).contains('Key type:\nHASH', 'Key type is not correct');
4843
await t.expect(bulkActionsPage.infoSearch.innerText).contains('Pattern: *', 'Key pattern is not correct');
44+
// Verify that user can hover over info icon in Bulk Delete preview and see info about accuracy of the calculation
45+
const tooltipText = 'Expected amount is estimated based on the number of keys scanned and the scan percentage. The final number may be different.';
46+
await t.hover(bulkActionsPage.bulkDeleteTooltipIcon);
47+
await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Tooltip is not displayed or text is invalid');
48+
// Verify that user can see warning message clicking on Delete button for Bulk Deletion
49+
const warningTooltipTitle = 'Are you sure you want to perform this action?';
50+
const warningTooltipMessage = 'All keys with HASH key type and selected pattern will be deleted.';
51+
await t.click(bulkActionsPage.deleteButton);
52+
await t.expect(bulkActionsPage.bulkActionWarningTooltip.textContent).contains(warningTooltipTitle, 'Warning Tooltip title is not displayed or text is invalid');
53+
await t.expect(bulkActionsPage.bulkActionWarningTooltip.textContent).contains(warningTooltipMessage, 'Warning Tooltip message is not displayed or text is invalid');
54+
await t.expect(bulkActionsPage.bulkApplyButton.visible).ok('Confirm deletion button not displayed');
55+
4956
});
5057
test('Verify that user can see no pattern selected message when no key type and pattern applied for Bulk Delete', async t => {
5158
const messageTitle = 'No pattern or key type set';
@@ -56,39 +63,18 @@ test('Verify that user can see no pattern selected message when no key type and
5663
await t.expect(bulkActionsPage.bulkActionsPlaceholder.textContent).contains(messageText, 'No pattern message not displayed');
5764
});
5865
test('Verify that user can see summary of scanned level', async t => {
59-
const expectedAmount = 'Expected amount: ~10 002 keys';
60-
const scannedKeys = 'Scanned 5% (500/10 002) and found 500 keys';
66+
const expectedAmount = new RegExp('Expected amount: ~' + '10 ' + '.');
67+
const scannedKeys = new RegExp('Scanned 5% \\(....10 ...\\) and found ... keys');
6168
// Add 10000 Hash keys
6269
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
6370
// Filter by Hash keys
6471
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
6572
// Open bulk actions
6673
await t.click(browserPage.bulkActionsButton);
6774
// Verify that prediction of # of keys matching the filter in the entire database displayed
68-
await t.expect(bulkActionsPage.bulkActionsSummary.textContent).contains(expectedAmount, 'Bulk actions summary is not correct');
75+
await t.expect(bulkActionsPage.bulkActionsSummary.textContent).match(expectedAmount, 'Bulk actions summary is not correct');
6976
// Verify that % of total keys scanned, # of keys scanned / total # of keys in the database, # of keys matching the filter displayed
70-
await t.expect(bulkActionsPage.bulkDeleteSummary.innerText).contains(scannedKeys, 'Bulk delete summary is not correct');
71-
});
72-
test('Verify that user can hover over info icon in Bulk Delete preview and see info about accuracy of the calculation', async t => {
73-
const tooltipText = 'Expected amount is estimated based on the number of keys scanned and the scan percentage. The final number may be different.';
74-
// Filter by Hash keys
75-
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
76-
// Open bulk actions
77-
await t.click(browserPage.bulkActionsButton);
78-
await t.hover(bulkActionsPage.bulkDeleteTooltipIcon);
79-
await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Tooltip is not displayed or text is invalid');
80-
});
81-
test('Verify that user can see warning message clicking on Delete button for Bulk Deletion', async t => {
82-
const warningTooltipTitle = 'Are you sure you want to perform this action?';
83-
const warningTooltipMessage = 'All keys with HASH key type and selected pattern will be deleted.';
84-
// Filter by Hash keys
85-
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
86-
// Open bulk actions
87-
await t.click(browserPage.bulkActionsButton);
88-
await t.click(bulkActionsPage.deleteButton);
89-
await t.expect(bulkActionsPage.bulkActionWarningTooltip.textContent).contains(warningTooltipTitle, 'Warning Tooltip title is not displayed or text is invalid');
90-
await t.expect(bulkActionsPage.bulkActionWarningTooltip.textContent).contains(warningTooltipMessage, 'Warning Tooltip message is not displayed or text is invalid');
91-
await t.expect(bulkActionsPage.bulkApplyButton.visible).ok('Confirm deletion button not displayed');
77+
await t.expect(bulkActionsPage.bulkDeleteSummary.innerText).match(scannedKeys, 'Bulk delete summary is not correct');
9278
});
9379
test('Verify that user can see blue progress line during the process of bulk deletion', async t => {
9480
// Add 500000 Hash keys

0 commit comments

Comments
 (0)