Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/e2e/.desktop.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ OSS_STANDALONE_EMPTY_PORT=8105
OSS_STANDALONE_REDISGEARS_HOST=localhost
OSS_STANDALONE_REDISGEARS_PORT=8106

OSS_STANDALONE_NOPERM_HOST=localhost
OSS_STANDALONE_NOPERM_PORT=8100

OSS_CLUSTER_REDISGEARS_2_HOST=localhost
OSS_CLUSTER_REDISGEARS_2_PORT=8107

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"selenium-webdriver": "^4.20.0",
"sqlite3": "^5.1.6",
"supertest": "^4.0.2",
"testcafe": "3.6.0",
"testcafe": "3.6.2",
"testcafe-browser-provider-electron": "0.0.21",
"testcafe-reporter-html": "1.4.6",
"testcafe-reporter-json": "2.2.0",
Expand Down
58 changes: 58 additions & 0 deletions tests/e2e/tests/electron/regression/monitor/monitor.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { DatabaseHelper } from '../../../../helpers/database';
import {
MyRedisDatabasePage,
WorkbenchPage,
BrowserPage
} from '../../../../pageObjects';
import { commonUrl, ossStandaloneConfig, ossStandaloneNoPermissionsConfig } from '../../../../helpers/conf';
import { rte } from '../../../../helpers/constants';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { WorkbenchActions } from '../../../../common-actions/workbench-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const workbenchPage = new WorkbenchPage();
const browserPage = new BrowserPage();
const databaseAPIRequests = new DatabaseAPIRequests();
const workbenchActions = new WorkbenchActions();
const databaseHelper = new DatabaseHelper();

fixture `Monitor`
.meta({ type: 'critical_path', rte: rte.standalone })
.page(commonUrl);

test
.before(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
await browserPage.Cli.sendCommandInCli('acl setuser noperm nopass on +@all ~* -monitor -client');
// Check command result in CLI
await t.click(browserPage.Cli.cliExpandButton);
await t.expect(browserPage.Cli.cliOutputResponseSuccess.textContent).eql('"OK"', 'Command from autocomplete was not found & executed');
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneNoPermissionsConfig);
await browserPage.reloadPage();
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
})
.after(async t => {
// Delete created user
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
await browserPage.Cli.sendCommandInCli('acl DELUSER noperm');
// Delete database
await databaseAPIRequests.deleteAllDatabasesByConnectionTypeApi('STANDALONE');
})('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
const command = 'CLIENT LIST';
// Expand the Profiler
await t.click(browserPage.Profiler.expandMonitor);
// Click on run monitor button
await t.click(browserPage.Profiler.startMonitorButton);
// Check that error message is displayed
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.visible).ok('Error message not found');
// Check the error message text
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');
// Verify that if user doesn't have permissions to run monitor, run monitor button is not available
await t.expect(browserPage.Profiler.runMonitorToggle.withAttribute('disabled').exists).ok('No permissions run icon not found');
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
await workbenchPage.sendCommandInWorkbench(command);
// 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"
await workbenchActions.verifyClientListErrorMessage();
});
19 changes: 7 additions & 12 deletions tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ fixture `Upload custom tutorials`
/* https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198,
https://redislabs.atlassian.net/browse/RI-4302, https://redislabs.atlassian.net/browse/RI-4318
*/
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
test.skip
.before(async t => {
test
.before(async() => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
// Create zip file for uploading
Expand All @@ -69,8 +67,8 @@ test.skip
const imageExternalPath = 'Redis Insight screen external';

// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await browserPage.InsightsPanel.togglePanel(true);
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);

await t.expect(tutorials.customTutorials.visible).ok('custom tutorials sections is not visible');
await t.click(tutorials.tutorialOpenUploadButton);
Expand Down Expand Up @@ -164,11 +162,9 @@ test
.notOk(`${tutorialName} tutorial is not uploaded`);
});
// https://redislabs.atlassian.net/browse/RI-4352
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
test.skip
.before(async t => {
test
.before(async() => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch);
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
tutorialName = `${zipFolderName}${Common.generateWord(5)}`;
zipFilePath = path.join('..', 'test-data', 'upload-tutorials', `${tutorialName}.zip`);
// Create zip file for uploading
Expand Down Expand Up @@ -244,8 +240,7 @@ test.skip
await browserPage.searchByKeyName('*key1*');
await verifyKeysDisplayingInTheList(keyNames, true);
});
// Unskip after resolving https://redislabs.atlassian.net/browse/RI-5859
test.skip
test
.before(async() => {
await databaseHelper.acceptLicenseTerms();
await databaseAPIRequests.addNewStandaloneDatabaseApi(
Expand Down
45 changes: 1 addition & 44 deletions tests/e2e/tests/web/regression/monitor/monitor.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ import { DatabaseHelper } from '../../../../helpers/database';
import {
MyRedisDatabasePage,
SettingsPage,
BrowserPage,
WorkbenchPage
BrowserPage
} from '../../../../pageObjects';
import {
commonUrl,
ossStandaloneBigConfig,
ossStandaloneConfig,
ossStandaloneNoPermissionsConfig
} from '../../../../helpers/conf';
import { rte } from '../../../../helpers/constants';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { WorkbenchActions } from '../../../../common-actions/workbench-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const settingsPage = new SettingsPage();
const browserPage = new BrowserPage();
const chance = new Chance();
const workbenchPage = new WorkbenchPage();
const workbenchActions = new WorkbenchActions();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();

Expand Down Expand Up @@ -115,41 +110,3 @@ test
await t.expect(previousTimestamp).notEql(nextTimestamp, 'Monitor results not correct');
}
});
// Skipped due to redis issue https://redislabs.atlassian.net/browse/RI-4111
test.skip
.before(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
await browserPage.Cli.sendCommandInCli('acl setuser noperm nopass on +@all ~* -monitor -client');
// Check command result in CLI
await t.click(browserPage.Cli.cliExpandButton);
await t.expect(browserPage.Cli.cliOutputResponseSuccess.textContent).eql('"OK"', 'Command from autocomplete was not found & executed');
await t.click(browserPage.Cli.cliCollapseButton);
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneNoPermissionsConfig);
await browserPage.reloadPage();
await myRedisDatabasePage.clickOnDBByName(ossStandaloneNoPermissionsConfig.databaseName);
})
.after(async t => {
// Delete created user
await t.click(myRedisDatabasePage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
await browserPage.Cli.sendCommandInCli('acl DELUSER noperm');
// Delete database
await databaseAPIRequests.deleteStandaloneDatabasesApi([ossStandaloneConfig, ossStandaloneNoPermissionsConfig]);
})('Verify that if user doesn\'t have permissions to run monitor, user can see error message', async t => {
const command = 'CLIENT LIST';
// Expand the Profiler
await t.click(browserPage.Profiler.expandMonitor);
// Click on run monitor button
await t.click(browserPage.Profiler.startMonitorButton);
// Check that error message is displayed
await t.expect(browserPage.Profiler.monitorNoPermissionsMessage.visible).ok('Error message not found');
// Check the error message text
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');
// Verify that if user doesn't have permissions to run monitor, run monitor button is not available
await t.expect(browserPage.Profiler.runMonitorToggle.withAttribute('disabled').exists).ok('No permissions run icon not found');
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
await workbenchPage.sendCommandInWorkbench(command);
// 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"
await workbenchActions.verifyClientListErrorMessage();
});
Loading