Skip to content

Commit 2f4cdac

Browse files
author
ALENA NABOKA
committed
memory analysis tests fixes
1 parent be969b7 commit 2f4cdac

File tree

3 files changed

+58
-55
lines changed

3 files changed

+58
-55
lines changed

tests/e2e/pageObjects/memory-efficiency-page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export class MemoryEfficiencyPage {
2525
topKeysTitle = Selector('[data-testid=top-keys-title]');
2626
topKeysKeyName = Selector('[data-testid=top-keys-table-name]');
2727
// TABLE
28-
tableRows = Selector('tr[class*=euiTableRow]');
28+
namespaceTable = Selector('[data-testid=nsp-table-memory]');
29+
nameSpaceTableRows = this.namespaceTable.find('[data-testid^=row-]');
2930
expandedRow = Selector('#row_test_expansion');
3031
tableKeyPatternHeader = Selector('[data-test-subj*=tableHeaderCell_nsp]');
3132
tableMemoryHeader = Selector('[data-test-subj*=tableHeaderCell_memory]');

tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ fixture `Memory Efficiency`
3535
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
3636
});
3737
test('No reports/keys message and report tooltip', async t => {
38-
const noReportsMessage = 'No Reports foundRun "New Analysis" to generate first report';
39-
const noKeysMessage = 'No keys to displayUse Workbench Guides and Tutorials to quickly load data';
38+
const noReportsMessage = 'No Reports foundRun "New Analysis" to generate first report.';
39+
const noKeysMessage = 'No keys to displayUse Workbench Guides and Tutorials to quickly load the data.';
4040
const tooltipText = 'Memory EfficiencyAnalyze up to 10K keys in your Redis database to get an overview of your data and memory efficiency recommendations.';
4141

4242
// Verify that user can see the “No reports found” message when report wasn't generated
@@ -45,8 +45,10 @@ test('No reports/keys message and report tooltip', async t => {
4545
await t.click(memoryEfficiencyPage.newReportBtn);
4646
await t.expect(memoryEfficiencyPage.noKeysText.textContent).eql(noKeysMessage, 'No keys message not displayed or text is invalid');
4747
// Verify that user can open workbench page from No keys to display message
48-
// await t.click(browserPage.workbenchLinkButton);
49-
// await t.expect(workbenchPage.expandArea.visible).ok('Workbench page is not opened');
48+
await t.click(browserPage.workbenchLinkButton);
49+
await t.expect(workbenchPage.expandArea.visible).ok('Workbench page is not opened');
50+
// Turn back to Memory Efficiency page
51+
await t.click(myRedisDatabasePage.analysisPageButton);
5052
// Verify that user can see a tooltip when hovering over the icon on the right of the “New analysis” button
5153
await t.hover(memoryEfficiencyPage.reportTooltipIcon);
5254
await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Report tooltip is not displayed or text is invalid');
@@ -74,11 +76,11 @@ test
7476
// Create new report
7577
await t.click(memoryEfficiencyPage.newReportBtn);
7678
// Verify that up to 15 keyspaces based on the delimiter set in the Tree view are displayed on memory efficiency page
77-
await t.expect(memoryEfficiencyPage.tableRows.count).eql(15, 'Namespaces table has more/less than 15 keyspaces');
79+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.count).eql(15, 'Namespaces table has more/less than 15 keyspaces');
7880

7981
// Verify that sorting by Total Memory from big to small applied by default
80-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[0], 'Biggest memory keyspace is not at top');
81-
await t.expect(memoryEfficiencyPage.tableRows.nth(14).textContent).contains(keySpaces[2], 'Smallest memory keyspace is not at down');
82+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[0], 'Biggest memory keyspace is not at top');
83+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(14).textContent).contains(keySpaces[2], 'Smallest memory keyspace is not at down');
8284

