Skip to content

Commit bbcaee8

Browse files
authored
Merge pull request #1448 from RedisInsight/e2e/feature/RI-3872_context-for-key-selected
Add e2e test for Saved Context in Browser
2 parents b204d83 + 9a2b9b6 commit bbcaee8

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

tests/e2e/tests/critical-path/browser/context.e2e.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
BrowserPage,
55
CliPage
66
} from '../../../pageObjects';
7-
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
7+
import { commonUrl, ossStandaloneBigConfig, ossStandaloneConfig } from '../../../helpers/conf';
88
import { Common } from '../../../helpers/common';
99
import { KeyTypesTexts, rte } from '../../../helpers/constants';
1010
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
@@ -92,19 +92,31 @@ test('Verify that user can see saved executed commands in CLI on Browser page wh
9292
}
9393
});
9494
test
95+
.before(async() => {
96+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig, ossStandaloneBigConfig.databaseName);
97+
})
9598
.after(async() => {
96-
// Clear and delete database
97-
await browserPage.deleteKeyByName(keyName);
98-
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
99+
// Delete database
100+
await deleteStandaloneDatabaseApi(ossStandaloneBigConfig);
99101
})('Verify that user can see key details selected when he returns back to Browser page', async t => {
100-
// Add and open new key details and navigate to Settings
101-
keyName = common.generateWord(10);
102-
await browserPage.addHashKey(keyName);
103-
await browserPage.openKeyDetails(keyName);
102+
// Scroll keys elements
103+
const scrollY = 1000;
104+
await t.scroll(browserPage.cssSelectorGrid, 0, scrollY);
105+
106+
const keysCount = await browserPage.virtualTableContainer.find(browserPage.cssVirtualTableRow).count;
107+
const targetKey = browserPage.virtualTableContainer.find(browserPage.cssVirtualTableRow).nth(Math.floor(keysCount / 2));
108+
const targetKeyName = await targetKey.find(browserPage.cssSelectorKey).innerText;
109+
// Open key details
110+
await t.click(targetKey);
111+
await t.expect(await targetKey.getAttribute('class')).contains('table-row-selected', 'Not correct key selected in key list');
112+
104113
await t.click(myRedisDatabasePage.settingsButton);
105114
// Return back to Browser and check key details selected
106115
await t.click(myRedisDatabasePage.browserButton);
107-
await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is selected');
116+
// Check Keys details saved
117+
await t.expect(browserPage.keyNameFormDetails.innerText).eql(targetKeyName, 'Key details is not saved as context');
118+
// Check Key selected in Key List
119+
await t.expect(await targetKey.getAttribute('class')).contains('table-row-selected', 'Not correct key selected in key list');
108120
});
109121
test
110122
.after(async() => {

0 commit comments

Comments
 (0)