|
1 | 1 | import { acceptLicenseTermsAndAddDatabaseApi, clickOnEditDatabaseByName, deleteDatabase } from '../../../helpers/database';
|
2 |
| -import { AddRedisDatabasePage, MyRedisDatabasePage } from '../../../pageObjects'; |
| 2 | +import { AddRedisDatabasePage, BrowserPage, CliPage, MyRedisDatabasePage } from '../../../pageObjects'; |
3 | 3 | import {
|
4 | 4 | commonUrl,
|
| 5 | + ossStandaloneBigConfig, |
5 | 6 | ossStandaloneConfig
|
6 | 7 | } from '../../../helpers/conf';
|
7 |
| -import { rte } from '../../../helpers/constants'; |
| 8 | +import { env, rte } from '../../../helpers/constants'; |
8 | 9 | import { Common } from '../../../helpers/common';
|
| 10 | +import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database'; |
9 | 11 |
|
10 | 12 | const common = new Common();
|
11 | 13 | const myRedisDatabasePage = new MyRedisDatabasePage();
|
12 | 14 | const addRedisDatabasePage = new AddRedisDatabasePage();
|
| 15 | +const browserPage = new BrowserPage(); |
| 16 | +const cliPage = new CliPage(); |
13 | 17 | const database = Object.assign({}, ossStandaloneConfig);
|
14 | 18 |
|
15 | 19 | const previousDatabaseName = common.generateWord(20);
|
16 | 20 | const newDatabaseName = common.generateWord(20);
|
17 | 21 | database.databaseName = previousDatabaseName;
|
| 22 | +const keyName = common.generateWord(10); |
18 | 23 |
|
19 |
| -fixture `List of Databases` |
| 24 | +fixture`List of Databases` |
20 | 25 | .meta({ type: 'regression', rte: rte.standalone })
|
21 | 26 | .page(commonUrl)
|
22 | 27 | .beforeEach(async() => {
|
|
42 | 47 | await t.expect(myRedisDatabasePage.dbNameList.withExactText(newDatabaseName).exists).ok('The database with new alias is in not the list', { timeout: 10000 });
|
43 | 48 | await t.expect(myRedisDatabasePage.dbNameList.withExactText(previousDatabaseName).exists).notOk('The database with previous alias is still in the list', { timeout: 10000 });
|
44 | 49 | });
|
| 50 | +test |
| 51 | + .meta({ env: env.desktop }) |
| 52 | + .before(async() => { |
| 53 | + await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName); |
| 54 | + }) |
| 55 | + .after(async() => { |
| 56 | + // Clear and delete database |
| 57 | + await browserPage.deleteKeyByName(keyName); |
| 58 | + await deleteStandaloneDatabaseApi(ossStandaloneConfig); |
| 59 | + })('Verify that context for previous database not saved after editing port/username/password/certificates/SSH', async t => { |
| 60 | + const command = 'HSET'; |
| 61 | + |
| 62 | + // Create context modificaions and navigate to db list |
| 63 | + await browserPage.addStringKey(keyName); |
| 64 | + await browserPage.openKeyDetails(keyName); |
| 65 | + await t.click(cliPage.cliExpandButton); |
| 66 | + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); |
| 67 | + await t.pressKey('enter'); |
| 68 | + await t.click(myRedisDatabasePage.myRedisDBButton); |
| 69 | + // Edit port of added database |
| 70 | + await clickOnEditDatabaseByName(ossStandaloneConfig.databaseName); |
| 71 | + await t.typeText(addRedisDatabasePage.portInput, ossStandaloneBigConfig.port, { replace: true, paste: true }); |
| 72 | + await t.click(addRedisDatabasePage.addRedisDatabaseButton); |
| 73 | + await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName); |
| 74 | + // Verify that keys from the database with new port are displayed |
| 75 | + await t.expect(browserPage.keysSummary.find('b').withText('18 00').exists).ok('DB with new port not opened'); |
| 76 | + // Verify that context not saved |
| 77 | + await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).notOk('The key details is still selected'); |
| 78 | + await t.expect(cliPage.cliCommandExecuted.withExactText(command).exists).notOk(`Executed command '${command}' in CLI is still displayed`); |
| 79 | + }); |
0 commit comments