Skip to content

Commit 86ea5c4

Browse files
committed
[E2E] Fix desktop monitor permissions test
1 parent de9255c commit 86ea5c4

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

tests/e2e/helpers/conf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const cloudDatabaseConfig = {
7676

7777
export const ossStandaloneNoPermissionsConfig = {
7878
host: process.env.OSS_STANDALONE_HOST || 'oss-standalone',
79-
port: process.env.OSS_STANDALONE_PORT = '6379' || '6379',
79+
port: process.env.OSS_STANDALONE_PORT || '6379',
8080
databaseName: `${process.env.OSS_STANDALONE_DATABASE_NAME || 'oss-standalone-no-permissions'}-${uniqueId}`,
8181
databaseUsername: process.env.OSS_STANDALONE_USERNAME || 'noperm',
8282
databasePassword: process.env.OSS_STANDALONE_PASSWORD

tests/e2e/helpers/database.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export async function addNewStandaloneDatabase(databaseParameters: AddNewDatabas
2828
//Click for saving
2929
await t.click(addRedisDatabasePage.addRedisDatabaseButton);
3030
//Wait for database to be exist
31-
await t.expect(addRedisDatabasePage.errorMessage.exists).notOk(`The error message is not displyed after add the ${databaseParameters.databaseName}`);
3231
await t.expect(myRedisDatabasePage.dbNameList.withExactText(databaseParameters.databaseName).exists).ok('The existence of the database', { timeout: 10000 });
3332
//Close message
3433
await t.click(myRedisDatabasePage.toastCloseButton);

tests/e2e/tests/regression/monitor/monitor.e2e.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ fixture `Monitor`
3131
.afterEach(async() => {
3232
//Delete database
3333
await deleteDatabase(ossStandaloneConfig.databaseName);
34-
})
34+
});
3535
test
36-
.meta({ rte: rte.standalone })
37-
('Verify that when user closes the Monitor by clicking on "Close Monitor" button Monitor stopped', async t => {
36+
.meta({ rte: rte.standalone })('Verify that when user closes the Monitor by clicking on "Close Monitor" button Monitor stopped', async t => {
3837
//Run monitor
3938
await monitorPage.startMonitor();
4039
//Close Monitor
@@ -47,8 +46,7 @@ test
4746
await t.expect(monitorPage.startMonitorButton.visible).ok('Start profiler button');
4847
});
4948
test
50-
.meta({ rte: rte.standalone })
51-
('Verify that Monitor is stopped when user clicks on "Stop" button', async t => {
49+
.meta({ rte: rte.standalone })('Verify that Monitor is stopped when user clicks on "Stop" button', async t => {
5250
//Run monitor
5351
await monitorPage.startMonitor();
5452
//Click on Stop Monitor button
@@ -59,8 +57,7 @@ test
5957
await t.expect(monitorPage.monitorIsStoppedText.nextSibling().exists).notOk('No commands in monitor');
6058
});
6159
test
62-
.meta({ rte: rte.standalone })
63-
('Verify that when user refreshes the page the list of results in Monitor is not saved', async t => {
60+
.meta({ rte: rte.standalone })('Verify that when user refreshes the page the list of results in Monitor is not saved', async t => {
6461
//Run monitor
6562
await monitorPage.startMonitor();
6663
//Refresh the page
@@ -72,8 +69,7 @@ test
7269
await t.expect(monitorPage.monitorWarningMessage.exists).ok('Warning message in monitor');
7370
});
7471
test
75-
.meta({ rte: rte.standalone })
76-
('Verify that when user clicks on "Clear" button in Monitor, all commands history is removed', async t => {
72+
.meta({ rte: rte.standalone })('Verify that when user clicks on "Clear" button in Monitor, all commands history is removed', async t => {
7773
//Run monitor
7874
await monitorPage.startMonitor();
7975
//Stop Monitor
@@ -99,12 +95,11 @@ test
9995
await settingsPage.changeKeysToScanValue('10000');
10096
//Delete database
10197
await deleteDatabase(ossStandaloneBigConfig.databaseName);
102-
})
103-
('Verify that user can see monitor results in high DB load', async t => {
98+
})('Verify that user can see monitor results in high DB load', async t => {
10499
//Run monitor
105100
await monitorPage.startMonitor();
106101
//Search by not existed key pattern
107-
await browserPage.searchByKeyName(`${chance.string({ length:10 })}*`);
102+
await browserPage.searchByKeyName(`${chance.string({ length: 10 })}*`);
108103
//Check that the last child is updated
109104
for (let i = 0; i <= 10; i++) {
110105
const previousTimestamp = await monitorPage.monitorCommandLineTimestamp.nth(-1).textContent;
@@ -116,16 +111,13 @@ test
116111
test
117112
.meta({ rte: rte.standalone })
118113
.before(async t => {
119-
console.log('Before acceptLicenseTermsAndAddDatabase function');
120114
await acceptLicenseTermsAndAddDatabase(ossStandaloneConfig, ossStandaloneConfig.databaseName);
121-
console.log('After acceptLicenseTermsAndAddDatabase function');
122115
await cliPage.sendCommandInCli('acl setuser noperm nopass on +@all ~* -monitor');
123116
//Check command result in CLI
124117
await t.click(cliPage.cliExpandButton);
125118
await t.expect(cliPage.cliOutputResponseSuccess.textContent).eql('"OK"', 'Command from autocomplete was found & executed');
126119
await t.click(cliPage.cliCollapseButton);
127120
await deleteDatabase(ossStandaloneConfig.databaseName);
128-
console.log('Before addNewStandaloneDatabase function with no permissions');
129121
await addNewStandaloneDatabase(ossStandaloneNoPermissionsConfig);
130122
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
131123
})
@@ -134,8 +126,7 @@ test
134126
await cliPage.sendCommandInCli('acl DELUSER noperm');
135127
//Delete database
136128
await deleteDatabase(ossStandaloneNoPermissionsConfig.databaseName);
137-
})
138-
('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
129+
})('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
139130
//Expand the Profiler
140131
await t.click(monitorPage.expandMonitor);
141132
//Click on run monitor button

0 commit comments

Comments
 (0)