Skip to content

Commit ff90dba

Browse files
committed
return await t.
1 parent e0c0e30 commit ff90dba

File tree

2 files changed

+76
-88
lines changed

2 files changed

+76
-88
lines changed

tests/e2e/pageObjects/browser-page.ts

Lines changed: 75 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,16 @@ export class BrowserPage {
296296
* @param TTL The Time to live value of the key (optional parameter)
297297
*/
298298
async addJsonKey(keyName: string, value: string, TTL?: string): Promise<void> {
299-
await t
300-
.click(this.plusAddKeyButton)
301-
.click(this.keyTypeDropDown)
302-
.click(this.jsonOption)
303-
.click(this.addKeyNameInput);
304-
await t
305-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true })
306-
.click(this.jsonKeyValueInput)
307-
.typeText(this.jsonKeyValueInput, value, { replace: true, paste: true });
299+
await t.click(this.plusAddKeyButton);
300+
await t.click(this.keyTypeDropDown);
301+
await t.click(this.jsonOption);
302+
await t.click(this.addKeyNameInput);
303+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
304+
await t.click(this.jsonKeyValueInput);
305+
await t.typeText(this.jsonKeyValueInput, value, { replace: true, paste: true });
308306
if (TTL !== undefined) {
309-
await t
310-
.click(this.keyTTLInput)
311-
.typeText(this.keyTTLInput, TTL);
307+
await t.click(this.keyTTLInput);
308+
await t.typeText(this.keyTTLInput, TTL);
312309
}
313310
await t.click(this.addKeyButton);
314311
}
@@ -321,16 +318,15 @@ export class BrowserPage {
321318
*/
322319
async addSetKey(keyName: string, TTL = ' ', members = ' '): Promise<void> {
323320
await common.waitForElementNotVisible(this.progressLine);
324-
await t
325-
.click(this.plusAddKeyButton)
326-
.click(this.keyTypeDropDown)
327-
.click(this.setOption)
328-
.click(this.addKeyNameInput)
329-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true })
330-
.click(this.keyTTLInput)
331-
.typeText(this.keyTTLInput, TTL)
332-
.typeText(this.setMemberInput, members, { replace: true, paste: true })
333-
.click(this.addKeyButton);
321+
await t.click(this.plusAddKeyButton);
322+
await t.click(this.keyTypeDropDown);
323+
await t.click(this.setOption);
324+
await t.click(this.addKeyNameInput);
325+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
326+
await t.click(this.keyTTLInput);
327+
await t.typeText(this.keyTTLInput, TTL);
328+
await t.typeText(this.setMemberInput, members, { replace: true, paste: true });
329+
await t.click(this.addKeyButton);
334330
}
335331

336332
/**
@@ -342,17 +338,16 @@ export class BrowserPage {
342338
*/
343339
async addZSetKey(keyName: string, scores = ' ', TTL = ' ', members = ' '): Promise<void> {
344340
await common.waitForElementNotVisible(this.progressLine);
345-
await t
346-
.click(this.plusAddKeyButton)
347-
.click(this.keyTypeDropDown)
348-
.click(this.zsetOption)
349-
.click(this.addKeyNameInput)
350-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true })
351-
.click(this.keyTTLInput)
352-
.typeText(this.keyTTLInput, TTL, { replace: true, paste: true })
353-
.typeText(this.setMemberInput, members, { replace: true, paste: true })
354-
.typeText(this.zsetMemberScoreInput, scores, { replace: true, paste: true })
355-
.click(this.addKeyButton);
341+
await t.click(this.plusAddKeyButton);
342+
await t.click(this.keyTypeDropDown);
343+
await t.click(this.zsetOption);
344+
await t.click(this.addKeyNameInput);
345+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
346+
await t.click(this.keyTTLInput);
347+
await t.typeText(this.keyTTLInput, TTL, { replace: true, paste: true });
348+
await t.typeText(this.setMemberInput, members, { replace: true, paste: true });
349+
await t.typeText(this.zsetMemberScoreInput, scores, { replace: true, paste: true });
350+
await t.click(this.addKeyButton);
356351
}
357352

