|
1 |
| -import { rte } from '../../../helpers/constants'; |
| 1 | +import {rte} from '../../../helpers/constants'; |
2 | 2 | import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
|
3 | 3 | import { BrowserPage, CliPage } from '../../../pageObjects';
|
4 |
| -import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf'; |
| 4 | +import {commonUrl, ossStandaloneBigConfig, ossStandaloneConfig} from '../../../helpers/conf'; |
5 | 5 | import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
|
| 6 | +import {Common} from '../../../helpers/common'; |
| 7 | +import {BrowserActions} from '../../../common-actions/browser-actions'; |
6 | 8 |
|
7 | 9 | const browserPage = new BrowserPage();
|
| 10 | +const browserActions = new BrowserActions(); |
| 11 | +const common = new Common(); |
8 | 12 | const cliPage = new CliPage();
|
9 | 13 | const jsonKeys = [['JSON-string', '"test"'], ['JSON-number', '782364'], ['JSON-boolean', 'true'], ['JSON-null', 'null'], ['JSON-array', '[1, 2, 3]']];
|
| 14 | +let keyNames: string[]; |
| 15 | +let indexName: string; |
10 | 16 |
|
11 |
| -fixture `Different JSON types creation` |
| 17 | +fixture `Add keys` |
12 | 18 | .meta({
|
13 | 19 | type: 'regression',
|
14 | 20 | rte: rte.standalone
|
@@ -44,3 +50,56 @@ test('Verify that user can create different types(string, number, null, array, b
|
44 | 50 | }
|
45 | 51 | }
|
46 | 52 | });
|
| 53 | +// https://redislabs.atlassian.net/browse/RI-3995 |
| 54 | +test |
| 55 | + .before(async() => { |
| 56 | + await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig, ossStandaloneBigConfig.databaseName); |
| 57 | + }) |
| 58 | + .after(async() => { |
| 59 | + let commandString = 'DEL'; |
| 60 | + for (const key of keyNames) { |
| 61 | + commandString = commandString.concat(` ${key}`); |
| 62 | + } |
| 63 | + const commands = [`FT.DROPINDEX ${indexName}`, commandString]; |
| 64 | + await cliPage.sendCommandsInCli(commands); |
| 65 | + await deleteStandaloneDatabaseApi(ossStandaloneBigConfig); |
| 66 | + })('Verify that the new key is displayed at the top of the list', async t => { |
| 67 | + const keyName = common.generateWord(12); |
| 68 | + const keyName1 = common.generateWord(12); |
| 69 | + const keyName2 = common.generateWord(36); |
| 70 | + const keyName3 = common.generateWord(10); |
| 71 | + const keyName4 = `${common.generateWord(10)}-test`; |
| 72 | + const keyName5 = `hash-${common.generateWord(12)}`; |
| 73 | + keyNames = [keyName, keyName1, keyName2, keyName3, keyName4, keyName5]; |
| 74 | + indexName = `idx:${keyName5}`; |
| 75 | + const command = `FT.CREATE ${indexName} ON HASH PREFIX 1 hash- SCHEMA name TEXT`; |
| 76 | + await cliPage.sendCommandInCli(command); |
| 77 | + |
| 78 | + await browserPage.addStringKey(keyName); |
| 79 | + await browserActions.verifyKeyDisplayedTopAndOpened(keyName); |
| 80 | + // Verify displaying added multiple keys |
| 81 | + await browserPage.addSetKey(keyName1); |
| 82 | + await browserActions.verifyKeyDisplayedTopAndOpened(keyName1); |
| 83 | + |
| 84 | + await browserPage.addHashKey(keyName2); |
| 85 | + await browserActions.verifyKeyDisplayedTopAndOpened(keyName2); |
| 86 | + // Verify that user can see the key removed from the top when refresh List view |
| 87 | + await t.click(browserPage.refreshKeysButton); |
| 88 | + await browserActions.verifyKeyIsNotDisplayedTop(keyName1); |
| 89 | + // Verify that the new key is not displayed at the top when filter per key name applied |
| 90 | + await browserPage.searchByKeyName('*test'); |
| 91 | + await browserPage.addHashKey(keyName4); |
| 92 | + await browserActions.verifyKeyIsNotDisplayedTop(keyName4); |
| 93 | + |
| 94 | + await t.click(browserPage.clearFilterButton); |
| 95 | + await t.click(browserPage.treeViewButton); |
| 96 | + await browserPage.addHashKey(keyName3); |
| 97 | + // Verify that user can see Tree view recalculated when new key is added in Tree view |
| 98 | + await browserActions.verifyKeyDisplayedTopAndOpened(keyName3); |
| 99 | + |
| 100 | + await t.click(browserPage.redisearchModeBtn); |
| 101 | + await browserPage.selectIndexByName(indexName); |
| 102 | + await browserPage.addHashKey(keyName5, '100000', 'name', 'value'); |
| 103 | + // Verify that the new key is not displayed at the top for the Search capability |
| 104 | + await browserActions.verifyKeyIsNotDisplayedTop(keyName3); |
| 105 | + }); |
0 commit comments