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
4 changes: 4 additions & 0 deletions tests/e2e/pageObjects/add-redis-database-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class AddRedisDatabasePage {
showDatabasesButton: Selector
selectAllCheckbox: Selector
welcomePageTitle: Selector
databaseIndexCheckbox: Selector
databaseIndexInput: Selector
secretKeyInput: Selector;

constructor() {
Expand All @@ -45,6 +47,7 @@ export class AddRedisDatabasePage {
this.showDatabasesButton = Selector('[data-testid=btn-show-databases]');
this.databaseName = Selector('.euiTableCellContent.column_name');
this.selectAllCheckbox = Selector('[data-test-subj=checkboxSelectAll]');
this.databaseIndexCheckbox = Selector('[data-testid=showDb]~div');
//TEXT INPUTS (also referred to as 'Text fields')
this.hostInput = Selector('[data-testid=host]');
this.portInput = Selector('[data-testid=port]');
Expand All @@ -55,6 +58,7 @@ export class AddRedisDatabasePage {
this.accessKeyInput = Selector('[data-testid=access-key]');
this.secretKeyInput = Selector('[data-testid=secret-key]');
this.welcomePageTitle = Selector('[data-testid=welcome-page-title]');
this.databaseIndexInput = Selector('[data-testid=db]');
}

/**
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/pageObjects/browser-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export class BrowserPage {
keysTotalNumber: Selector
overviewTotalKeys: Selector
overviewTotalMemory: Selector
overviewConnectedClients: Selector
selectedFilterTypeString: Selector
overviewCommandsSec: Selector
overviewCpu: Selector
modulesButton: Selector

constructor() {
Expand Down Expand Up @@ -214,6 +217,9 @@ export class BrowserPage {
this.keysTotalNumber = Selector('[data-testid=keys-total]');
this.overviewTotalKeys = Selector('[data-test-subj=overview-total-keys]');
this.overviewTotalMemory = Selector('[data-test-subj=overview-total-memory]');
this.overviewConnectedClients = Selector('[data-test-subj=overview-connected-clients]');
this.overviewCommandsSec = Selector('[data-test-subj=overview-commands-sec]');
this.overviewCpu = Selector('[data-test-subj=overview-cpu]');
this.selectedFilterTypeString = Selector('[data-testid=filter-option-type-selected-string]');
}

Expand Down
20 changes: 20 additions & 0 deletions tests/e2e/tests/critical-path/browser/database-overview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,23 @@ test('Verify that user can see total memory rounded in format B, KB, MB, GB, TB
await t.wait(fiveSecondsTimeout);
await t.expect(browserPage.overviewTotalMemory.textContent).contains('MB', 'Total memory value is MB');
});
test('Verify that user can see additional information in Overview: Connected Clients, Commands/Sec, CPU (%) using Standalone DB connection type', async t => {
//Connect to DB
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
const cpuBeforeEdit = await browserPage.overviewCpu.textContent;
const commandsSecBeforeEdit = await browserPage.overviewCommandsSec.textContent;
//Verify that additional information in Overview: Connected Clients, Commands/Sec, CPU (%) is displayed
await t.expect(browserPage.overviewConnectedClients.visible).ok('Connected Clients is dispalyed in the Overview');
await t.expect(browserPage.overviewCommandsSec.visible).ok('Commands/Sec is dispalyed in the Overview');
await t.expect(browserPage.overviewCpu.visible).ok('CPU (%) is dispalyed in the Overview');
//Add 1M keys
for(let i = 0; i < 10; i++) {
await cliPage.addKeysFromCli('MSET', 100000, `keyName${i}`);
}
//Verify that CPU and commands per second parameters are changed
const cpuAfterEdit = await browserPage.overviewCpu.textContent;
const commandsSecAfterEdit = await browserPage.overviewCommandsSec.textContent;

await t.expect(cpuAfterEdit).notEql(cpuBeforeEdit, 'CPU parameter is changed');
await t.expect(commandsSecAfterEdit).notEql(commandsSecBeforeEdit, 'Commands per second parameter is changed');
});
45 changes: 45 additions & 0 deletions tests/e2e/tests/critical-path/database/logical-databases.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
MyRedisDatabasePage,
UserAgreementPage,
AddRedisDatabasePage
} from '../../../pageObjects';
import {
commonUrl,
ossStandaloneConfig
} from '../../../helpers/conf';

const userAgreementPage = new UserAgreementPage();
const addRedisDatabasePage = new AddRedisDatabasePage();
const myRedisDatabasePage = new MyRedisDatabasePage();

fixture `Logical databases`
.meta({ type: 'critical_path' })
.page(commonUrl)
.beforeEach(async t => {
await t.maximizeWindow();
await userAgreementPage.acceptLicenseTerms();
await myRedisDatabasePage.deleteAllDatabases();
await t.expect(addRedisDatabasePage.addDatabaseButton.exists).ok('The add redis database view', { timeout: 20000 });
})
test('Verify that user can add DB with logical index via host and port from Add DB manually form', async t => {
const index = '0';
await addRedisDatabasePage.addRedisDataBase(ossStandaloneConfig);
//Enter logical index
await t.click(addRedisDatabasePage.databaseIndexCheckbox);
await t.typeText(addRedisDatabasePage.databaseIndexInput, index, { paste: true });
//Click for saving
await t.click(addRedisDatabasePage.addRedisDatabaseButton);
//Verify that the database is in the list
await t.expect(myRedisDatabasePage.dbNameList.withExactText(ossStandaloneConfig.databaseName).exists).ok('The existence of the database', { timeout: 60000 });
});
test('Verify that if user adds DB with logical DB >0, DB name contains postfix "space+[{database index}]"', async t => {
const index = '10';
await addRedisDatabasePage.addRedisDataBase(ossStandaloneConfig);
//Enter logical index
await t.click(addRedisDatabasePage.databaseIndexCheckbox);
await t.typeText(addRedisDatabasePage.databaseIndexInput, index, { paste: true });
//Click for saving
await t.click(addRedisDatabasePage.addRedisDatabaseButton);
//Verify that the database name contains postfix
await t.expect(myRedisDatabasePage.dbNameList.textContent).eql(`${ossStandaloneConfig.databaseName} [${index}]`, 'The postfix is added to the database name', { timeout: 60000 });
});
40 changes: 40 additions & 0 deletions tests/e2e/tests/regression/database/logical-databases.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
MyRedisDatabasePage,
UserAgreementPage,
CliPage,
AddRedisDatabasePage
} from '../../../pageObjects';
import {
commonUrl,
ossStandaloneConfig
} from '../../../helpers/conf';

const userAgreementPage = new UserAgreementPage();
const cliPage = new CliPage();
const addRedisDatabasePage = new AddRedisDatabasePage();
const myRedisDatabasePage = new MyRedisDatabasePage();

fixture `Logical databases`
.meta({ type: 'regression' })
.page(commonUrl)
.beforeEach(async t => {
await t.maximizeWindow();
await userAgreementPage.acceptLicenseTerms();
await myRedisDatabasePage.deleteAllDatabases();
await t.expect(addRedisDatabasePage.addDatabaseButton.exists).ok('The add redis database view', { timeout: 20000 });
})
test('Verify that if user enters any index of the logical database that does not exist in the database, he can see Redis error "ERR DB index is out of range" and cannot proceed', async t => {
const index = '0';
//Add database with logical index
await addRedisDatabasePage.addRedisDataBase(ossStandaloneConfig);
await t.click(addRedisDatabasePage.databaseIndexCheckbox);
await t.typeText(addRedisDatabasePage.databaseIndexInput, index, { paste: true });
await t.click(addRedisDatabasePage.addRedisDatabaseButton);
//Open database and run command with non-existing index
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
await t.click(cliPage.cliExpandButton);
await t.typeText(cliPage.cliCommandInput, 'Select 19', { paste: true });
await t.pressKey('enter');
//Verify the error
await t.expect(cliPage.cliOutputResponseFail.textContent).eql('ERR DB index is out of range', 'Error is dispalyed in CLI');
});