Skip to content

Commit 9d75621

Browse files
authored
Merge pull request #1322 from RedisInsight/e2e/bugfix/fixes-for-failed-regression
E2e/bugfix/fixes for failed regression
2 parents 1398ca8 + 296dbf6 commit 9d75621

File tree

12 files changed

+173
-187
lines changed

12 files changed

+173
-187
lines changed

redisinsight/ui/src/components/notifications/Notifications.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const Notifications = () => {
5454
size="s"
5555
onClick={() => onSubmitNotification(toast, group)}
5656
className={styles.toastSuccessBtn}
57+
data-testid="submit-tooltip-btn"
5758
>
5859
Ok
5960
</EuiButton>

tests/e2e/pageObjects/add-redis-database-page.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ export class AddRedisDatabasePage {
8888
await t.typeText(this.passwordInput, parameters.databasePassword, { replace: true, paste: true });
8989
}
9090
// Enter logical index
91-
await t
92-
.click(this.databaseIndexCheckbox)
93-
.typeText(this.databaseIndexInput, index, { replace: true, paste: true})
91+
await t.click(this.databaseIndexCheckbox);
92+
await t.typeText(this.databaseIndexInput, index, { replace: true, paste: true});
9493
// Click for saving
95-
.click(this.addRedisDatabaseButton);
94+
await t.click(this.addRedisDatabaseButton);
9695
}
9796

