Skip to content

Commit e961742

Browse files
committed
add step for verifying after refresh
1 parent 318017a commit e961742

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

tests/e2e/common-actions/browser-actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export class BrowserActions {
4444
* */
4545
async verifyKeyDisplayedTopAndOpened(keyName: string): Promise<void> {
4646
await t.expect(Selector('[aria-rowindex="1"]').withText(keyName).visible).ok(`element with ${keyName} is not visible in the top of list`);
47-
await t.expect(Selector('[data-testid="key-name-text"]').withText(keyName).visible).ok(`element with ${keyName} is not opened`);
47+
await t.expect(browserPage.keyNameFormDetails.withText(keyName).visible).ok(`element with ${keyName} is not opened`);
4848
}
4949
/**
5050
* Verify that the new key is not displayed at the top of the list of keys and opened and pre-selected in List view
5151
* */
5252
async verifyKeyIsNotDisplayedTop(keyName: string): Promise<void> {
53-
await t.expect(Selector('[aria-rowindex="1"]').withText(keyName).visible).notOk(`element with ${keyName} is not visible in the top of list`);
53+
await t.expect(Selector('[aria-rowindex="1"]').withText(keyName).exists).notOk(`element with ${keyName} is not visible in the top of list`);
5454
}
5555
}

tests/e2e/tests/regression/browser/add-keys.e2e.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import {keyLength, rte} from '../../../helpers/constants';
1+
import {rte} from '../../../helpers/constants';
22
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
33
import { BrowserPage, CliPage } from '../../../pageObjects';
4-
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
4+
import {commonUrl, ossStandaloneBigConfig, ossStandaloneConfig} from '../../../helpers/conf';
55
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
6-
import {addKeysViaCli, deleteKeysViaCli, keyTypes} from '../../../helpers/keys';
76
import {Common} from '../../../helpers/common';
87
import {BrowserActions} from '../../../common-actions/browser-actions';
98

@@ -12,10 +11,8 @@ const browserActions = new BrowserActions();
1211
const common = new Common();
1312
const cliPage = new CliPage();
1413
const jsonKeys = [['JSON-string', '"test"'], ['JSON-number', '782364'], ['JSON-boolean', 'true'], ['JSON-null', 'null'], ['JSON-array', '[1, 2, 3]']];
15-
const keysData = keyTypes.map(object => ({ ...object }));
1614
let keyNames: string[];
1715
let indexName: string;
18-
keysData.forEach(key => key.keyName = `${key.keyName}` + '-' + `${common.generateWord(keyLength)}`);
1916

2017
fixture `Add keys`
2118
.meta({
@@ -55,23 +52,22 @@ test('Verify that user can create different types(string, number, null, array, b
5552
});
5653
// https://redislabs.atlassian.net/browse/RI-3995
5754
test
55+
.only
5856
.before(async() => {
59-
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
60-
await addKeysViaCli(keysData);
57+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig, ossStandaloneBigConfig.databaseName);
6158
})
6259
.after(async() => {
6360
let commandString = 'DEL';
6461
for (const key of keyNames) {
6562
commandString = commandString.concat(` ${key}`);
6663
}
6764
const commands = [`FT.DROPINDEX ${indexName}`, commandString];
68-
await deleteKeysViaCli(keysData);
6965
await cliPage.sendCommandsInCli(commands);
70-
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
66+
await deleteStandaloneDatabaseApi(ossStandaloneBigConfig);
7167
})('Verify that the new key is displayed at the top of the list', async t => {
7268
const keyName = common.generateWord(12);
7369
const keyName1 = common.generateWord(12);
74-
const keyName2 = common.generateWord(36); // to be sure element will not be displayed be at the top of list
70+
const keyName2 = common.generateWord(36);
7571
const keyName3 = common.generateWord(10);
7672
const keyName4 = `${common.generateWord(10)}-test`;
7773
const keyName5 = `hash-${common.generateWord(12)}`;
@@ -88,6 +84,9 @@ test
8884

8985
await browserPage.addHashKey(keyName2);
9086
await browserActions.verifyKeyDisplayedTopAndOpened(keyName2);
87+
// Verify that user can see the key removed from the top when refresh List view
88+
await t.click(browserPage.refreshKeysButton);
89+
await browserActions.verifyKeyIsNotDisplayedTop(keyName1);
9190
// Verify that the new key is not displayed at the top when filter per key name applied
9291
await browserPage.searchByKeyName('*test');
9392
await browserPage.addHashKey(keyName4);

0 commit comments

Comments
 (0)