Skip to content

Commit 8c3d681

Browse files
Merge pull request #3695 from RedisInsight/e2e/bugfix/main
E2e/bugfix/main
2 parents dd54ff6 + 26c3063 commit 8c3d681

File tree

6 files changed

+137
-117
lines changed

6 files changed

+137
-117
lines changed

tests/e2e/.desktop.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ OSS_STANDALONE_EMPTY_PORT=8105
2727
OSS_STANDALONE_REDISGEARS_HOST=localhost
2828
OSS_STANDALONE_REDISGEARS_PORT=8106
2929

30+
OSS_STANDALONE_NOPERM_HOST=localhost
31+
OSS_STANDALONE_NOPERM_PORT=8100
32+
3033
OSS_CLUSTER_REDISGEARS_2_HOST=localhost
3134
OSS_CLUSTER_REDISGEARS_2_PORT=8107
3235

tests/e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"selenium-webdriver": "^4.20.0",
6060
"sqlite3": "^5.1.6",
6161
"supertest": "^4.0.2",
62-
"testcafe": "3.6.0",
62+
"testcafe": "3.6.2",
6363
"testcafe-browser-provider-electron": "0.0.21",
6464
"testcafe-reporter-html": "1.4.6",
6565
"testcafe-reporter-json": "2.2.0",
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { DatabaseHelper } from '../../../../helpers/database';
2+
import {
3+
MyRedisDatabasePage,
4+
WorkbenchPage,
5+
BrowserPage
6+
} from '../../../../pageObjects';
7+
import { commonUrl, ossStandaloneConfig, ossStandaloneNoPermissionsConfig } from '../../../../helpers/conf';
8+
import { rte } from '../../../../helpers/constants';
9+
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
10+
import { WorkbenchActions } from '../../../../common-actions/workbench-actions';
11+
12+
const myRedisDatabasePage = new MyRedisDatabasePage();
13+
const workbenchPage = new WorkbenchPage();
14+
const browserPage = new BrowserPage();
15+
const databaseAPIRequests = new DatabaseAPIRequests();
16+
const workbenchActions = new WorkbenchActions();
17+
const databaseHelper = new DatabaseHelper();
18+
19+
fixture `Monitor`
20+
.meta({ type: 'critical_path', rte: rte.standalone })
21+
.page(commonUrl);
22+
23+
test
24+
.before(async t => {
25+
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
26+
await browserPage.Cli.sendCommandInCli('acl setuser noperm nopass on +@all ~* -monitor -client');
27+
// Check command result in CLI
28+
await t.click(browserPage.Cli.cliExpandButton);
29+
await t.expect(browserPage.Cli.cliOutputResponseSuccess.textContent).eql('"OK"', 'Command from autocomplete was not found & executed');
30+
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
31+
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneNoPermissionsConfig);
32+
await browserPage.reloadPage();
33+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
34+
})
35+
.after(async t => {
36+
// Delete created user
37+
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
38+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
39+
await browserPage.Cli.sendCommandInCli('acl DELUSER noperm');
40+
// Delete database
41+
await databaseAPIRequests.deleteAllDatabasesByConnectionTypeApi('STANDALONE');
42+
})('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
43+
const command = 'CLIENT LIST';
44+
// Expand the Profiler
45+
await t.click(browserPage.Profiler.expandMonitor);
46+
// Click on run monitor button
47+
await t.click(browserPage.Profiler.startMonitorButton);
48+
// Check that error message is displayed
49+
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.visible).ok('Error message not found');
50+
// Check the error message text
51+
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.innerText).eql('The Profiler cannot be started. This user has no permissions to run the \'monitor\' command', 'No Permissions message not found');
52+
// Verify that if user doesn't have permissions to run monitor, run monitor button is not available
53+
await t.expect(browserPage.Profiler.runMonitorToggle.withAttribute('disabled').exists).ok('No permissions run icon not found');
54+
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
55+
await workbenchPage.sendCommandInWorkbench(command);
56+
// Verify that user have the following error when there is no permission to run the CLIENT LIST: "NOPERM this user has no permissions to run the 'CLIENT LIST' command or its subcommand"
57+
await workbenchActions.verifyClientListErrorMessage();
58+
});

tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ fixture `Upload custom tutorials`
4949
/* https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198,
5050
https://redislabs.atlassian.net/browse/RI-4302, https://redislabs.atlassian.net/browse/RI-4318
5151
*/
52-
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
53-
test.skip
54-
.before(async t => {
52+
test
53+
.before(async() => {
5554
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
56-
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
5755
tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
5856
zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
5957
// Create zip file for uploading
@@ -69,8 +67,8 @@ test.skip
6967
const imageExternalPath = 'Redis Insight screen external';
7068

7169
// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
72-
await workbenchPage.InsightsPanel.togglePanel(true);
73-
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
70+
await browserPage.InsightsPanel.togglePanel(true);
71+
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
7472

7573
await t.expect(tutorials.customTutorials.visible).ok('custom tutorials sections is not visible');
7674
await t.click(tutorials.tutorialOpenUploadButton);
@@ -164,11 +162,9 @@ test
164162
.notOk(`${tutorialName} tutorial is not uploaded`);
165163
});
166164
// https://redislabs.atlassian.net/browse/RI-4352
167-
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
168-
test.skip
169-
.before(async t => {
165+
test
166+
.before(async() => {
170167
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch);
171-
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
172168
tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
173169
zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
174170
// Create zip file for uploading
@@ -244,8 +240,7 @@ test.skip
244240
await browserPage.searchByKeyName('*key1*');
245241
await verifyKeysDisplayingInTheList(keyNames, true);
246242
});
247-
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
248-
test.skip
243+
test
249244
.before(async() => {
250245
await databaseHelper.acceptLicenseTerms();
251246
await databaseAPIRequests.addNewStandaloneDatabaseApi(

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

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,20 @@ import { DatabaseHelper } from '../../../../helpers/database';
33
import {
44
MyRedisDatabasePage,
55
SettingsPage,
6-
BrowserPage,
7-
WorkbenchPage
6+
BrowserPage
87
} from '../../../../pageObjects';
98
import {
109
commonUrl,
1110
ossStandaloneBigConfig,
1211
ossStandaloneConfig,
13-
ossStandaloneNoPermissionsConfig
1412
} from '../../../../helpers/conf';
1513
import { rte } from '../../../../helpers/constants';
1614
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
17-
import { WorkbenchActions } from '../../../../common-actions/workbench-actions';
1815

1916
const myRedisDatabasePage = new MyRedisDatabasePage();
2017
const settingsPage = new SettingsPage();
2118
const browserPage = new BrowserPage();
2219
const chance = new Chance();
23-
const workbenchPage = new WorkbenchPage();
24-
const workbenchActions = new WorkbenchActions();
2520
const databaseHelper = new DatabaseHelper();
2621
const databaseAPIRequests = new DatabaseAPIRequests();
2722

@@ -115,41 +110,3 @@ test
115110
await t.expect(previousTimestamp).notEql(nextTimestamp, 'Monitor results not correct');
116111
}
117112
});
118-
// Skipped due to redis issue https://redislabs.atlassian.net/browse/RI-4111
119-
test.skip
120-
.before(async t => {
121-
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
122-
await browserPage.Cli.sendCommandInCli('acl setuser noperm nopass on +@all ~* -monitor -client');
123-
// Check command result in CLI
124-
await t.click(browserPage.Cli.cliExpandButton);
125-
await t.expect(browserPage.Cli.cliOutputResponseSuccess.textContent).eql('"OK"', 'Command from autocomplete was not found & executed');
126-
await t.click(browserPage.Cli.cliCollapseButton);
127-
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
128-
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneNoPermissionsConfig);
129-
await browserPage.reloadPage();
130-
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
131-
})
132-
.after(async t => {
133-
// Delete created user
134-
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
135-
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
136-
await browserPage.Cli.sendCommandInCli('acl DELUSER noperm');
137-
// Delete database
138-
await databaseAPIRequests.deleteStandaloneDatabasesApi([ossStandaloneConfig, ossStandaloneNoPermissionsConfig]);
139-
})('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
140-
const command = 'CLIENT LIST';
141-
// Expand the Profiler
142-
await t.click(browserPage.Profiler.expandMonitor);
143-
// Click on run monitor button
144-
await t.click(browserPage.Profiler.startMonitorButton);
145-
// Check that error message is displayed
146-
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.visible).ok('Error message not found');
147-
// Check the error message text
148-
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.innerText).eql('The Profiler cannot be started. This user has no permissions to run the \'monitor\' command', 'No Permissions message not found');
149-
// Verify that if user doesn't have permissions to run monitor, run monitor button is not available
150-
await t.expect(browserPage.Profiler.runMonitorToggle.withAttribute('disabled').exists).ok('No permissions run icon not found');
151-
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
152-
await workbenchPage.sendCommandInWorkbench(command);
153-
// Verify that user have the following error when there is no permission to run the CLIENT LIST: "NOPERM this user has no permissions to run the 'CLIENT LIST' command or its subcommand"
154-
await workbenchActions.verifyClientListErrorMessage();
155-
});

0 commit comments

Comments
 (0)