Skip to content
Merged
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
41 changes: 38 additions & 3 deletions tests/e2e/tests/regression/database/edit-db.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { acceptLicenseTermsAndAddDatabaseApi, clickOnEditDatabaseByName, deleteDatabase } from '../../../helpers/database';
import { AddRedisDatabasePage, MyRedisDatabasePage } from '../../../pageObjects';
import { AddRedisDatabasePage, BrowserPage, CliPage, MyRedisDatabasePage } from '../../../pageObjects';
import {
commonUrl,
ossStandaloneBigConfig,
ossStandaloneConfig
} from '../../../helpers/conf';
import { rte } from '../../../helpers/constants';
import { env, rte } from '../../../helpers/constants';
import { Common } from '../../../helpers/common';
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';

const common = new Common();
const myRedisDatabasePage = new MyRedisDatabasePage();
const addRedisDatabasePage = new AddRedisDatabasePage();
const browserPage = new BrowserPage();
const cliPage = new CliPage();
const database = Object.assign({}, ossStandaloneConfig);

const previousDatabaseName = common.generateWord(20);
const newDatabaseName = common.generateWord(20);
database.databaseName = previousDatabaseName;
const keyName = common.generateWord(10);

fixture `List of Databases`
fixture`List of Databases`
.meta({ type: 'regression', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async() => {
Expand All @@ -42,3 +47,33 @@ test
await t.expect(myRedisDatabasePage.dbNameList.withExactText(newDatabaseName).exists).ok('The database with new alias is in not the list', { timeout: 10000 });
await t.expect(myRedisDatabasePage.dbNameList.withExactText(previousDatabaseName).exists).notOk('The database with previous alias is still in the list', { timeout: 10000 });
});
test
.meta({ env: env.desktop })
.before(async() => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
})
.after(async() => {
// Clear and delete database
await browserPage.deleteKeyByName(keyName);
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
})('Verify that context for previous database not saved after editing port/username/password/certificates/SSH', async t => {
const command = 'HSET';

// Create context modificaions and navigate to db list
await browserPage.addStringKey(keyName);
await browserPage.openKeyDetails(keyName);
await t.click(cliPage.cliExpandButton);
await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true });
await t.pressKey('enter');
await t.click(myRedisDatabasePage.myRedisDBButton);
// Edit port of added database
await clickOnEditDatabaseByName(ossStandaloneConfig.databaseName);
await t.typeText(addRedisDatabasePage.portInput, ossStandaloneBigConfig.port, { replace: true, paste: true });
await t.click(addRedisDatabasePage.addRedisDatabaseButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
// Verify that keys from the database with new port are displayed
await t.expect(browserPage.keysSummary.find('b').withText('18 00').exists).ok('DB with new port not opened');
// Verify that context not saved
await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).notOk('The key details is still selected');
await t.expect(cliPage.cliCommandExecuted.withExactText(command).exists).notOk(`Executed command '${command}' in CLI is still displayed`);
});