358353
/**
@@ -363,17 +358,16 @@ export class BrowserPage {
363358
*/
364359
async addListKey(keyName: string, TTL = ' ', element = ' '): Promise<void> {
365360
await common.waitForElementNotVisible(this.progressLine);
366-
await t
367-
.click(this.plusAddKeyButton)
368-
.click(this.keyTypeDropDown)
369-
.click(this.listOption)
370-
.click(this.addKeyNameInput)
371-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true })
372-
.click(this.keyTTLInput)
373-
.typeText(this.keyTTLInput, TTL)
374-
.click(this.listKeyElementInput)
375-
.typeText(this.listKeyElementInput, element, { replace: true, paste: true })
376-
.click(this.addKeyButton);
361+
await t.click(this.plusAddKeyButton);
362+
await t.click(this.keyTypeDropDown);
363+
await t.click(this.listOption);
364+
await t.click(this.addKeyNameInput);
365+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
366+
await t.click(this.keyTTLInput);
367+
await t.typeText(this.keyTTLInput, TTL);
368+
await t.click(this.listKeyElementInput);
369+
await t.typeText(this.listKeyElementInput, element, { replace: true, paste: true });
370+
await t.click(this.addKeyButton);
377371
}
378372

379373
/**
@@ -385,17 +379,16 @@ export class BrowserPage {
385379
*/
386380
async addHashKey(keyName: string, TTL = ' ', field = ' ', value = ' '): Promise<void> {
387381
await common.waitForElementNotVisible(this.progressLine);
388-
await t
389-
.click(this.plusAddKeyButton)
390-
.click(this.keyTypeDropDown)
391-
.click(this.hashOption)
392-
.click(this.addKeyNameInput)
393-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true })
394-
.click(this.keyTTLInput)
395-
.typeText(this.keyTTLInput, TTL, { replace: true, paste: true })
396-
.typeText(this.hashFieldNameInput, field, { replace: true, paste: true })
397-
.typeText(this.hashFieldValueInput, value, { replace: true, paste: true })
398-
.click(this.addKeyButton);
382+
await t.click(this.plusAddKeyButton);
383+
await t.click(this.keyTypeDropDown);
384+
await t.click(this.hashOption);
385+
await t.click(this.addKeyNameInput);
386+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
387+
await t.click(this.keyTTLInput);
388+
await t.typeText(this.keyTTLInput, TTL, { replace: true, paste: true });
389+
await t.typeText(this.hashFieldNameInput, field, { replace: true, paste: true });
390+
await t.typeText(this.hashFieldValueInput, value, { replace: true, paste: true });
391+
await t.click(this.addKeyButton);
399392
}
400393

401394
/**
@@ -409,13 +402,12 @@ export class BrowserPage {
409402
await this.commonAddNewKey(keyName, TTL);
410403
await t.click(this.streamOption);
411404
// Verify that user can see Entity ID filled by * by default on add Stream key form
412-
await t
413-
.expect(this.streamEntryId.withAttribute('value', '*').exists).ok('Preselected Stream Entity ID field not displayed')
414-
.typeText(this.streamField, field, { replace: true, paste: true })
415-
.typeText(this.streamValue, value, { replace: true, paste: true })
416-
.expect(this.addKeyButton.withAttribute('disabled').exists).notOk('Add Key button not clickable')
417-
.click(this.addKeyButton)
418-
.click(this.toastCloseButton);
405+
await t.expect(this.streamEntryId.withAttribute('value', '*').exists).ok('Preselected Stream Entity ID field not displayed');
406+
await t.typeText(this.streamField, field, { replace: true, paste: true });
407+
await t.typeText(this.streamValue, value, { replace: true, paste: true });
408+
await t.expect(this.addKeyButton.withAttribute('disabled').exists).notOk('Add Key button not clickable');
409+
await t.click(this.addKeyButton);
410+
await t.click(this.toastCloseButton);
419411
}
420412

421413
/**
@@ -752,44 +744,41 @@ export class BrowserPage {
752744

753745
//Remove List element from head for Redis databases less then v. 6.2.
754746
async removeListElementFromHeadOld(): Promise<void> {
755-
await t
756-
.click(this.removeElementFromListIconButton)
757-
.expect(this.countInput.withAttribute('disabled').exists).ok('Input field not disabled')
747+
await t.click(this.removeElementFromListIconButton);
748+
await t.expect(this.countInput.withAttribute('disabled').exists).ok('Input field not disabled');
758749
//Select Remove from head selection
759-
.click(this.removeElementFromListSelect)
760-
.click(this.removeFromHeadSelection)
750+
await t.click(this.removeElementFromListSelect);
751+
await t.click(this.removeFromHeadSelection);
761752
//Confirm removing
762-
.click(this.removeElementFromListButton)
763-
.click(this.confirmRemoveListElementButton);
753+
await t.click(this.removeElementFromListButton);
754+
await t.click(this.confirmRemoveListElementButton);
764755
}
765756

766757
/**
767758
* Remove List element from tail
768759
* @param count The count if elements for removing
769760
*/
770761
async removeListElementFromTail(count: string): Promise<void> {
771-
await t
772-
.click(this.removeElementFromListIconButton)
773-
.typeText(this.countInput, count, { replace: true, paste: true })
774-
.click(this.removeElementFromListButton)
775-
.click(this.confirmRemoveListElementButton);
762+
await t.click(this.removeElementFromListIconButton);
763+
await t.typeText(this.countInput, count, { replace: true, paste: true });
764+
await t.click(this.removeElementFromListButton);
765+
await t.click(this.confirmRemoveListElementButton);
776766
}
777767

