Skip to content

Commit 1dad4ba

Browse files
Merge pull request #3655 from RedisInsight/e2e/feature/RI-5917-hide-ttl-for-individual-hash-fields
E2e/feature/ri 5917 hide ttl for individual hash fields
2 parents 5252acf + 667590a commit 1dad4ba

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

redisinsight/ui/src/pages/browser/modules/key-details/components/key-details-subheader/KeyDetailsSubheader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const KeyDetailsSubheader = ({
6060
fill
6161
color="secondary"
6262
onClick={onAddKey}
63-
data-testid="btn-add-key"
63+
data-testid="add-key-value-items-btn"
6464
>
6565
+
6666
</EuiButton>

tests/e2e/pageObjects/browser-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ export class BrowserPage extends InstancePage {
271271
//Get Hash key field ttl value
272272
//for Redis databases 7.4 and higher
273273
getHashTtlFieldInput = (fieldName: string): Selector => (Selector(`[data-testid=hash-ttl_content-value-${fieldName}]`));
274+
//checkbox
275+
showTtlCheckbox = Selector('[data-testid=test-check-ttl]~label');
274276

275277
/**
276278
* Common part for Add any new key

tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { rte } from '../../../../helpers/constants';
22
import { DatabaseHelper } from '../../../../helpers/database';
33
import { BrowserPage } from '../../../../pageObjects';
4-
import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf';
4+
import { commonUrl, ossStandaloneConfig, ossStandaloneV7Config } from '../../../../helpers/conf';
55
import { Common } from '../../../../helpers/common';
66
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
77
import { APIKeyRequests } from '../../../../helpers/api/api-keys';
@@ -119,17 +119,16 @@ test('Verify that user can see JSON Key details', async t => {
119119
await t.expect(keyTTLValue).match(expectedTTL, 'The JSON Key TTL is incorrect');
120120
await t.expect(keyBadge).contains('JSON', 'The JSON Key Badge is incorrect');
121121
});
122-
//the test is skipped until redis databases 7.4 is not added to docker
122+
123123
test
124124
.before(async() => {
125-
// await databaseHelper.acceptLicenseTermsAndAddDatabaseApi();
125+
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneV7Config);
126126
})
127127
.after(async() => {
128128
// Clear and delete database
129-
// await apiKeyRequests.deleteKeyByNameApi(keyName, );
130-
// await databaseAPIRequests.deleteStandaloneDatabaseApi();
131-
})
132-
.skip('Verify that user can set ttl for Hash fields', async t => {
129+
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneV7Config.databaseName);
130+
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneV7Config);
131+
})('Verify that user can set ttl for Hash fields', async t => {
133132
keyName = Common.generateWord(10);
134133
const keyName2 = Common.generateWord(10);
135134
const field1 = 'Field1WithTtl';
@@ -150,6 +149,11 @@ test
150149
ttlFieldValue = await browserPage.getHashTtlFieldInput(field2).textContent;
151150
await t.expect(ttlFieldValue).match(expectedTTL, 'the field ttl is not set');
152151

152+
//verify that ttl column can be hidden
153+
await t.click(browserPage.showTtlCheckbox);
154+
await t.expect(await browserPage.getHashTtlFieldInput(field2).exists).notOk('the ttl column is not hidden');
155+
await t.click(browserPage.showTtlCheckbox);
156+
153157
//verify that field is removed after ttl field is expired
154158
await browserPage.editHashFieldTtlValue(field1, '1');
155159
await t.wait(1000);
@@ -160,6 +164,7 @@ test
160164
//verify that the key is removed if key has 1 field and ttl field is expired
161165
await browserPage.addHashKey(keyName2, ' ', field1);
162166
await browserPage.editHashFieldTtlValue(field1, '1');
167+
await t.wait(1000);
163168
await t.click(browserPage.refreshKeysButton);
164169

165170
await t.expect(browserPage.getKeySelectorByName(keyName2).exists).notOk('key is not removed when the field ttl is expired');

0 commit comments

Comments
 (0)