diff --git a/tests/e2e/pageObjects/components/compatibility-promotion.ts b/tests/e2e/pageObjects/components/compatibility-promotion.ts deleted file mode 100644 index 611cf271a6..0000000000 --- a/tests/e2e/pageObjects/components/compatibility-promotion.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Selector, t } from 'testcafe'; -import { Compatibility } from '../../helpers/constants'; - -export class CompatibilityPromotion { - linkMask = '[data-testid="guide-icon-$name"]'; - /** - * Click on link - * @param name Name of the compatibility - */ - async clickOnLinkByName(name: Compatibility): Promise { - const link = Selector(this.linkMask.replace(/\$name/g, name)); - await t.click(link); - } -} diff --git a/tests/e2e/pageObjects/components/navigation/base-navigation-panel.ts b/tests/e2e/pageObjects/components/navigation/base-navigation-panel.ts index 8966685a77..98445dc187 100644 --- a/tests/e2e/pageObjects/components/navigation/base-navigation-panel.ts +++ b/tests/e2e/pageObjects/components/navigation/base-navigation-panel.ts @@ -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'); diff --git a/tests/e2e/pageObjects/my-redis-databases-page.ts b/tests/e2e/pageObjects/my-redis-databases-page.ts index 0696a99fa5..4b29329132 100644 --- a/tests/e2e/pageObjects/my-redis-databases-page.ts +++ b/tests/e2e/pageObjects/my-redis-databases-page.ts @@ -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'; @@ -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(); @@ -40,7 +38,6 @@ 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]'); @@ -48,11 +45,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage { 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]'); @@ -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-]'); @@ -136,11 +131,10 @@ export class MyRedisDatabasePage extends BaseOverviewPage { async deleteDatabaseByName(dbName: string): Promise { 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; } @@ -213,9 +207,9 @@ export class MyRedisDatabasePage extends BaseOverviewPage { */ async verifyDatabaseStatusIsVisible(databaseName: string): Promise { 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}`); } /** diff --git a/tests/e2e/tests/electron/critical-path/a-first-start-form/autodiscovery.e2e.ts b/tests/e2e/tests/electron/critical-path/a-first-start-form/autodiscovery.e2e.ts index 930885fc2c..b2b0a3e749 100644 --- a/tests/e2e/tests/electron/critical-path/a-first-start-form/autodiscovery.e2e.ts +++ b/tests/e2e/tests/electron/critical-path/a-first-start-form/autodiscovery.e2e.ts @@ -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]; @@ -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; @@ -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++) { diff --git a/tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts b/tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts index e725fc8b60..256cb9b2e5 100644 --- a/tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts +++ b/tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts @@ -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(); }); diff --git a/tests/e2e/tests/web/regression/database/database-list-search.e2e.ts b/tests/e2e/tests/web/regression/database/database-list-search.e2e.ts index 8619643428..d69da75340 100644 --- a/tests/e2e/tests/web/regression/database/database-list-search.e2e.ts +++ b/tests/e2e/tests/web/regression/database/database-list-search.e2e.ts @@ -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 }); diff --git a/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts b/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts index d1346c1f85..24eecfd47f 100644 --- a/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts +++ b/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts @@ -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); -}); diff --git a/tests/e2e/tests/web/smoke/database/add-standalone-db.e2e.ts b/tests/e2e/tests/web/smoke/database/add-standalone-db.e2e.ts index 4f98cccda7..8ee97ab8df 100644 --- a/tests/e2e/tests/web/smoke/database/add-standalone-db.e2e.ts +++ b/tests/e2e/tests/web/smoke/database/add-standalone-db.e2e.ts @@ -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);