Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions tests/e2e/pageObjects/components/compatibility-promotion.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class BaseNavigationPanel {
settingsButton = Selector('[data-testid=settings-page-btn]');
helpCenterButton = Selector('[data-testid=help-menu-button]');
githubButton = Selector('[data-testid=github-repo-icon]');
cloudButton = Selector('[data-testid=cloud-db-icon]');

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

Expand Down
16 changes: 5 additions & 11 deletions tests/e2e/pageObjects/my-redis-databases-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { t, Selector } from 'testcafe';
import { DatabaseAPIRequests } from '../helpers/api/api-database';
import { AddRedisDatabase } from './components/myRedisDatabase/add-redis-database';
import { InsightsPanel } from './components/insights-panel';
import { CompatibilityPromotion } from './components/compatibility-promotion';
import { BaseOverviewPage } from './base-overview-page';
import { NavigationPanel } from './components/navigation-panel';
import { NavigationHeader } from './components/navigation/navigation-header';
Expand All @@ -15,7 +14,6 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
NavigationPanel = new NavigationPanel();
AddRedisDatabase = new AddRedisDatabase();
InsightsPanel = new InsightsPanel();
CompatibilityPromotion = new CompatibilityPromotion();
NavigationHeader = new NavigationHeader();
AuthorizationDialog = new AuthorizationDialog();

Expand All @@ -40,19 +38,17 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
sortByDatabaseAlias = Selector('span').withAttribute('title', 'Database Alias');
sortByHostAndPort = Selector('span').withAttribute('title', 'Host:Port');
sortByConnectionType = Selector('span').withAttribute('title', 'Connection Type');
sortByLastConnection = Selector('span').withAttribute('title', 'Last connection');
importDatabasesBtn = Selector('[data-testid=import-from-file-btn]');
submitImportBtn = Selector('[data-testid=submit-btn]');
okDialogBtn = Selector('[data-testid=ok-btn]');
removeImportedFileBtn = Selector('[aria-label="Clear selected files"]');
exportBtn = Selector('[data-testid=export-btn]');
exportSelectedDbsBtn = Selector('[data-testid=export-selected-dbs]');
userProfileBtn = Selector('[data-testid=user-profile-btn]');
addDbFromEmptyListBtn = Selector('[data-testid=empty-rdi-instance-button]');
emptyDbCloudBtn = Selector('[data-testid=empty-database-cloud-button]');
//CHECKBOXES
selectAllCheckbox = Selector('[data-test-subj=checkboxSelectAll]');
exportPasswordsCheckbox = Selector('[data-testid=export-passwords]~div', { timeout: 500 });
starFreeDbCheckbox = Selector('[data-test-subj=checkboxSelectRow-create-free-cloud-db]');
//ICONS
moduleColumn = Selector('[data-test-subj=tableHeaderCell_modules_3]');
moduleSearchIcon = Selector('[data-testid^=RediSearch]');
Expand All @@ -77,11 +73,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
noResultsFoundMessage = Selector('div').withExactText('No results found');
noResultsFoundText = Selector('div').withExactText('No results matched your search. Try reducing the criteria.');
failedImportMessage = Selector('[data-testid=result-failed]');
successImportMessage = Selector('[data-testid=result-success]');
importDialogTitle = Selector('[data-testid=import-file-modal-title]');
importResult = Selector('[data-testid^=table-result-]');
userProfileAccountInfo = Selector('[data-testid^=profile-account-]');
emptyListMessage = Selector('[data-testid=empty-database-instance-list]');
portCloudDb = Selector('[class*=column_host]');
// DIALOG
importDbDialog = Selector('[data-testid=import-file-modal]');
successResultsAccordion = Selector('[data-testid^=success-results-]');
Expand Down Expand Up @@ -136,11 +131,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
async deleteDatabaseByName(dbName: string): Promise<void> {
const dbNames = this.tableRowContent;
const count = await dbNames.count;

for (let i = 0; i < count; i++) {
if ((await dbNames.nth(i).innerText || '').includes(dbName)) {
await t
.click(this.deleteRowButton.nth(i))
.click(this.deleteRowButton.nth(i-1))
.click(this.confirmDeleteButton);
break;
}
Expand Down Expand Up @@ -213,9 +207,9 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
*/
async verifyDatabaseStatusIsVisible(databaseName: string): Promise<void> {
const databaseId = await databaseAPIRequests.getDatabaseIdByName(databaseName);
const databaseEditBtn = Selector(`[data-testid=database-status-new-${databaseId}]`);
const databaseNewPoint = Selector(`[data-testid=database-status-new-${databaseId}]`);

await t.expect(databaseEditBtn.exists).ok(`Database status is not visible for ${databaseName}`);
await t.expect(databaseNewPoint.exists).ok(`Database status is not visible for ${databaseName}`);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { MyRedisDatabasePage } from '../../../../pageObjects';
import { commonUrl } from '../../../../helpers/conf';
import { rte } from '../../../../helpers/constants';
import { DatabaseHelper } from '../../../../helpers/database';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';

const myRedisDatabasePage = new MyRedisDatabasePage();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();

const standalonePorts = [8100, 8101, 8102, 8103, 12000];
const otherPorts = [28100, 8200];
Expand All @@ -18,9 +20,7 @@ fixture `Autodiscovery`
test
.after(async() => {
// Delete all auto-discovered databases
for(let i = 0; i < standalonePorts.length; i++) {
await myRedisDatabasePage.deleteDatabaseByName(`127.0.0.1:${standalonePorts[i]}`);
}
await databaseAPIRequests.deleteAllDatabasesApi();
})('Verify that when users open application for the first time, they can see all auto-discovered Standalone DBs', async t => {
// Check that standalone DBs have been added into the application
const n = await myRedisDatabasePage.dbNameList.count;
Expand All @@ -30,7 +30,7 @@ test
}
// Verify that user can see all the databases automatically discovered with 127.0.0.1 host instead of localhost
for(let i = 0; i < standalonePorts.length; i++) {
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${standalonePorts[i]}`).exists).ok('Standalone DBs');
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${standalonePorts[i]}`).exists).eql(true, `Standalone DBs is not found for ${standalonePorts[i]}`);
}
// Check that Sentinel and OSS cluster have not been added into the application
for(let j = 0; j < otherPorts.length; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,21 @@ test
.before(async() => {
await databaseAPIRequests.deleteAllDatabasesApi();
await databaseHelper.acceptLicenseTerms();
})('Verify that user can see the No databases message on the empty databases list', async t => {
const noDatabasesMessage = 'No databases yet, let\'s add one!';
const externalPageLink = 'https://redis.io/try-free?utm_source=redisinsight&utm_medium=main&utm_campaign=empty_db_list'
})('Verify that create free cloud db is displayed always', async t => {

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

await t.click(myRedisDatabasePage.addDbFromEmptyListBtn);
await t.expect(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn.exists).ok('Add database form not opened');
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
await t.expect(myRedisDatabasePage.dbNameList.exists).notOk('some db is added');
await t.expect(myRedisDatabasePage.tableRowContent.textContent).contains('Free Redis Cloud DB', `create free db row is not displayed`);
await t.expect(myRedisDatabasePage.starFreeDbCheckbox.exists).ok('star checkbox is not displayed next to free db link');
await t.expect(myRedisDatabasePage.portCloudDb.textContent).contains('Set up in a few clicks', `create free db row is not displayed`);

await t.click(myRedisDatabasePage.tableRowContent);
await Common.checkURL(externalPageLinkList);
await goBackHistory();

await t.click(myRedisDatabasePage.emptyDbCloudBtn);
await Common.checkURL(externalPageLink);
await t.click(myRedisDatabasePage.NavigationPanel.cloudButton);
await Common.checkURL(externalPageLinkNavigation);
await goBackHistory();
});
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ test('Verify DB list search', async t => {

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

// Search for DB by name
await t.typeText(myRedisDatabasePage.searchInput, searchedDBName, { replace: true, paste: true });
Expand Down
32 changes: 0 additions & 32 deletions tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,3 @@ test
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Time series data', 'popover is not displayed');
await t.expect(tab.preselectArea.textContent).contains('Time Series', 'the tutorial is incorrect');
});

test
.before(async() => {
await databaseAPIRequests.deleteAllDatabasesApi();
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
})
.after(async() => {
await databaseAPIRequests.deleteAllDatabasesApi();
})('Verify that insights panel can be opened from Overview page', async t => {
const myRedisTutorial = 'How To Query Your Data';

await t.click(browserPage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.CompatibilityPromotion.clickOnLinkByName(Compatibility.SearchAndQuery);
await t.expect(await myRedisDatabasePage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
let tab = await myRedisDatabasePage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
await t.expect(tab.preselectArea.textContent).contains(myRedisTutorial, 'the tutorial is incorrect');
await t.click(tab.nextPageButton);
await tab.runBlockCode('Create the bike shop idx:bicycle');
await t.expect(tab.openDatabasePopover.exists).ok('Open a database popover is not displayed');
await myRedisDatabasePage.NavigationHeader.togglePanel(false);
});
test('Verify that user can open Explore tab into Insights panel by clicking on Explore Redis button', async t => {
await t.click(browserPage.NavigationPanel.myRedisDBButton);
await t.click(myRedisDatabasePage.exploreRedisBtn);
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('Insights panel is not opened');
await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips);
await browserPage.NavigationHeader.togglePanel(false);
await t.click(myRedisDatabasePage.exploreRedisBtn);
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('Insights panel is not opened');
await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tutorials);
});
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ test
.click(myRedisDatabasePage.Toast.toastCloseButton);

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

Expand Down
Loading