Skip to content

Commit 022ab95

Browse files
Merge pull request #4070 from RedisInsight/e2e/feature/RI-6265_update-list-of-databases
E2e/feature/ri 6265 update list of databases
2 parents e1ec2b0 + cd8b63c commit 022ab95

File tree

8 files changed

+26
-73
lines changed

8 files changed

+26
-73
lines changed

tests/e2e/pageObjects/components/compatibility-promotion.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/e2e/pageObjects/components/navigation/base-navigation-panel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class BaseNavigationPanel {
1313
settingsButton = Selector('[data-testid=settings-page-btn]');
1414
helpCenterButton = Selector('[data-testid=help-menu-button]');
1515
githubButton = Selector('[data-testid=github-repo-icon]');
16+
cloudButton = Selector('[data-testid=cloud-db-icon]');
1617

1718
buttonsLocator = Selector('[aria-label="Main navigation"] button');
1819

tests/e2e/pageObjects/my-redis-databases-page.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { t, Selector } from 'testcafe';
22
import { DatabaseAPIRequests } from '../helpers/api/api-database';
33
import { AddRedisDatabase } from './components/myRedisDatabase/add-redis-database';
44
import { InsightsPanel } from './components/insights-panel';
5-
import { CompatibilityPromotion } from './components/compatibility-promotion';
65
import { BaseOverviewPage } from './base-overview-page';
76
import { NavigationPanel } from './components/navigation-panel';
87
import { NavigationHeader } from './components/navigation/navigation-header';
@@ -15,7 +14,6 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
1514
NavigationPanel = new NavigationPanel();
1615
AddRedisDatabase = new AddRedisDatabase();
1716
InsightsPanel = new InsightsPanel();
18-
CompatibilityPromotion = new CompatibilityPromotion();
1917
NavigationHeader = new NavigationHeader();
2018
AuthorizationDialog = new AuthorizationDialog();
2119

@@ -40,19 +38,17 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
4038
sortByDatabaseAlias = Selector('span').withAttribute('title', 'Database Alias');
4139
sortByHostAndPort = Selector('span').withAttribute('title', 'Host:Port');
4240
sortByConnectionType = Selector('span').withAttribute('title', 'Connection Type');
43-
sortByLastConnection = Selector('span').withAttribute('title', 'Last connection');
4441
importDatabasesBtn = Selector('[data-testid=import-from-file-btn]');
4542
submitImportBtn = Selector('[data-testid=submit-btn]');
4643
okDialogBtn = Selector('[data-testid=ok-btn]');
4744
removeImportedFileBtn = Selector('[aria-label="Clear selected files"]');
4845
exportBtn = Selector('[data-testid=export-btn]');
4946
exportSelectedDbsBtn = Selector('[data-testid=export-selected-dbs]');
5047
userProfileBtn = Selector('[data-testid=user-profile-btn]');
51-
addDbFromEmptyListBtn = Selector('[data-testid=empty-rdi-instance-button]');
52-
emptyDbCloudBtn = Selector('[data-testid=empty-database-cloud-button]');
5348
//CHECKBOXES
5449
selectAllCheckbox = Selector('[data-test-subj=checkboxSelectAll]');
5550
exportPasswordsCheckbox = Selector('[data-testid=export-passwords]~div', { timeout: 500 });
51+
starFreeDbCheckbox = Selector('[data-test-subj=checkboxSelectRow-create-free-cloud-db]');
5652
//ICONS
5753
moduleColumn = Selector('[data-test-subj=tableHeaderCell_modules_3]');
5854
moduleSearchIcon = Selector('[data-testid^=RediSearch]');
@@ -77,11 +73,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
7773
noResultsFoundMessage = Selector('div').withExactText('No results found');
7874
noResultsFoundText = Selector('div').withExactText('No results matched your search. Try reducing the criteria.');
7975
failedImportMessage = Selector('[data-testid=result-failed]');
80-
successImportMessage = Selector('[data-testid=result-success]');
8176
importDialogTitle = Selector('[data-testid=import-file-modal-title]');
8277
importResult = Selector('[data-testid^=table-result-]');
8378
userProfileAccountInfo = Selector('[data-testid^=profile-account-]');
84-
emptyListMessage = Selector('[data-testid=empty-database-instance-list]');
79+
portCloudDb = Selector('[class*=column_host]');
8580
// DIALOG
8681
importDbDialog = Selector('[data-testid=import-file-modal]');
8782
successResultsAccordion = Selector('[data-testid^=success-results-]');
@@ -136,11 +131,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
136131
async deleteDatabaseByName(dbName: string): Promise<void> {
137132
const dbNames = this.tableRowContent;
138133
const count = await dbNames.count;
139-
140134
for (let i = 0; i < count; i++) {
141135
if ((await dbNames.nth(i).innerText || '').includes(dbName)) {
142136
await t
143-
.click(this.deleteRowButton.nth(i))
137+
.click(this.deleteRowButton.nth(i-1))
144138
.click(this.confirmDeleteButton);
145139
break;
146140
}
@@ -213,9 +207,9 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
213207
*/
214208
async verifyDatabaseStatusIsVisible(databaseName: string): Promise<void> {
215209
const databaseId = await databaseAPIRequests.getDatabaseIdByName(databaseName);
216-
const databaseEditBtn = Selector(`[data-testid=database-status-new-${databaseId}]`);
210+
const databaseNewPoint = Selector(`[data-testid=database-status-new-${databaseId}]`);
217211

218-
await t.expect(databaseEditBtn.exists).ok(`Database status is not visible for ${databaseName}`);
212+
await t.expect(databaseNewPoint.exists).ok(`Database status is not visible for ${databaseName}`);
219213
}
220214

221215
/**

tests/e2e/tests/electron/critical-path/a-first-start-form/autodiscovery.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { MyRedisDatabasePage } from '../../../../pageObjects';
22
import { commonUrl } from '../../../../helpers/conf';
33
import { rte } from '../../../../helpers/constants';
44
import { DatabaseHelper } from '../../../../helpers/database';
5+
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
56

67
const myRedisDatabasePage = new MyRedisDatabasePage();
78
const databaseHelper = new DatabaseHelper();
9+
const databaseAPIRequests = new DatabaseAPIRequests();
810

911
const standalonePorts = [8100, 8101, 8102, 8103, 12000];
1012
const otherPorts = [28100, 8200];
@@ -18,9 +20,7 @@ fixture `Autodiscovery`
1820
test
1921
.after(async() => {
2022
// Delete all auto-discovered databases
21-
for(let i = 0; i < standalonePorts.length; i++) {
22-
await myRedisDatabasePage.deleteDatabaseByName(`127.0.0.1:${standalonePorts[i]}`);
23-
}
23+
await databaseAPIRequests.deleteAllDatabasesApi();
2424
})('Verify that when users open application for the first time, they can see all auto-discovered Standalone DBs', async t => {
2525
// Check that standalone DBs have been added into the application
2626
const n = await myRedisDatabasePage.dbNameList.count;
@@ -30,7 +30,7 @@ test
3030
}
3131
// Verify that user can see all the databases automatically discovered with 127.0.0.1 host instead of localhost
3232
for(let i = 0; i < standalonePorts.length; i++) {
33-
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${standalonePorts[i]}`).exists).ok('Standalone DBs');
33+
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${standalonePorts[i]}`).exists).eql(true, `Standalone DBs is not found for ${standalonePorts[i]}`);
3434
}
3535
// Check that Sentinel and OSS cluster have not been added into the application
3636
for(let j = 0; j < otherPorts.length; j++) {

tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,21 @@ test
187187
.before(async() => {
188188
await databaseAPIRequests.deleteAllDatabasesApi();
189189
await databaseHelper.acceptLicenseTerms();
190-
})('Verify that user can see the No databases message on the empty databases list', async t => {
191-
const noDatabasesMessage = 'No databases yet, let\'s add one!';
192-
const externalPageLink = 'https://redis.io/try-free?utm_source=redisinsight&utm_medium=main&utm_campaign=empty_db_list'
190+
})('Verify that create free cloud db is displayed always', async t => {
193191

194-
await t.expect(myRedisDatabasePage.emptyListMessage.withText(noDatabasesMessage).exists).ok('Empty databases list message not displayed');
192+
const externalPageLinkList = 'https://redis.io/try-free?utm_source=redisinsight&utm_medium=app&utm_campaign=list_of_databases';
193+
const externalPageLinkNavigation = 'https://redis.io/try-free?utm_source=redisinsight&utm_medium=app&utm_campaign=navigation_menu';
195194

196-
await t.click(myRedisDatabasePage.addDbFromEmptyListBtn);
197-
await t.expect(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn.exists).ok('Add database form not opened');
198-
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
195+
await t.expect(myRedisDatabasePage.dbNameList.exists).notOk('some db is added');
196+
await t.expect(myRedisDatabasePage.tableRowContent.textContent).contains('Free Redis Cloud DB', `create free db row is not displayed`);
197+
await t.expect(myRedisDatabasePage.starFreeDbCheckbox.exists).ok('star checkbox is not displayed next to free db link');
198+
await t.expect(myRedisDatabasePage.portCloudDb.textContent).contains('Set up in a few clicks', `create free db row is not displayed`);
199+
200+
await t.click(myRedisDatabasePage.tableRowContent);
201+
await Common.checkURL(externalPageLinkList);
202+
await goBackHistory();
199203

200-
await t.click(myRedisDatabasePage.emptyDbCloudBtn);
201-
await Common.checkURL(externalPageLink);
204+
await t.click(myRedisDatabasePage.NavigationPanel.cloudButton);
205+
await Common.checkURL(externalPageLinkNavigation);
202206
await goBackHistory();
203207
});

tests/e2e/tests/web/regression/database/database-list-search.e2e.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ test('Verify DB list search', async t => {
5555

5656
// Search for DB by Invalid search
5757
await t.typeText(myRedisDatabasePage.searchInput, searchedDBHostInvalid, { replace: true, paste: true });
58-
// Verify that user sees "No results found" message when pattern doesn`t match any database
59-
await t.expect(myRedisDatabasePage.noResultsFoundMessage.exists).ok('"No results found message" not displayed');
60-
await t.expect(myRedisDatabasePage.noResultsFoundText.exists).ok('"No results matched your search" message not displayed');
58+
// Verify that free cloud db is displayed always
59+
await t.expect(myRedisDatabasePage.tableRowContent.textContent).contains('Free Redis Cloud DB', `create free db row is not displayed`);
6160

6261
// Search for DB by name
6362
await t.typeText(myRedisDatabasePage.searchInput, searchedDBName, { replace: true, paste: true });

tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,3 @@ test
5656
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Time series data', 'popover is not displayed');
5757
await t.expect(tab.preselectArea.textContent).contains('Time Series', 'the tutorial is incorrect');
5858
});
59-
60-
test
61-
.before(async() => {
62-
await databaseAPIRequests.deleteAllDatabasesApi();
63-
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
64-
})
65-
.after(async() => {
66-
await databaseAPIRequests.deleteAllDatabasesApi();
67-
})('Verify that insights panel can be opened from Overview page', async t => {
68-
const myRedisTutorial = 'How To Query Your Data';
69-
70-
await t.click(browserPage.NavigationPanel.myRedisDBButton);
71-
await myRedisDatabasePage.CompatibilityPromotion.clickOnLinkByName(Compatibility.SearchAndQuery);
72-
await t.expect(await myRedisDatabasePage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
73-
let tab = await myRedisDatabasePage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
74-
await t.expect(tab.preselectArea.textContent).contains(myRedisTutorial, 'the tutorial is incorrect');
75-
await t.click(tab.nextPageButton);
76-
await tab.runBlockCode('Create the bike shop idx:bicycle');
77-
await t.expect(tab.openDatabasePopover.exists).ok('Open a database popover is not displayed');
78-
await myRedisDatabasePage.NavigationHeader.togglePanel(false);
79-
});
80-
test('Verify that user can open Explore tab into Insights panel by clicking on Explore Redis button', async t => {
81-
await t.click(browserPage.NavigationPanel.myRedisDBButton);
82-
await t.click(myRedisDatabasePage.exploreRedisBtn);
83-
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('Insights panel is not opened');
84-
await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
85-
await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips);
86-
await browserPage.NavigationHeader.togglePanel(false);
87-
await t.click(myRedisDatabasePage.exploreRedisBtn);
88-
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('Insights panel is not opened');
89-
await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
90-
});

tests/e2e/tests/web/smoke/database/add-standalone-db.e2e.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ test
7070
.click(myRedisDatabasePage.Toast.toastCloseButton);
7171

7272
// Verify that user can see an indicator of databases that are added manually and not opened yet
73+
await t.expect(myRedisDatabasePage.starFreeDbCheckbox.exists).ok('free db link is not displayed when db is added')
7374
await myRedisDatabasePage.verifyDatabaseStatusIsVisible(databaseName);
7475
await myRedisDatabasePage.clickOnDBByName(databaseName);
7576

0 commit comments

Comments
 (0)