Skip to content

Commit ca7c195

Browse files
authored
Merge pull request #2069 from RedisInsight/e2e/bugfix/nightly-e2e-tests-fixes
e2e/bugfix/nightly-tests-fixes
2 parents 8aebade + 2734cdd commit ca7c195

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

tests/e2e/helpers/keys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export async function deleteAllKeysFromDB(host: string, port: string): Promise<v
252252
*/
253253
export async function verifyKeysDisplayedInTheList(keyNames: string[]): Promise<void> {
254254
for (const keyName of keyNames) {
255-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok(`The key ${keyName} not found`);
255+
await t.expect(browserPage.getKeySelectorByName(keyName).exists).ok(`The key ${keyName} not found`);
256256
}
257257
}
258258

tests/e2e/pageObjects/browser-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ export class BrowserPage extends InstancePage {
527527
* Get selector by key name
528528
* @param keyName The name of the key
529529
*/
530-
async getKeySelectorByName(keyName: string): Promise<Selector> {
530+
getKeySelectorByName(keyName: string): Selector {
531531
return Selector(`[data-testid="key-${keyName}"]`);
532532
}
533533

@@ -536,7 +536,7 @@ export class BrowserPage extends InstancePage {
536536
* @param keyName The name of the key
537537
*/
538538
async isKeyIsDisplayedInTheList(keyName: string): Promise<boolean> {
539-
const keyNameInTheList = Selector(`[data-testid="key-${keyName}"]`);
539+
const keyNameInTheList = this.getKeySelectorByName(keyName);
540540
await Common.waitForElementNotVisible(this.loader);
541541
return keyNameInTheList.exists;
542542
}

tests/e2e/pageObjects/components/instance/command-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class CommandHelper {
4747
async checkURLCommand(command: string, url: string): Promise<void> {
4848
await t.click(this.cliHelperOutputTitles.withExactText(command));
4949
await t.click(this.readMoreButton);
50-
await t.expect(Common.getPageUrl()).eql(url, 'The opened page not correct');
50+
await t.expect(await Common.getPageUrl()).eql(url, 'The opened page not correct');
5151
}
5252

5353
/**

tests/e2e/pageObjects/settings-page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class SettingsPage extends BasePage {
9292
* Turn on notifications in Settings
9393
*/
9494
async changeNotificationsSwitcher(toValue: boolean): Promise<void> {
95+
await t.click(this.NavigationPanel.settingsButton);
9596
await t.click(this.accordionAppearance);
9697
if (toValue !== await this.getNotificationsSwitcherValue()) {
9798
await t.click(this.switchNotificationsOption);

tests/e2e/tests/critical-path/browser/search-capabilities.e2e.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,41 +78,41 @@ test
7878
// Verify that user can search by index in Browser view
7979
await browserPage.selectIndexByName(indexName);
8080
await verifyKeysDisplayedInTheList(keyNames);
81-
await t.expect((await browserPage.getKeySelectorByName(keyName)).exists).notOk('Key without index displayed after search');
81+
await t.expect(browserPage.getKeySelectorByName(keyName).exists).notOk('Key without index displayed after search');
8282
// Verify that user can search by index plus key value
8383
await browserPage.searchByKeyName('Hall School');
84-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[0])).ok(`The key ${keyNames[0]} not found`);
85-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[1])).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
84+
await t.expect(browserPage.getKeySelectorByName(keyNames[0]).exists).ok(`The key ${keyNames[0]} not found`);
85+
await t.expect(browserPage.getKeySelectorByName(keyNames[1]).exists).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
8686
// Verify that user can search by index plus multiple key values
8787
await browserPage.searchByKeyName(searchPerValue);
88-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[0])).ok(`The first valid key ${keyNames[0]} not found`);
89-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[2])).ok(`The second valid key ${keyNames[2]} not found`);
90-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[1])).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
88+
await t.expect(browserPage.getKeySelectorByName(keyNames[0]).exists).ok(`The first valid key ${keyNames[0]} not found`);
89+
await t.expect(browserPage.getKeySelectorByName(keyNames[2]).exists).ok(`The second valid key ${keyNames[2]} not found`);
90+
await t.expect(browserPage.getKeySelectorByName(keyNames[1]).exists).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
9191

