@@ -94,6 +94,7 @@ export class BrowserPage extends InstancePage {
94
94
saveButton = Selector ( '[data-testid=save-btn]' ) ;
95
95
bulkActionsButton = Selector ( '[data-testid=btn-bulk-actions]' ) ;
96
96
editHashButton = Selector ( '[data-testid^=hash_edit-btn-]' ) ;
97
+ editHashFieldTtlButton = Selector ( '[data-testid^=hash-ttl_edit-btn-]' , { timeout : 500 } ) ;
97
98
editZsetButton = Selector ( '[data-testid^=zset_edit-btn-]' ) ;
98
99
editListButton = Selector ( '[data-testid^=list_edit-btn-]' ) ;
99
100
cancelStreamGroupBtn = Selector ( '[data-testid=cancel-stream-groups-btn]' ) ;
@@ -161,6 +162,7 @@ export class BrowserPage extends InstancePage {
161
162
hashFieldValueInput = Selector ( '[data-testid=field-value]' ) ;
162
163
hashFieldNameInput = Selector ( '[data-testid=field-name]' ) ;
163
164
hashFieldValueEditor = Selector ( '[data-testid^=hash_value-editor]' ) ;
165
+ hashTtlFieldInput = Selector ( '[data-testid=hash-ttl]' ) ;
164
166
listKeyElementInput = Selector ( '[data-testid=element]' ) ;
165
167
listKeyElementEditorInput = Selector ( '[data-testid^=list_value-editor-]' ) ;
166
168
stringKeyValueInput = Selector ( '[data-testid=string-value]' ) ;
@@ -265,6 +267,10 @@ export class BrowserPage extends InstancePage {
265
267
noReadySearchDialogTitle = Selector ( '[data-testid=welcome-page-title]' ) ;
266
268
closeDialogButton = Selector ( '[class*=euiModal__closeIcon]' ) ;
267
269
270
+ //Get Hash key field ttl value
271
+ //for Redis databases 7.4 and higher
272
+ getHashTtlFieldInput = ( fieldName : string ) : Selector => ( Selector ( `[data-testid=hash-ttl_content-value-${ fieldName } ]` ) ) ;
273
+
268
274
/**
269
275
* Common part for Add any new key
270
276
* @param keyName The name of the key
@@ -399,8 +405,8 @@ export class BrowserPage extends InstancePage {
399
405
* @param TTL The Time to live value of the key
400
406
* @param field The field name of the key
401
407
* @param value The value of the key
402
- */
403
- async addHashKey ( keyName : string , TTL = ' ' , field = ' ' , value = ' ' ) : Promise < void > {
408
+ * @param fieldTtl The ttl of the field for Redis databases 7.4 and higher* /
409
+ async addHashKey ( keyName : string , TTL = ' ' , field = ' ' , value = ' ' , fieldTtl = '' ) : Promise < void > {
404
410
if ( await this . Toast . toastCloseButton . exists ) {
405
411
await t . click ( this . Toast . toastCloseButton ) ;
406
412
}
@@ -415,6 +421,9 @@ export class BrowserPage extends InstancePage {
415
421
await t . typeText ( this . keyTTLInput , TTL , { replace : true , paste : true } ) ;
416
422
await t . typeText ( this . hashFieldNameInput , field , { replace : true , paste : true } ) ;
417
423
await t . typeText ( this . hashFieldValueInput , value , { replace : true , paste : true } ) ;
424
+ if ( fieldTtl !== '' ) {
425
+ await t . typeText ( this . hashTtlFieldInput , fieldTtl , { replace : true , paste : true } ) ;
426
+ }
418
427
await t . click ( this . addKeyButton ) ;
419
428
}
420
429
@@ -634,14 +643,18 @@ export class BrowserPage extends InstancePage {
634
643
* Add field to hash key
635
644
* @param keyFieldValue The value of the hash field
636
645
* @param keyValue The hash value
646
+ * @param fieldTtl The hash field ttl value for Redis databases 7.4 and higher
637
647
*/
638
- async addFieldToHash ( keyFieldValue : string , keyValue : string ) : Promise < void > {
648
+ async addFieldToHash ( keyFieldValue : string , keyValue : string , fieldTtl = '' ) : Promise < void > {
639
649
if ( await this . Toast . toastCloseButton . exists ) {
640
650
await t . click ( this . Toast . toastCloseButton ) ;
641
651
}
642
652
await t . click ( this . addKeyValueItemsButton ) ;
643
653
await t . typeText ( this . hashFieldInput , keyFieldValue , { replace : true , paste : true } ) ;
644
654
await t . typeText ( this . hashValueInput , keyValue , { replace : true , paste : true } ) ;
655
+ if ( fieldTtl !== ' ' ) {
656
+ await t . typeText ( this . hashTtlFieldInput , fieldTtl , { replace : true , paste : true } ) ;
657
+ }
645
658
await t . click ( this . saveHashFieldButton ) ;
646
659
}
647
660
@@ -657,6 +670,19 @@ export class BrowserPage extends InstancePage {
657
670
. click ( this . applyButton ) ;
658
671
}
659
672
673
+ /**
674
+ * Edit Hash field ttl value
675
+ * @param fieldName The field name
676
+ * @param fieldTtl The hash field ttl value for Redis databases 7.4 and higher
677
+ */
678
+ async editHashFieldTtlValue ( fieldName : string , fieldTtl : string ) : Promise < void > {
679
+ await t
680
+ . hover ( this . getHashTtlFieldInput ( fieldName ) )
681
+ . click ( this . editHashFieldTtlButton )
682
+ . typeText ( this . inlineItemEditor , fieldTtl , { replace : true , paste : true } )
683
+ . click ( this . applyButton ) ;
684
+ }
685
+
660
686
//Get Hash key value from details
661
687
async getHashKeyValue ( ) : Promise < string > {
662
688
return this . hashFieldValue . textContent ;
0 commit comments