Skip to content

Commit 0b027e5

Browse files
authored
Merge pull request #2876 from RedisInsight/e2e/feature/RI-5258-key-type
add check of key type filter for tree view
2 parents 6ccc0a7 + 4a25322 commit 0b027e5

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

tests/e2e/tests/web/critical-path/browser/filtering.e2e.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BrowserPage } from '../../../../pageObjects';
33
import {
44
commonUrl,
55
ossStandaloneBigConfig,
6-
ossStandaloneConfig
6+
ossStandaloneConfigEmpty
77
} from '../../../../helpers/conf';
88
import { keyLength, KeyTypesTexts, rte } from '../../../../helpers/constants';
99
import { addKeysViaCli, deleteKeysViaCli, keyTypes } from '../../../../helpers/keys';
@@ -24,17 +24,17 @@ fixture `Filtering per key name in Browser page`
2424
.meta({ type: 'critical_path', rte: rte.standalone })
2525
.page(commonUrl)
2626
.beforeEach(async() => {
27-
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
27+
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfigEmpty);
2828
})
2929
.afterEach(async() => {
3030
// Delete database
31-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
31+
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfigEmpty);
3232
});
3333
test
3434
.after(async() => {
3535
// Clear and delete database
36-
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneConfig.databaseName);
37-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
36+
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneConfigEmpty.databaseName);
37+
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfigEmpty);
3838
})('Verify that user can search a key with selected data type is filters', async t => {
3939
keyName = Common.generateWord(10);
4040
// Add new key
@@ -62,14 +62,28 @@ test
6262
.after(async() => {
6363
// Clear keys and database
6464
await deleteKeysViaCli(keysData);
65-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
65+
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfigEmpty);
6666
})('Verify that user can filter keys per data type in Browser page', async t => {
6767
keyName = Common.generateWord(10);
6868
// Create new keys
6969
await addKeysViaCli(keysData);
7070
for (const { textType, keyName } of keysData) {
7171
await browserPage.selectFilterGroupType(textType);
7272
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok(`The key of type ${textType} was found`);
73+
textType !== KeyTypesTexts.Graph
74+
? await t.expect(browserPage.filteringLabel.textContent).contains(textType, 'Keys not filtered by key type')
75+
: await t.expect(browserPage.filteringLabel.textContent).contains('graphdata', 'Keys not filtered by key type')
76+
const regExp = new RegExp('[1-9]');
77+
await t.expect(browserPage.keysNumberOfResults.textContent).match(regExp, 'Number of found keys');
78+
}
79+
// Check for tree view
80+
await t.click(browserPage.treeViewButton);
81+
for (const { textType, keyName } of keysData) {
82+
await browserPage.selectFilterGroupType(textType);
83+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok(`The key of type ${textType} was found`);
84+
textType !== KeyTypesTexts.Graph
85+
? await t.expect(browserPage.filteringLabel.textContent).contains(textType, 'Keys not filtered by key type')
86+
: await t.expect(browserPage.filteringLabel.textContent).contains('graphdata', 'Keys not filtered by key type')
7387
const regExp = new RegExp('[1-9]');
7488
await t.expect(browserPage.keysNumberOfResults.textContent).match(regExp, 'Number of found keys');
7589
}

0 commit comments

Comments
 (0)