Skip to content

Commit 2371011

Browse files
committed
add waiter for loader on browser page
1 parent 66102ea commit 2371011

File tree

9 files changed

+29
-12
lines changed

9 files changed

+29
-12
lines changed

tests/e2e/helpers/database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export async function acceptLicenseTermsAndAddRECloudDatabase(databaseParameters
194194
while (!(await dbSelector.exists) && Date.now() - startTime < searchTimeout);
195195
await t.expect(myRedisDatabasePage.dbNameList.withExactText(databaseParameters.databaseName ?? '').exists).ok('The database not displayed', { timeout: 5000 });
196196
await myRedisDatabasePage.clickOnDBByName(databaseParameters.databaseName ?? '');
197+
await common.waitForElementNotVisible(browserPage.progressLine);
197198
}
198199

199200
// Accept License terms

tests/e2e/pageObjects/browser-page.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export class BrowserPage {
100100
virtualTableContainer = Selector('[data-testid=virtual-table-container]');
101101
streamEntriesContainer = Selector('[data-testid=stream-entries-container]');
102102
streamMessagesContainer = Selector('[data-testid=stream-messages-container]');
103+
loader = Selector('[data-testid=type-loading]');
103104
//LINKS
104105
internalLinkToWorkbench = Selector('[data-testid=internal-workbench-link]');
105106
userSurveyLink = Selector('[data-testid=user-survey-link]');
@@ -254,6 +255,7 @@ export class BrowserPage {
254255
*/
255256
async commonAddNewKey(keyName: string, TTL?: string): Promise<void> {
256257
await common.waitForElementNotVisible(this.progressLine);
258+
await common.waitForElementNotVisible(this.loader);
257259
await t
258260
.click(this.plusAddKeyButton)
259261
.click(this.addKeyNameInput)
@@ -316,6 +318,7 @@ export class BrowserPage {
316318
*/
317319
async addSetKey(keyName: string, TTL = ' ', members = ' '): Promise<void> {
318320
await common.waitForElementNotVisible(this.progressLine);
321+
await common.waitForElementNotVisible(this.loader);
319322
await t.click(this.plusAddKeyButton);
320323
await t.click(this.keyTypeDropDown);
321324
await t.click(this.setOption);
@@ -336,6 +339,7 @@ export class BrowserPage {
336339
*/
337340
async addZSetKey(keyName: string, scores = ' ', TTL = ' ', members = ' '): Promise<void> {
338341
await common.waitForElementNotVisible(this.progressLine);
342+
await common.waitForElementNotVisible(this.loader);
339343
await t.click(this.plusAddKeyButton);
340344
await t.click(this.keyTypeDropDown);
341345
await t.click(this.zsetOption);
@@ -356,13 +360,14 @@ export class BrowserPage {
356360
*/
357361
async addListKey(keyName: string, TTL = ' ', element = ' '): Promise<void> {
358362
await common.waitForElementNotVisible(this.progressLine);
363+
await common.waitForElementNotVisible(this.loader);
359364
await t.click(this.plusAddKeyButton);
360365
await t.click(this.keyTypeDropDown);
361366
await t.click(this.listOption);
362367
await t.click(this.addKeyNameInput);
363368
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
364369
await t.click(this.keyTTLInput);
365-
await t.typeText(this.keyTTLInput, TTL);
370+
await t.typeText(this.keyTTLInput, TTL, { replace: true, paste: true });
366371
await t.click(this.listKeyElementInput);
367372
await t.typeText(this.listKeyElementInput, element, { replace: true, paste: true });
368373
await t.click(this.addKeyButton);
@@ -377,6 +382,7 @@ export class BrowserPage {
377382
*/
378383
async addHashKey(keyName: string, TTL = ' ', field = ' ', value = ' '): Promise<void> {
379384
await common.waitForElementNotVisible(this.progressLine);
385+
await common.waitForElementNotVisible(this.loader);
380386
await t.click(this.plusAddKeyButton);
381387
await t.click(this.keyTypeDropDown);
382388
await t.click(this.hashOption);
@@ -490,12 +496,21 @@ export class BrowserPage {
490496
}
491497
}
492498

499+
/**
500+
* Get selector by key name
501+
* @param keyName The name of the key
502+
*/
503+
async getKeySelectorByName(keyName: string): Promise<Selector> {
504+
return Selector(`[data-testid="key-${keyName}"]`);
505+
}
506+
493507
/**
494508
* Verifying if the Key is in the List of keys
495509
* @param keyName The name of the key
496510
*/
497511
async isKeyIsDisplayedInTheList(keyName: string): Promise<boolean> {
498512
const keyNameInTheList = Selector(`[data-testid="key-${keyName}"]`);
513+
await common.waitForElementNotVisible(this.loader);
499514
return keyNameInTheList.exists;
500515
}
501516

tests/e2e/pageObjects/cli-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class CliPage {
9191
await t.click(this.cliExpandButton);
9292
//Add keys
9393
const keyValueArray = await common.createArrayWithKeyValueAndDelimiter(amount);
94-
await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { paste: true });
94+
await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true });
9595
await t.pressKey('enter');
9696
await t.click(this.cliCollapseButton);
9797
}
@@ -105,7 +105,7 @@ export class CliPage {
105105
await t.click(this.cliExpandButton);
106106
//Add keys
107107
const keyValueArray = await common.createArrayWithKeyAndDelimiter(amount);
108-
await t.typeText(this.cliCommandInput, `DEL ${keyValueArray.join(' ')}`, { paste: true });
108+
await t.typeText(this.cliCommandInput, `DEL ${keyValueArray.join(' ')}`, { replace: true, paste: true });
109109
await t.pressKey('enter');
110110
await t.click(this.cliCollapseButton);
111111
}

tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ test('Verify that user can delete a Consumer Group', async t => {
172172
for (const id of entryIds) {
173173
const idBefore = await browserPage.streamGroupId.textContent;
174174
await t.click(browserPage.editStreamLastIdButton);
175-
await t.typeText(browserPage.lastIdInput, id, { replace: true });
175+
await t.typeText(browserPage.lastIdInput, id, { replace: true, paste: true });
176176
await t.click(browserPage.saveButton);
177177
await t.expect(browserPage.streamGroupId.textContent).notEql(idBefore, 'The last delivered ID is modified and the table is not reloaded');
178178
}

tests/e2e/tests/critical-path/browser/context.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ test('Verify that user can see saved executed commands in CLI on Browser page wh
8181
// Execute command in CLI and open Settings page
8282
await t.click(cliPage.cliExpandButton);
8383
for(const command of commands) {
84-
await t.typeText(cliPage.cliCommandInput, command);
84+
await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true });
8585
await t.pressKey('enter');
8686
}
8787
await t.click(myRedisDatabasePage.settingsButton);
@@ -118,7 +118,7 @@ test
118118
await t.click(cliPage.cliExpandButton);
119119
// Create new keys
120120
keys = await common.createArrayWithKeyValue(numberOfItems);
121-
await t.typeText(cliPage.cliCommandInput, `MSET ${keys.join(' ')}`, {paste: true});
121+
await t.typeText(cliPage.cliCommandInput, `MSET ${keys.join(' ')}`, { replace: true, paste: true });
122122
await t.pressKey('enter');
123123
await t.click(cliPage.cliCollapseButton);
124124
await t.click(browserPage.refreshKeysButton);

tests/e2e/tests/critical-path/browser/filtering.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ test
4646
// Clear filter
4747
await t.click(browserPage.clearFilterButton);
4848
// Check the filtering starts by press Enter
49-
await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText');
49+
await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText', { replace: true, paste: true });
5050
await t.pressKey('enter');
5151
await t.expect(browserPage.searchAdvices.exists).ok('The filtering is set');
5252
// Check the filtering starts by clicks the control
5353
await common.reloadPage();
54-
await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText');
54+
await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText', { replace: true, paste: true });
5555
await t.click(browserPage.searchButton);
5656
await t.expect(browserPage.searchAdvices.exists).ok('The filtering is set');
5757
});

tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fixture `Memory Efficiency`
3838
test('No reports/keys message and report tooltip', async t => {
3939
const noReportsMessage = 'No Reports foundRun "New Analysis" to generate first report.';
4040
const noKeysMessage = 'No keys to displayUse Workbench Guides and Tutorials to quickly load the data.';
41-
const tooltipText = 'Memory EfficiencyAnalyze up to 10K keys in your Redis database to get an overview of your data and memory efficiency recommendations.';
41+
const tooltipText = 'Analyze up to 10 000 keys per Redis database to get an overview of your data.';
4242

4343
// Verify that user can see the “No reports found” message when report wasn't generated
4444
await t.expect(memoryEfficiencyPage.noReportsText.textContent).eql(noReportsMessage, 'No reports message not displayed or text is invalid');
@@ -52,7 +52,7 @@ test('No reports/keys message and report tooltip', async t => {
5252
await t.click(myRedisDatabasePage.analysisPageButton);
5353
// Verify that user can see a tooltip when hovering over the icon on the right of the “New analysis” button
5454
await t.hover(memoryEfficiencyPage.reportTooltipIcon);
55-
await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Report tooltip is not displayed or text is invalid');
55+
await t.expect(browserPage.tooltip.textContent).contains(tooltipText, 'Report tooltip is not displayed or text is invalid');
5656
});
5757
test
5858
.before(async t => {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ fixture `Different JSON types creation`
2727
});
2828
test('Verify that user can create different types(string, number, null, array, boolean) of JSON', async t => {
2929
for (let i = 0; i < jsonKeys.length; i++) {
30+
const keySelector = await browserPage.getKeySelectorByName(jsonKeys[i][0]);
3031
await browserPage.addJsonKey(jsonKeys[i][0], jsonKeys[i][1]);
3132
await t.hover(browserPage.toastCloseButton);
3233
await t.click(browserPage.toastCloseButton);
3334
await t.click(browserPage.refreshKeysButton);
34-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok(`${jsonKeys[i][0]} key not displayed`);
35+
await t.expect(keySelector.exists).ok(`${jsonKeys[i][0]} key not displayed`);
3536
// Add additional check for array elements
3637
if (jsonKeys[i][0].includes('array')) {
3738
for (const j of JSON.parse(jsonKeys[i][1])) {

tests/e2e/tests/regression/cli/cli-re-cluster.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const verifyCommandsInCli = async(): Promise<void> => {
2727
// Open CLI
2828
await t.click(cliPage.cliExpandButton);
2929
// Add key from CLI
30-
await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`);
30+
await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`, { replace: true, paste: true });
3131
await t.pressKey('enter');
3232
// Check that the key is added
3333
await browserPage.searchByKeyName(keyName);

0 commit comments

Comments
 (0)