9292
// Verify that user can use filter history for RediSearch query
9393
await t.click(browserPage.showFilterHistoryBtn);
9494
await t.click(browserPage.filterHistoryOption.withText('Hall School'));
95-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[0])).ok(`The key ${keyNames[0]} not found`);
96-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[1])).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
95+
await t.expect(browserPage.getKeySelectorByName(keyNames[0]).exists).ok(`The key ${keyNames[0]} not found`);
96+
await t.expect(browserPage.getKeySelectorByName(keyNames[1]).exists).notOk(`Invalid key ${keyNames[1]} is displayed after search`);
9797

9898
// Verify that user can clear the search
9999
await t.click(browserPage.clearFilterButton);
100-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyNames[1])).ok(`The key ${keyNames[1]} not found`);
101-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).notOk('Search not cleared');
100+
await t.expect(browserPage.getKeySelectorByName(keyNames[1]).exists).ok(`The key ${keyNames[1]} not found`);
101+
await t.expect(browserPage.getKeySelectorByName(keyName).exists).notOk('Search not cleared');
102102

103103
// Verify that user can search by index in Tree view
104104
await t.click(browserPage.treeViewButton);
105105
// Change delimiter
106106
await browserPage.changeDelimiterInTreeView('-');
107107
await browserPage.selectIndexByName(indexName);
108108
await verifyKeysDisplayedInTheList(keyNames);
109-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).notOk('Key without index displayed after search');
109+
await t.expect(browserPage.getKeySelectorByName(keyName).exists).notOk('Key without index displayed after search');
110110

111111
// Verify that user see the database scanned when he switch to Pattern search mode
112112
await t.click(browserPage.patternModeBtn);
113113
await t.click(browserPage.browserViewButton);
114114
await verifyKeysDisplayedInTheList(keyNames);
115-
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok('Database not scanned after returning to Pattern search mode');
115+
await t.expect(browserPage.getKeySelectorByName(keyName).exists).ok('Database not scanned after returning to Pattern search mode');
116116
});
117117
test
118118
.before(async() => {
@@ -228,7 +228,7 @@ test
228228
await browserPage.selectIndexByName(indexName);
229229
await browserPage.searchByKeyName(searchPerValue);
230230
// Select key
231-
await t.click(await browserPage.getKeySelectorByName(keyName));
231+
await t.click(browserPage.getKeySelectorByName(keyName));
232232

233233
// Verify that Redisearch context (inputs, key selected, scroll, key details) saved after switching between pages
234234
await t

tests/e2e/tests/critical-path/notifications/notification-center.e2e.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ test('Verify that all messages in notification center are sorted by timestamp fr
114114
});
115115
test
116116
.before(async t => {
117+
await acceptLicenseTerms();
117118
await settingsPage.changeNotificationsSwitcher(false);
119+
await deleteAllNotificationsFromDB();
120+
await myRedisDatabasePage.reloadPage();
118121
await t.expect(NotificationPanel.notificationBadge.exists).notOk('No badge');
119122
})('Verify that new popup message is not displayed when notifications are turned off', async t => {
120123
// Verify that user can see notification badge increased when new messages is sent and notifications are turned off

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fixture `Add keys`
3131
});
3232
test('Verify that user can create different types(string, number, null, array, boolean) of JSON', async t => {
3333
for (let i = 0; i < jsonKeys.length; i++) {
34-
const keySelector = await browserPage.getKeySelectorByName(jsonKeys[i][0]);
34+
const keySelector = browserPage.getKeySelectorByName(jsonKeys[i][0]);
3535
await browserPage.addJsonKey(jsonKeys[i][0], jsonKeys[i][1]);
3636
await t.hover(browserPage.Toast.toastCloseButton);
3737
await t.click(browserPage.Toast.toastCloseButton);

0 commit comments

Comments
 (0)