9897
/**
@@ -117,7 +116,7 @@ export class AddRedisDatabasePage {
117116

118117
/**
119118
* Adding a new database from RE Cluster via auto-discover flow
120-
* @param prameters the parameters of the database
119+
* @param parameters the parameters of the database
121120
*/
122121
async addAutodiscoverREClucterDatabase(parameters: AddNewDatabaseParameters): Promise<void> {
123122
await t

tests/e2e/pageObjects/browser-page.ts

Lines changed: 113 additions & 133 deletions
Large diffs are not rendered by default.

tests/e2e/pageObjects/cli-page.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export class CliPage {
6060
* @param groupName The group name
6161
*/
6262
async selectFilterGroupType(groupName: string): Promise<void> {
63-
await t
64-
.click(this.filterGroupTypeButton)
65-
.click(this.filterOptionGroupType.withExactText(groupName));
63+
await t.click(this.filterGroupTypeButton);
64+
await t.click(this.filterOptionGroupType.withExactText(groupName));
6665
}
6766

6867
/**
@@ -75,12 +74,11 @@ export class CliPage {
7574
const keyValueArray = await common.createArrayWithKeyValueAndKeyname(amount, keyName);
7675

7776
// Open CLI
78-
await t
79-
.click(this.cliExpandButton)
77+
await t.click(this.cliExpandButton);
8078
// Add keys
81-
.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true })
82-
.pressKey('enter')
83-
.click(this.cliCollapseButton);
79+
await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true });
80+
await t.pressKey('enter');
81+
await t.click(this.cliCollapseButton);
8482
}
8583

8684
/**
@@ -118,10 +116,10 @@ export class CliPage {
118116
*/
119117
async sendCommandInCli(command: string): Promise<void> {
120118
// Open CLI
121-
await t.click(this.cliExpandButton)
122-
.typeText(this.cliCommandInput, command, { replace: true, paste: true })
123-
.pressKey('enter')
124-
.click(this.cliCollapseButton);
119+
await t.click(this.cliExpandButton);
120+
await t.typeText(this.cliCommandInput, command, { replace: true, paste: true });
121+
await t.pressKey('enter');
122+
await t.click(this.cliCollapseButton);
125123
}
126124

127125
/**
@@ -130,11 +128,10 @@ export class CliPage {
130128
*/
131129
async getSuccessCommandResultFromCli(command: string): Promise<string> {
132130
// Open CLI
133-
await t
134-
.click(this.cliExpandButton)
131+
await t.click(this.cliExpandButton);
135132
// Add keys
136-
.typeText(this.cliCommandInput, command, { replace: true, paste: true })
137-
.pressKey('enter');
133+
await t.typeText(this.cliCommandInput, command, { replace: true, paste: true });
134+
await t.pressKey('enter');
138135
const commandResult = await this.cliOutputResponseSuccess.innerText;
139136
await t.click(this.cliCollapseButton);
140137
return commandResult;
@@ -157,8 +154,8 @@ export class CliPage {
157154
* @param url Command URL for external resourse
158155
*/
159156
async checkURLCommand(command: string, url: string): Promise<void> {
160-
await t.click(this.cliHelperOutputTitles.withExactText(command))
161-
.click(this.readMoreButton)
162-
.expect(getPageUrl()).eql(url, 'The opened page not correct');
157+
await t.click(this.cliHelperOutputTitles.withExactText(command));
158+
await t.click(this.readMoreButton);
159+
await t.expect(getPageUrl()).eql(url, 'The opened page not correct');
163160
}
164161
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class MemoryEfficiencyPage {
99
//-------------------------------------------------------------------------------------------
1010
// BUTTONS
1111
newReportBtn = Selector('[data-testid=start-database-analysis-btn]');
12-
expandArrowBtn = Selector('[data-testid=expand-arrow-test]');
12+
expandArrowBtn = Selector('[data-testid^=expand-arrow-]');
1313
sortByKeyPattern = Selector('[data-testid=tableHeaderSortButton]');
1414
showNoExpiryToggle = Selector('[data-testid=show-no-expiry-switch]');
1515
reportItem = Selector('[data-test-subj^=items-report-]');
@@ -27,7 +27,8 @@ export class MemoryEfficiencyPage {
2727
// TABLE
2828
namespaceTable = Selector('[data-testid=nsp-table-memory]');
2929
nameSpaceTableRows = this.namespaceTable.find('[data-testid^=row-]');
30-
expandedRow = Selector('#row_test_expansion');
30+
expandedRow = Selector('[data-testid^=expanded-]');
31+
expandedItem = this.expandedRow.find('button');
3132
tableKeyPatternHeader = Selector('[data-test-subj*=tableHeaderCell_nsp]');
3233
tableMemoryHeader = Selector('[data-test-subj*=tableHeaderCell_memory]');
3334
tableKeysHeader = Selector('[data-test-subj*=tableHeaderCell_keys]');

tests/e2e/pageObjects/workbench-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export class WorkbenchPage {
113113
workbenchCommandSuccessResultInHistory = Selector(this.cssWorkbenchCommandSuccessResultInHistory);
114114
workbenchCommandFailedResultInHistory = Selector(this.cssWorkbenchCommandFailedResultInHistory);
115115
commandExecutionDateAndTime = Selector('[data-testid=command-execution-date-time]');
116+
historyResultContainer = Selector('[data-testid=query-cli-card-result]');
117+
historyResultRow = Selector('[data-testid=query-cli-card-result]');
116118
//MONACO ELEMENTS
117119
monacoCommandDetails = Selector('div.suggest-details-container');
118120
monacoCloseCommandDetails = Selector('span.codicon-close');

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
55
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
66
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
77
import { Common } from '../../../helpers/common';
8+
import { Selector } from 'testcafe';
89

910
const memoryEfficiencyPage = new MemoryEfficiencyPage();
1011
const myRedisDatabasePage = new MyRedisDatabasePage();
@@ -59,6 +60,9 @@ test
5960
await browserPage.addHashKey(hashKeyName, keysTTL[2], hashValue);
6061
await browserPage.addStreamKey(streamKeyName, 'field', 'value', keysTTL[2]);
6162
await browserPage.addStreamKey(streamKeyNameDelimiter, 'field', 'value', keysTTL[2]);
63+
if (await browserPage.submitTooltipBtn.exists) {
64+
await t.click(browserPage.submitTooltipBtn);
65+
};
6266
await cliPage.addKeysFromCliWithDelimiter('MSET', 15);
6367
await t.click(browserPage.treeViewButton);
6468
// Go to Analysis Tools page
@@ -73,7 +77,7 @@ test
7377
await browserPage.deleteKeyByName(streamKeyNameDelimiter);
7478
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
7579
})('Keyspaces displaying in Summary per keyspaces table', async t => {
76-
// Create new report
80+
// Create new report
7781
await t.click(memoryEfficiencyPage.newReportBtn);
7882
// Verify that up to 15 keyspaces based on the delimiter set in the Tree view are displayed on memory efficiency page
7983
await t.expect(memoryEfficiencyPage.nameSpaceTableRows.count).eql(15, 'Namespaces table has more/less than 15 keyspaces');
@@ -84,9 +88,9 @@ test
8488

8589
await t.click(memoryEfficiencyPage.expandArrowBtn);
8690
// Verify that Key Pattern with >1 keys can be expanded
87-
await t.expect(memoryEfficiencyPage.expandedRow.find('button').count).eql(2, 'Expandable row has no items');
91+
await t.expect(memoryEfficiencyPage.expandedRow.count).eql(2, 'Expandable row has no items');
8892
// Verify that user can quickly set the filters per keyspaces in the Browser/Tree View from the list of keyspaces
89-
await t.click(memoryEfficiencyPage.expandedRow.find('button').nth(0));
93+
await t.click(memoryEfficiencyPage.expandedItem);
9094
// Verify filter by data type applied
9195
await t.expect(await browserPage.filteringLabel.textContent).eql('Stream', 'Key type lable is not displayed in search input');
9296
// Verify keyname in search input prepopulated
@@ -124,7 +128,7 @@ test
124128
await browserPage.deleteKeyByName(keySpaces[4]);
125129
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
126130
})('Namespaces sorting', async t => {
127-
// Create new report
131+
// Create new report
128132
await t.click(memoryEfficiencyPage.newReportBtn);
129133
// Verify that user can sort by Key Pattern column ASC
130134
await t.click(memoryEfficiencyPage.tableKeyPatternHeader);
@@ -167,7 +171,7 @@ test
167171
await browserPage.deleteKeyByName(hashKeyName);
168172
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
169173
})('Memory efficiency context saved', async t => {
170-
// Create new report
174+
// Create new report
171175
await t.click(memoryEfficiencyPage.newReportBtn);
172176
// Reload page
173177
await common.reloadPage();
@@ -196,22 +200,23 @@ test
196200
await browserPage.deleteKeyByName(streamKeyNameDelimiter);
197201
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
198202
})('Summary per expiration time', async t => {
199-
// Create new report
203+
const axisValue = 218;
204+
// Create new report
200205
await t.click(memoryEfficiencyPage.newReportBtn);
201206
// Points are displayed in graph according to their TTL
202207
const firstPointLocation = +((await memoryEfficiencyPage.firstPoint.getAttribute('cy')).slice(0, 2));
203208
const thirdPointLocation = await memoryEfficiencyPage.thirdPoint.getAttribute('cy');
204209
const fourthPointLocation = +((await memoryEfficiencyPage.fourthPoint.getAttribute('cy')).slice(0, 2));
205210
const noExpiryDefaultPointLocation = memoryEfficiencyPage.noExpiryDefaultPoint;
206211

207-
await t.expect(firstPointLocation).lt(198, 'Point in <1 hr breakdown doesn\'t contain key');
208-
await t.expect(fourthPointLocation).lt(198, 'Point in 12-25 Hrs breakdown doesn\'t contain key');
209-
await t.expect(thirdPointLocation).eql('198', 'Point in 4-12 Hrs breakdown contains key');
212+
await t.expect(firstPointLocation).lt(axisValue, 'Point in <1 hr breakdown doesn\'t contain key');
213+
await t.expect(fourthPointLocation).lt(axisValue, 'Point in 12-25 Hrs breakdown doesn\'t contain key');
214+
await t.expect(thirdPointLocation).eql(`${axisValue}`, 'Point in 4-12 Hrs breakdown contains key');
210215
await t.expect(noExpiryDefaultPointLocation.exists).notOk('No expiry breakdown displayed when toggle is off', {timeout: 1000});
211216
// No Expiry toggle shows No expiry breakdown
212217
await t.click(memoryEfficiencyPage.showNoExpiryToggle);
213218
const noExpiryPointLocation = +((await memoryEfficiencyPage.noExpiryPoint.getAttribute('cy')).slice(0, 2));
214-
await t.expect(noExpiryPointLocation).lt(198, 'Point in No expiry breakdown doesn\'t contain key');
219+
await t.expect(noExpiryPointLocation).lt(axisValue, 'Point in No expiry breakdown doesn\'t contain key');
215220
});
216221
test
217222
.before(async t => {

tests/e2e/tests/critical-path/workbench/command-results.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test('Verify that user can see re-run icon near the already executed command and
4141
await t.expect(workbenchPage.queryCardCommand.textContent).eql(commandForSend1, 'The command is not re-executed');
4242

4343
// Verify that user can see expanded result after command re-run at the top of results table in Workbench
44-
await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryCardOutputResponseSuccess).visible).ok('Re-executed command is not expanded');
44+
await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('Re-executed command is not expanded');
4545
await t.expect(workbenchPage.queryCardCommand.nth(0).textContent).eql(commandForSend1, 'The re-executed command is not at the top of results table');
4646

4747
// Delete the command from results

tests/e2e/tests/regression/browser/add-keys.e2e.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ fixture `Different JSON types creation`
2828
test('Verify that user can create different types(string, number, null, array, boolean) of JSON', async t => {
2929
for (let i = 0; i < jsonKeys.length; i++) {
3030
await browserPage.addJsonKey(jsonKeys[i][0], jsonKeys[i][1]);
31+
await t.hover(browserPage.toastCloseButton);
3132
await t.click(browserPage.toastCloseButton);
3233
await t.click(browserPage.refreshKeysButton);
33-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok('New keys are not displayed');
34+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok(`${jsonKeys[i][0]} key not displayed`);
3435
// Add additional check for array elements
3536
if (jsonKeys[i][0].includes('array')) {
3637
for (const j of JSON.parse(jsonKeys[i][1])) {

tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import {
88
AddRedisDatabasePage
99
} from '../../../pageObjects';
1010
import { rte } from '../../../helpers/constants';
11-
import { cloudDatabaseConfig, commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
11+
import { cloudDatabaseConfig, commonUrl, ossStandaloneRedisearch } from '../../../helpers/conf';
1212
import { Common } from '../../../helpers/common';
1313
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
14+
import { deleteAllKeysFromDB } from '../../../helpers/keys';
1415

1516
const myRedisDatabasePage = new MyRedisDatabasePage();
1617
const workbenchPage = new WorkbenchPage();
@@ -34,23 +35,23 @@ fixture `Database overview`
3435
.page(commonUrl)
3536
.beforeEach(async t => {
3637
// Create databases and keys
37-
await acceptLicenseTermsAndAddDatabase(ossStandaloneConfig, ossStandaloneConfig.databaseName);
38+
await acceptLicenseTermsAndAddDatabase(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
3839
await browserPage.addStringKey(keyName);
3940
await t.click(myRedisDatabasePage.myRedisDBButton);
40-
await addRedisDatabasePage.addLogicalRedisDatabase(ossStandaloneConfig, index);
41-
await myRedisDatabasePage.clickOnDBByName(`${ossStandaloneConfig.databaseName} [${index}]`);
41+
await addRedisDatabasePage.addLogicalRedisDatabase(ossStandaloneRedisearch, index);
42+
await myRedisDatabasePage.clickOnDBByName(`${ossStandaloneRedisearch.databaseName} [${index}]`);
4243
keys = await common.createArrayWithKeyValue(keysAmount);
4344
await cliPage.sendCommandInCli(`MSET ${keys.join(' ')}`);
4445
})
4546
.afterEach(async t => {
4647
// Clear and delete databases
4748
await t.click(myRedisDatabasePage.myRedisDBButton);
48-
await myRedisDatabasePage.clickOnDBByName(`${ossStandaloneConfig.databaseName} [${index}]`);
49+
await myRedisDatabasePage.clickOnDBByName(`${ossStandaloneRedisearch.databaseName} [${index}]`);
4950
await cliPage.sendCommandInCli(`DEL ${keys.join(' ')}`);
50-
await deleteDatabase(`${ossStandaloneConfig.databaseName} [${index}]`);
51-
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
51+
await deleteDatabase(`${ossStandaloneRedisearch.databaseName} [${index}]`);
52+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneRedisearch.databaseName);
5253
await browserPage.deleteKeyByName(keyName);
53-
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
54+
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
5455
});
5556
test
5657
.meta({ rte: rte.standalone })('Verify that user can see total and current logical database number of keys (if there are any keys in other logical DBs)', async t => {
@@ -64,7 +65,7 @@ test
6465

6566
// Open Database
6667
await t.click(myRedisDatabasePage.myRedisDBButton);
67-
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
68+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneRedisearch.databaseName);
6869
await t.hover(workbenchPage.overviewTotalKeys);
6970
// Verify that user can see total number of keys and not it current logical database (if there are no any keys in other logical DBs)
7071
await t.expect(browserPage.tooltip.visible).ok('Total keys tooltip not displayed');

0 commit comments

Comments
 (0)