8385
await t.click(memoryEfficiencyPage.expandArrowBtn);
8486
// Verify that Key Pattern with >1 keys can be expanded
@@ -103,8 +105,8 @@ test
103105
// Create new report
104106
await t.click(memoryEfficiencyPage.newReportBtn);
105107
// Verify that delimiter can be changed in Tree View and applied
106-
await t.expect(memoryEfficiencyPage.tableRows.count).eql(1, 'New delimiter not applied');
107-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[5], 'Keyspace not displayed');
108+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.count).eql(1, 'New delimiter not applied');
109+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[5], 'Keyspace not displayed');
108110
});
109111
test
110112
.before(async t => {
@@ -126,30 +128,30 @@ test
126128
await t.click(memoryEfficiencyPage.newReportBtn);
127129
// Verify that user can sort by Key Pattern column ASC
128130
await t.click(memoryEfficiencyPage.tableKeyPatternHeader);
129-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[1], 'Sorting by Key Pattern ASC not working');
130-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Key Pattern ASC not working');
131+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[1], 'Sorting by Key Pattern ASC not working');
132+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Key Pattern ASC not working');
131133
// Verify that user can sort by Key Pattern column DESC
132134
await t.click(memoryEfficiencyPage.tableKeyPatternHeader);
133-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Key Pattern DESC not working');
134-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Key Pattern DESC not working');
135+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Key Pattern DESC not working');
136+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Key Pattern DESC not working');
135137

136138
// Verify that user can sort by Total Memory column ASC
137139
await t.click(memoryEfficiencyPage.tableMemoryHeader);
138-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[1], 'Sorting by Total Memory ASC not working');
139-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Total Memory ASC not working');
140+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[1], 'Sorting by Total Memory ASC not working');
141+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Total Memory ASC not working');
140142
// Verify that user can sort by Total Memory column DESC
141143
await t.click(memoryEfficiencyPage.tableMemoryHeader);
142-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Total Memory DESC not working');
143-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Total Memory DESC not working');
144+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Total Memory DESC not working');
145+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Total Memory DESC not working');
144146

