diff --git a/redisinsight/ui/src/pages/browser/modules/key-details/components/key-details-subheader/KeyDetailsSubheader.tsx b/redisinsight/ui/src/pages/browser/modules/key-details/components/key-details-subheader/KeyDetailsSubheader.tsx index 46abfff49e..f1cf2b8566 100644 --- a/redisinsight/ui/src/pages/browser/modules/key-details/components/key-details-subheader/KeyDetailsSubheader.tsx +++ b/redisinsight/ui/src/pages/browser/modules/key-details/components/key-details-subheader/KeyDetailsSubheader.tsx @@ -60,7 +60,7 @@ export const KeyDetailsSubheader = ({ fill color="secondary" onClick={onAddKey} - data-testid="btn-add-key" + data-testid="add-key-value-items-btn" > + diff --git a/tests/e2e/pageObjects/browser-page.ts b/tests/e2e/pageObjects/browser-page.ts index 2dab013eb3..3b9d061cca 100644 --- a/tests/e2e/pageObjects/browser-page.ts +++ b/tests/e2e/pageObjects/browser-page.ts @@ -271,6 +271,8 @@ export class BrowserPage extends InstancePage { //Get Hash key field ttl value //for Redis databases 7.4 and higher getHashTtlFieldInput = (fieldName: string): Selector => (Selector(`[data-testid=hash-ttl_content-value-${fieldName}]`)); + //checkbox + showTtlCheckbox = Selector('[data-testid=test-check-ttl]~label'); /** * Common part for Add any new key diff --git a/tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts b/tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts index d1fde3dceb..ee75bb969b 100644 --- a/tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts +++ b/tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts @@ -1,7 +1,7 @@ import { rte } from '../../../../helpers/constants'; import { DatabaseHelper } from '../../../../helpers/database'; import { BrowserPage } from '../../../../pageObjects'; -import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf'; +import { commonUrl, ossStandaloneConfig, ossStandaloneV7Config } from '../../../../helpers/conf'; import { Common } from '../../../../helpers/common'; import { DatabaseAPIRequests } from '../../../../helpers/api/api-database'; import { APIKeyRequests } from '../../../../helpers/api/api-keys'; @@ -119,17 +119,16 @@ test('Verify that user can see JSON Key details', async t => { await t.expect(keyTTLValue).match(expectedTTL, 'The JSON Key TTL is incorrect'); await t.expect(keyBadge).contains('JSON', 'The JSON Key Badge is incorrect'); }); -//the test is skipped until redis databases 7.4 is not added to docker + test .before(async() => { - // await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(); + await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneV7Config); }) .after(async() => { // Clear and delete database - // await apiKeyRequests.deleteKeyByNameApi(keyName, ); - // await databaseAPIRequests.deleteStandaloneDatabaseApi(); - }) - .skip('Verify that user can set ttl for Hash fields', async t => { + await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneV7Config.databaseName); + await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneV7Config); + })('Verify that user can set ttl for Hash fields', async t => { keyName = Common.generateWord(10); const keyName2 = Common.generateWord(10); const field1 = 'Field1WithTtl'; @@ -150,6 +149,11 @@ test ttlFieldValue = await browserPage.getHashTtlFieldInput(field2).textContent; await t.expect(ttlFieldValue).match(expectedTTL, 'the field ttl is not set'); + //verify that ttl column can be hidden + await t.click(browserPage.showTtlCheckbox); + await t.expect(await browserPage.getHashTtlFieldInput(field2).exists).notOk('the ttl column is not hidden'); + await t.click(browserPage.showTtlCheckbox); + //verify that field is removed after ttl field is expired await browserPage.editHashFieldTtlValue(field1, '1'); await t.wait(1000); @@ -160,6 +164,7 @@ test //verify that the key is removed if key has 1 field and ttl field is expired await browserPage.addHashKey(keyName2, ' ', field1); await browserPage.editHashFieldTtlValue(field1, '1'); + await t.wait(1000); await t.click(browserPage.refreshKeysButton); await t.expect(browserPage.getKeySelectorByName(keyName2).exists).notOk('key is not removed when the field ttl is expired');