Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const KeyDetailsSubheader = ({
fill
color="secondary"
onClick={onAddKey}
data-testid="btn-add-key"
data-testid="add-key-value-items-btn"
>
+
</EuiButton>
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/pageObjects/browser-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions tests/e2e/tests/web/smoke/browser/verify-key-details.e2e.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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';
Expand All @@ -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);
Expand All @@ -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');
Expand Down