145147
// Verify that user can sort by Total Keys column ASC
146148
await t.click(memoryEfficiencyPage.tableKeysHeader);
147-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[6], 'Sorting by Total Keys ASC not working');
148-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Total Keys ASC not working');
149+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[6], 'Sorting by Total Keys ASC not working');
150+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[3], 'Sorting by Total Keys ASC not working');
149151
// Verify that user can sort by Total Keys column DESC
150152
await t.click(memoryEfficiencyPage.tableKeysHeader);
151-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Total Keys DESC not working');
152-
await t.expect(memoryEfficiencyPage.tableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Total Keys DESC not working');
153+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[3], 'Sorting by Total Keys DESC not working');
154+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(4).textContent).contains(keySpaces[1], 'Sorting by Total Keys DESC not working');
153155
});
154156
test
155157
.before(async t => {
@@ -170,13 +172,13 @@ test
170172
// Reload page
171173
await common.reloadPage();
172174
// Verify that context saved after reloading page
173-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[0], 'Summary per keyspaces context not saved');
175+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[0], 'Summary per keyspaces context not saved');
174176
//Go to PubSub page
175177
await t.click(myRedisDatabasePage.pubSubButton);
176178
// Go to Analysis Tools page
177179
await t.click(myRedisDatabasePage.analysisPageButton);
178180
// Verify that context saved after switching between pages
179-
await t.expect(memoryEfficiencyPage.tableRows.nth(0).textContent).contains(keySpaces[0], 'Summary per keyspaces context not saved');
181+
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.nth(0).textContent).contains(keySpaces[0], 'Summary per keyspaces context not saved');
180182
});
181183
test
182184
.before(async t => {

tests/e2e/tests/regression/tree-view/tree-view.e2e.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test
2929
//Delete database
3030
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
3131
})('Verify that user can see message "No keys to display." when there are no keys in the database', async t => {
32-
const message = 'No keys to display.Use Workbench Guides and Tutorials to quickly load the data.'
32+
const message = 'No keys to display.Use Workbench Guides and Tutorials to quickly load the data.';
3333
//Verify the message
3434
await t.click(browserPage.treeViewButton);
3535
await t.expect(browserPage.keyListMessage.textContent).contains(message, 'The message is displayed');
@@ -38,35 +38,35 @@ test
3838
await t.expect(workbenchPage.expandArea.visible).ok('Workbench page is not opened');
3939
});
4040
test('Verify that user can see the total number of keys, the number of keys scanned, the “Scan more” control displayed at the top of Tree view and Browser view', async t => {
41-
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
42-
//Verify the controls on the Browser view
43-
await t.expect(browserPage.totalKeysNumber.visible).ok('The total number of keys is displayed on the Browser view');
44-
await t.expect(browserPage.scannedValue.visible).ok('The number of keys scanned is displayed on the Browser view');
45-
await t.expect(browserPage.scanMoreButton.visible).ok('The scan more button is displayed on the Browser view');
46-
//Verify the controls on the Tree view
47-
await t.click(browserPage.treeViewButton);
48-
await t.expect(browserPage.totalKeysNumber.visible).ok('The total number of keys is displayed on the Tree view');
49-
await t.expect(browserPage.scannedValue.visible).ok('The number of keys scanned is displayed on the Tree view');
50-
await t.expect(browserPage.scanMoreButton.visible).ok('The scan more button is displayed on the Tree view');
51-
});
41+
await browserPage.selectFilterGroupType(KeyTypesTexts.Hash);
42+
//Verify the controls on the Browser view
43+
await t.expect(browserPage.totalKeysNumber.visible).ok('The total number of keys is displayed on the Browser view');
44+
await t.expect(browserPage.scannedValue.visible).ok('The number of keys scanned is displayed on the Browser view');
45+
await t.expect(browserPage.scanMoreButton.visible).ok('The scan more button is displayed on the Browser view');
46+
//Verify the controls on the Tree view
47+
await t.click(browserPage.treeViewButton);
48+
await t.expect(browserPage.totalKeysNumber.visible).ok('The total number of keys is displayed on the Tree view');
49+
await t.expect(browserPage.scannedValue.visible).ok('The number of keys scanned is displayed on the Tree view');
50+
await t.expect(browserPage.scanMoreButton.visible).ok('The scan more button is displayed on the Tree view');
51+
});
5252
test('Verify that when user deletes the key he can see the key is removed from the folder, the number of keys is reduced, the percentage is recalculated', async t => {
53-
//Open the first key in the tree view and remove
54-
await t.click(browserPage.treeViewButton);
55-
await t.expect(browserPage.treeViewDeviceFolder.visible).ok('The key folder is displayed', { timeout: 30000 });
56-
await t.click(browserPage.treeViewDeviceFolder);
57-
const numberOfKeys = await browserPage.treeViewDeviceKyesCount.textContent;
58-
const keyFolder = await browserPage.treeViewDeviceFolder.nth(2).textContent;
59-
await t.click(browserPage.treeViewDeviceFolder.nth(2));
60-
await t.click(browserPage.treeViewDeviceFolder.nth(5));
61-
await browserPage.deleteKey();
62-
//Verify the results
63-
await t.expect(browserPage.treeViewDeviceFolder.nth(2).textContent).notEql(keyFolder, 'The key folder is removed from the tree view');
64-
await t.expect(browserPage.treeViewDeviceKyesCount.textContent).notEql(numberOfKeys, 'The number of keys is recalculated');
65-
});
53+
//Open the first key in the tree view and remove
54+
await t.click(browserPage.treeViewButton);
55+
await t.expect(browserPage.treeViewDeviceFolder.visible).ok('The key folder is displayed', { timeout: 30000 });
56+
await t.click(browserPage.treeViewDeviceFolder);
57+
const numberOfKeys = await browserPage.treeViewDeviceKyesCount.textContent;
58+
const keyFolder = await browserPage.treeViewDeviceFolder.nth(2).textContent;
59+
await t.click(browserPage.treeViewDeviceFolder.nth(2));
60+
await t.click(browserPage.treeViewDeviceFolder.nth(5));
61+
await browserPage.deleteKey();
62+
//Verify the results
63+
await t.expect(browserPage.treeViewDeviceFolder.nth(2).textContent).notEql(keyFolder, 'The key folder is removed from the tree view');
64+
await t.expect(browserPage.treeViewDeviceKyesCount.textContent).notEql(numberOfKeys, 'The number of keys is recalculated');
65+
});
6666
test('Verify that user can see that “:” (colon) used as a default separator for namespaces and see the number of keys found per each namespace', async t => {
67-
await t.click(browserPage.treeViewButton);
68-
//Verify the default separator
69-
await t.expect(browserPage.treeViewSeparator.textContent).eql(':', 'The “:” (colon) used as a default separator for namespaces');
70-
//Verify the number of keys found
71-
await t.expect(browserPage.treeViewKeysNumber.visible).ok('The user can see the number of keys');
72-
});
67+
await t.click(browserPage.treeViewButton);
68+
//Verify the default separator
69+
await t.expect(browserPage.treeViewSeparator.textContent).eql(':', 'The “:” (colon) used as a default separator for namespaces');
70+
//Verify the number of keys found
71+
await t.expect(browserPage.treeViewKeysNumber.visible).ok('The user can see the number of keys');
72+
});

0 commit comments

Comments
 (0)