778768
/**
779769
* Remove List element from head
780770
* @param count The count if elements for removing
781771
*/
782772
async removeListElementFromHead(count: string): Promise<void> {
783-
await t
784-
.click(this.removeElementFromListIconButton)
773+
await t.click(this.removeElementFromListIconButton);
785774
//Enter count of the removing elements
786-
.typeText(this.countInput, count, { replace: true, paste: true })
775+
await t.typeText(this.countInput, count, { replace: true, paste: true });
787776
//Select Remove from head selection
788-
.click(this.removeElementFromListSelect)
789-
.click(this.removeFromHeadSelection)
777+
await t.click(this.removeElementFromListSelect);
778+
await t.click(this.removeFromHeadSelection);
790779
//Confirm removing
791-
.click(this.removeElementFromListButton)
792-
.click(this.confirmRemoveListElementButton);
780+
await t.click(this.removeElementFromListButton);
781+
await t.click(this.confirmRemoveListElementButton);
793782
}
794783

795784
/**
@@ -898,15 +887,14 @@ export class BrowserPage {
898887
*/
899888
async changeDelimiterInTreeView(delimiter: string): Promise<void> {
900889
// Open delimiter popup
901-
await t
902-
.click(this.treeViewDelimiterButton)
890+
await t.click(this.treeViewDelimiterButton);
903891
// Check the previous value
904-
.expect(this.treeViewDelimiterButton.withExactText(':').exists).ok('Default delimiter value not correct')
892+
await t.expect(this.treeViewDelimiterButton.withExactText(':').exists).ok('Default delimiter value not correct');
905893
// Apply new value to the field
906-
.typeText(this.treeViewDelimiterInput, delimiter, { replace: true, paste: true })
894+
await t.typeText(this.treeViewDelimiterInput, delimiter, { replace: true, paste: true });
907895
// Click on save button
908-
.click(this.treeViewDelimiterValueSave)
909-
.expect(this.treeViewDelimiterButton.withExactText(delimiter).exists).ok('Delimiter is not changed');
896+
await t.click(this.treeViewDelimiterValueSave);
897+
await t.expect(this.treeViewDelimiterButton.withExactText(delimiter).exists).ok('Delimiter is not changed');
910898
}
911899

912900
//Delete entry from Stream key

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test('Verify that user can create different types(string, number, null, array, b
3030
await browserPage.addJsonKey(jsonKeys[i][0], jsonKeys[i][1]);
3131
await t.click(browserPage.toastCloseButton);
3232
await t.click(browserPage.refreshKeysButton);
33-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok('New keys are not displayed');
33+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok(`${jsonKeys[i][0]} key not displayed`);
3434
// Add additional check for array elements
3535
if (jsonKeys[i][0].includes('array')) {
3636
for (const j of JSON.parse(jsonKeys[i][1])) {

0 commit comments

Comments
 (0)