From d164a6b7e7232d82d154f8cd7edf58d5757b01ee Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Thu, 26 Dec 2024 13:17:32 +0100 Subject: [PATCH 1/6] add refresh overview test --- .../components/bottom-panel/profiler.ts | 27 +++++++++++--- .../pageObjects/components/overview-panel.ts | 22 +++++++++--- .../critical-path/monitor/monitor.e2e.ts | 2 +- .../web/critical-path/monitor/monitor.e2e.ts | 2 +- .../monitor/save-commands.e2e.ts | 6 ++-- .../database-overview.e2e.ts | 35 ++++++++++++++++--- .../web/regression/monitor/monitor.e2e.ts | 4 +-- .../regression/monitor/save-commands.e2e.ts | 4 +-- 8 files changed, 80 insertions(+), 22 deletions(-) diff --git a/tests/e2e/pageObjects/components/bottom-panel/profiler.ts b/tests/e2e/pageObjects/components/bottom-panel/profiler.ts index 58328028a7..373e70deef 100644 --- a/tests/e2e/pageObjects/components/bottom-panel/profiler.ts +++ b/tests/e2e/pageObjects/components/bottom-panel/profiler.ts @@ -29,11 +29,17 @@ export class Profiler { * Check specific command in Monitor * @param command A command which should be displayed in monitor * @param parameters An arguments which should be displayed in monitor + * @param expected specify is the command is present or not */ - async checkCommandInMonitorResults(command: string, parameters?: string[]): Promise { + async checkCommandInMonitorResults(command: string, parameters?: string[], expected: boolean = true): Promise { const commandArray = command.split(' '); for (const value of commandArray) { - await t.expect(this.monitorCommandLinePart.withText(value).exists).ok({ timeout: 6000 }); + if(expected){ + await t.expect(this.monitorCommandLinePart.withText(value).exists).ok({ timeout: 6000 }); + } + else { + await t.expect(this.monitorCommandLinePart.withText(value).exists).notOk({ timeout: 1000 }); + } } if (!!parameters) { for (const argument of parameters) { @@ -42,15 +48,28 @@ export class Profiler { } } /** - * Start monitor function + * Start monitor function and verify info */ - async startMonitor(): Promise { + async startMonitorAndVerifyStart(): Promise { await t .click(this.expandMonitor) .click(this.startMonitorButton); //Check for "info" command that is sent automatically every 5 seconds from BE side await this.checkCommandInMonitorResults('info'); } + + /** + * Start monitor function and verify info + */ + async startMonitor(): Promise { + if (!(await this.startMonitorButton.exists)){ + await t + .click(this.expandMonitor) + } + await t + .click(this.startMonitorButton); + } + /** * Start monitor with Save log function */ diff --git a/tests/e2e/pageObjects/components/overview-panel.ts b/tests/e2e/pageObjects/components/overview-panel.ts index 1d35c11cd2..2a27638f05 100644 --- a/tests/e2e/pageObjects/components/overview-panel.ts +++ b/tests/e2e/pageObjects/components/overview-panel.ts @@ -6,23 +6,22 @@ export class OverviewPanel { // TEXT ELEMENTS overviewTotalKeys = Selector('[data-test-subj=overview-total-keys]'); overviewTotalMemory = Selector('[data-test-subj=overview-total-memory]'); - databaseModules = Selector('[data-testid$=module]'); - overviewTooltipStatTitle = Selector('[data-testid=overview-db-stat-title]'); overviewCpu = Selector('[data-test-subj=overview-cpu]'); overviewConnectedClients = Selector('[data-test-subj=overview-connected-clients]'); overviewCommandsSec = Selector('[data-test-subj=overview-commands-sec]'); overviewSpinner = Selector('[class*=euiLoadingSpinner--medium]'); // BUTTONS myRedisDBLink = Selector('[data-testid=my-redis-db-btn]', { timeout: 1000 }); - overviewRedisStackLogo = Selector('[data-testid=redis-stack-logo]'); - overviewMoreInfo = Selector('[data-testid=overview-more-info-button]'); changeIndexBtn = Selector('[data-testid=change-index-btn]'); databaseInfoIcon = Selector('[data-testid=db-info-icon]'); + autoRefreshArrow = Selector('[data-testid=auto-refresh-overview-auto-refresh-config-btn]'); + autoRefreshCheckbox = Selector('[data-testid=auto-refresh-overview-auto-refresh-switch]'); // PANEL - overviewTooltip = Selector('[data-testid=overview-more-info-tooltip]'); databaseInfoToolTip = Selector('[data-testid=db-info-tooltip]', { timeout: 2000 }); // INPUTS changeIndexInput = Selector('[data-testid=change-index-input]'); + autoRefreshRateInput = Selector('[data-testid=auto-refresh-overview-refresh-rate]'); + inlineItemEditor = Selector('[data-testid=inline-item-editor]'); /** * Change database index @@ -49,4 +48,17 @@ export class OverviewPanel { async waitForCpuIsCalculated(): Promise { await t.expect(this.overviewSpinner.visible).notOk('cpu is not calculated, spinner is still displayed'); } + + /** + * set auto refresh rate + * @param rate rate value + */ + async setAutoRefreshValue(rate: string): Promise { + if(!(await this.autoRefreshRateInput.exists)){ + await t.click(this.autoRefreshArrow) + } + await t.click(this.autoRefreshRateInput); + await t.typeText(this.inlineItemEditor, rate); + await t.click(this.EditorButton.applyBtn); + } } diff --git a/tests/e2e/tests/electron/critical-path/monitor/monitor.e2e.ts b/tests/e2e/tests/electron/critical-path/monitor/monitor.e2e.ts index 2cdf3c82f9..22a31a33e1 100644 --- a/tests/e2e/tests/electron/critical-path/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/electron/critical-path/monitor/monitor.e2e.ts @@ -54,7 +54,7 @@ test('Verify that user can see the list of all commands from all clients ran for const common_command = 'info'; const browser_command = 'hset'; //Start Monitor - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); //Send command in CLI await browserPage.Cli.getSuccessCommandResultFromCli(cli_command); //Check that command from CLI is displayed in monitor diff --git a/tests/e2e/tests/web/critical-path/monitor/monitor.e2e.ts b/tests/e2e/tests/web/critical-path/monitor/monitor.e2e.ts index 766baed5d1..bca4ee0ba2 100644 --- a/tests/e2e/tests/web/critical-path/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/web/critical-path/monitor/monitor.e2e.ts @@ -53,7 +53,7 @@ test('Verify that user can see the list of all commands from all clients ran for const common_command = 'info'; const browser_command = 'hset'; //Start Monitor - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); //Send command in CLI await browserPage.Cli.getSuccessCommandResultFromCli(cli_command); //Check that command from CLI is displayed in monitor diff --git a/tests/e2e/tests/web/critical-path/monitor/save-commands.e2e.ts b/tests/e2e/tests/web/critical-path/monitor/save-commands.e2e.ts index 74debb7d49..7f7ecf1e27 100644 --- a/tests/e2e/tests/web/critical-path/monitor/save-commands.e2e.ts +++ b/tests/e2e/tests/web/critical-path/monitor/save-commands.e2e.ts @@ -48,7 +48,7 @@ test('Verify that user can see a tooltip and toggle that allows to save Profiler }); test('Verify that user can see that toggle is not displayed when Profiler is started', async t => { // Start Monitor without save logs - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Check the toggle await t.expect(browserPage.Profiler.saveLogSwitchButton.exists).notOk('The toggle is displayed when Profiler is started'); // Restart Monitor with Save logs @@ -77,7 +77,7 @@ test('Verify that when user switch toggle to OFF and started the Profiler, tempo const numberOfTempFiles = fs.readdirSync(tempDir).length; // Start Monitor without Save logs - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Verify that temporary Log file is not created await t.expect(numberOfTempFiles).gte(fs.readdirSync(tempDir).length, 'The temporary Log file is created'); }); @@ -96,7 +96,7 @@ test('Verify that when user see the toggle is OFF - Profiler logs are not being const numberOfDownloadFiles = await databasesActions.getFileCount(fileDownloadPath, fileStarts); // Start Monitor without Save logs - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); await t.wait(3000); // Check the download files await t.expect(await databasesActions.getFileCount(fileDownloadPath, fileStarts)).eql(numberOfDownloadFiles, 'The Profiler logs are saved'); diff --git a/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts b/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts index 919691ce06..d9cea76341 100644 --- a/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts +++ b/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts @@ -5,7 +5,7 @@ import { BrowserPage } from '../../../../pageObjects'; import { rte } from '../../../../helpers/constants'; -import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf'; +import { cloudDatabaseConfig, commonUrl, ossStandaloneConfig } from '../../../../helpers/conf'; import { Common } from '../../../../helpers/common'; import { DatabaseAPIRequests } from '../../../../helpers/api/api-database'; @@ -24,11 +24,14 @@ fixture `Database overview` await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig); }) .afterEach(async() => { - // Clear and delete database - await browserPage.Cli.sendCommandInCli(`DEL ${keys.join(' ')}`); await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig); }); -test('Verify that user can connect to DB and see breadcrumbs at the top of the application', async t => { +test.after(async() => { + // Delete database + await browserPage.Cli.sendCommandInCli(`DEL ${keys.join(' ')}`); + await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig); + +})('Verify that user can connect to DB and see breadcrumbs at the top of the application', async t => { // Create new keys keys = await Common.createArrayWithKeyValue(10); await browserPage.Cli.sendCommandInCli(`MSET ${keys.join(' ')}`); @@ -42,3 +45,27 @@ test('Verify that user can connect to DB and see breadcrumbs at the top of the a await t.expect(workbenchPage.OverviewPanel.overviewTotalKeys.exists).ok('User can not see total keys'); await t.expect(workbenchPage.OverviewPanel.overviewTotalMemory.exists).ok('User can not see total memory'); }); +test('Verify that user can set overview refresh', async t => { + const common_command = 'info'; + + await t.click(browserPage.OverviewPanel.autoRefreshArrow); + await t.expect(browserPage.OverviewPanel.autoRefreshRateInput.textContent).eql('5000 s', 'default value is incorrect'); + await t.click(browserPage.OverviewPanel.autoRefreshCheckbox); + //Start Monitor + await browserPage.Profiler.startMonitor(); + //Wait for 6 sec + await t.wait(6000); + await browserPage.Profiler.checkCommandInMonitorResults(common_command, undefined, false); + + await browserPage.Profiler.stopMonitor(); + await browserPage.OverviewPanel.setAutoRefreshValue('10'); + await t.click(browserPage.OverviewPanel.autoRefreshCheckbox); + //Start Monitor + await t.click( browserPage.Profiler.resetProfilerButton); + await browserPage.Profiler.startMonitor(); + // verify that the info is not displayed after default value + await t.wait(5000); + await workbenchPage.Profiler.checkCommandInMonitorResults(common_command, undefined, false); + // verify that the info is displayed after set value + await workbenchPage.Profiler.checkCommandInMonitorResults(common_command); +}); diff --git a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts index 761050361d..ab579b70ba 100644 --- a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts @@ -32,7 +32,7 @@ fixture `Monitor` }); test('Verify Monitor refresh/stop', async t => { // Run monitor - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Close Monitor await t.click(browserPage.Profiler.closeMonitor); // Verify that monitor is not displayed @@ -99,7 +99,7 @@ test await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneBigConfig); })('Verify that user can see monitor results in high DB load', async t => { // Run monitor - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Search by not existed key pattern await browserPage.searchByKeyName(`${chance.string({ length: 10 })}*`); // Check that the last child is updated diff --git a/tests/e2e/tests/web/regression/monitor/save-commands.e2e.ts b/tests/e2e/tests/web/regression/monitor/save-commands.e2e.ts index 04ccc4a0db..d28d57ac44 100644 --- a/tests/e2e/tests/web/regression/monitor/save-commands.e2e.ts +++ b/tests/e2e/tests/web/regression/monitor/save-commands.e2e.ts @@ -24,7 +24,7 @@ fixture `Save commands` }); test('Verify that when clicks on “Reset Profiler” button he brought back to Profiler home screen', async t => { // Start Monitor without Save logs - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Remember the number of files in Temp const numberOfTempFiles = fs.readdirSync(tempDir).length; // Reset profiler @@ -44,7 +44,7 @@ test('Verify that when clicks on “Reset Profiler” button he brought back to }); test('Verify that when user clears the Profiler he doesn\'t brought back to Profiler home screen', async t => { // Start Monitor - await browserPage.Profiler.startMonitor(); + await browserPage.Profiler.startMonitorAndVerifyStart(); // Clear monitor and check the view await t.click(browserPage.Profiler.clearMonitorButton); await t.expect(browserPage.Profiler.monitorNotStartedElement.visible).notOk('Profiler home screen is still opened after Clear'); From 9b2bff35a78d59cce2897d88779811d693fe6c6a Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Mon, 30 Dec 2024 14:57:10 +0100 Subject: [PATCH 2/6] fix for regression tests --- tests/e2e/pageObjects/components/bottom-panel/profiler.ts | 7 ++++--- .../web/critical-path/database/connecting-to-the-db.e2e.ts | 3 ++- .../database-overview/database-tls-certificates.e2e.ts | 6 +++--- tests/e2e/tests/web/regression/monitor/monitor.e2e.ts | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/e2e/pageObjects/components/bottom-panel/profiler.ts b/tests/e2e/pageObjects/components/bottom-panel/profiler.ts index 373e70deef..3fd7893845 100644 --- a/tests/e2e/pageObjects/components/bottom-panel/profiler.ts +++ b/tests/e2e/pageObjects/components/bottom-panel/profiler.ts @@ -30,12 +30,13 @@ export class Profiler { * @param command A command which should be displayed in monitor * @param parameters An arguments which should be displayed in monitor * @param expected specify is the command is present or not + * @param timeout timeout */ - async checkCommandInMonitorResults(command: string, parameters?: string[], expected: boolean = true): Promise { + async checkCommandInMonitorResults(command: string, parameters?: string[], expected: boolean = true, timeout: number = 6000): Promise { const commandArray = command.split(' '); for (const value of commandArray) { if(expected){ - await t.expect(this.monitorCommandLinePart.withText(value).exists).ok({ timeout: 6000 }); + await t.expect(this.monitorCommandLinePart.withText(value).exists).ok({ timeout: timeout }); } else { await t.expect(this.monitorCommandLinePart.withText(value).exists).notOk({ timeout: 1000 }); @@ -43,7 +44,7 @@ export class Profiler { } if (!!parameters) { for (const argument of parameters) { - await t.expect(this.monitorCommandLinePart.withText(argument).exists).ok({ timeout: 6000 }); + await t.expect(this.monitorCommandLinePart.withText(argument).exists).ok({ timeout: timeout }); } } } 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 f26747e2ec..576d411f60 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 @@ -185,13 +185,14 @@ test .after(async() => { // Delete databases await databaseAPIRequests.deleteStandaloneDatabaseApi(sshDbClusterPass); - })('Adding OSS Cluster database with SSH', async() => { + })('Adding OSS Cluster database with SSH', async t => { const sshWithPass = { ...sshParams, sshPassword: 'pass' }; // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); + await t.wait(6000) await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); await Common.checkURLContainsText('browser'); }); diff --git a/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts b/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts index 5065d54366..6b00abe26c 100644 --- a/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts +++ b/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts @@ -13,6 +13,7 @@ fixture `tls certificates` .meta({ type: 'regression', rte: rte.none }) .page(commonUrl) .beforeEach(async() => { + await databaseAPIRequests.deleteAllDatabasesApi(); await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneConfig); await myRedisDatabasePage.reloadPage(); await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneTlsConfig); @@ -20,8 +21,7 @@ fixture `tls certificates` }) .afterEach(async() => { // Delete database - await databaseHelper.deleteDatabase(ossStandaloneTlsConfig.databaseName); - await databaseHelper.deleteDatabase(ossStandaloneConfig.databaseName); + await databaseAPIRequests.deleteAllDatabasesApi(); }); test('Verify that user can remove added certificates', async t => { await t.click(browserPage.NavigationPanel.myRedisDBButton); @@ -52,7 +52,7 @@ test('Verify that user can remove added certificates', async t => { await myRedisDatabasePage.reloadPage(); await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName!); - + await t.click(browserPage.NavigationPanel.myRedisDBButton); await myRedisDatabasePage.clickOnDBByName(ossStandaloneTlsConfig.databaseName); await t.expect(browserPage.Toast.toastError.textContent).contains('CA or Client certificate', 'user can connect to db without certificates'); diff --git a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts index ab579b70ba..3f718ce813 100644 --- a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts @@ -70,7 +70,8 @@ test('Verify Monitor refresh/stop', async t => { // Run monitor await t.click(browserPage.Profiler.startMonitorButton); - await browserPage.Profiler.checkCommandInMonitorResults('info'); + + await browserPage.Profiler.checkCommandInMonitorResults('info', undefined, true, 8000); // Click on refresh keys to get new logs await t.click(browserPage.refreshKeysButton); // Get last timestamp From bec7de2da24828c84b608d4927e741f387724e47 Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Mon, 30 Dec 2024 15:41:16 +0100 Subject: [PATCH 3/6] fix for regression tests#2 --- tests/e2e/pageObjects/dialogs/add-redis-database-dialog.ts | 4 +++- .../web/critical-path/database/connecting-to-the-db.e2e.ts | 1 + .../web/regression/database-overview/database-overview.e2e.ts | 2 +- .../database-overview/database-tls-certificates.e2e.ts | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/e2e/pageObjects/dialogs/add-redis-database-dialog.ts b/tests/e2e/pageObjects/dialogs/add-redis-database-dialog.ts index 5bc1be5c2c..e26cbc3ea3 100644 --- a/tests/e2e/pageObjects/dialogs/add-redis-database-dialog.ts +++ b/tests/e2e/pageObjects/dialogs/add-redis-database-dialog.ts @@ -72,6 +72,8 @@ export class AddRedisDatabaseDialog { aiChatMessage = Selector('[data-testid=ai-chat-message-btn]'); aiCloseMessage = Selector('[aria-label="Closes this modal window"]'); + getDeleteCertificate = (certificate: TlsCertificates) => Selector(`[data-testid^=delete-${certificate}-cert]`); + /** * Adding a new redis database * @param parameters the parameters of the database @@ -266,7 +268,7 @@ export class AddRedisDatabaseDialog { const row = Selector('button') .find('div') .withText(name); - const removeButton = `[data-testid^=delete-${certificate}-cert]`; + const removeButton = String(this.getDeleteCertificate(certificate)); const removeButtonFooter = Selector('[class^=_popoverFooter]'); if(certificate === TlsCertificates.CA){ 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 576d411f60..85f00497ac 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 @@ -192,6 +192,7 @@ test }; // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); + // should be deleted after https://redislabs.atlassian.net/browse/RI-5995 await t.wait(6000) await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); await Common.checkURLContainsText('browser'); diff --git a/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts b/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts index d9cea76341..876f4a9600 100644 --- a/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts +++ b/tests/e2e/tests/web/regression/database-overview/database-overview.e2e.ts @@ -49,7 +49,7 @@ test('Verify that user can set overview refresh', async t => { const common_command = 'info'; await t.click(browserPage.OverviewPanel.autoRefreshArrow); - await t.expect(browserPage.OverviewPanel.autoRefreshRateInput.textContent).eql('5000 s', 'default value is incorrect'); + await t.expect(browserPage.OverviewPanel.autoRefreshRateInput.textContent).eql('5 s', 'default value is incorrect'); await t.click(browserPage.OverviewPanel.autoRefreshCheckbox); //Start Monitor await browserPage.Profiler.startMonitor(); diff --git a/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts b/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts index 6b00abe26c..df069916ac 100644 --- a/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts +++ b/tests/e2e/tests/web/regression/database-overview/database-tls-certificates.e2e.ts @@ -27,6 +27,10 @@ test('Verify that user can remove added certificates', async t => { await t.click(browserPage.NavigationPanel.myRedisDBButton); await myRedisDatabasePage.clickOnEditDBByName(ossStandaloneTlsConfig.databaseName); await myRedisDatabasePage.AddRedisDatabaseDialog.removeCertificateButton(TlsCertificates.CA, 'ca'); + // remove if other Certificates were added + if( await myRedisDatabasePage.AddRedisDatabaseDialog.getDeleteCertificate(TlsCertificates.CA).exists){ + await myRedisDatabasePage.AddRedisDatabaseDialog.removeCertificateButton(TlsCertificates.CA, 'ca'); + } await myRedisDatabasePage.reloadPage(); // wait for dbs are displayed await t.expect(myRedisDatabasePage.dbNameList.count).gt(0); From 6ccdcd30c0e7052c1cc8ebcb962550a4a0965404 Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Mon, 30 Dec 2024 16:37:16 +0100 Subject: [PATCH 4/6] fix for regression tests#3 --- .../e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts | 2 ++ tests/e2e/tests/web/regression/monitor/monitor.e2e.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts index 2f5d35f4e6..29d27c2f3c 100644 --- a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts +++ b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts @@ -131,6 +131,8 @@ test }; // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); + // should be deleted after https://redislabs.atlassian.net/browse/RI-5995 + await t.expect(6000); await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); //verify that db is added and profiler works diff --git a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts index 3f718ce813..fe17eb0abf 100644 --- a/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/web/regression/monitor/monitor.e2e.ts @@ -71,7 +71,7 @@ test('Verify Monitor refresh/stop', async t => { // Run monitor await t.click(browserPage.Profiler.startMonitorButton); - await browserPage.Profiler.checkCommandInMonitorResults('info', undefined, true, 8000); + await browserPage.Profiler.checkCommandInMonitorResults('info', undefined, true, 10000); // Click on refresh keys to get new logs await t.click(browserPage.refreshKeysButton); // Get last timestamp From 0b08879a30fa922c9b29293bb41986d6a0318622 Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Tue, 31 Dec 2024 17:02:38 +0100 Subject: [PATCH 5/6] unskip test --- .../electron/critical-path/database/add-ssh-db.e2e.ts | 2 +- .../database/connecting-to-the-db.e2e.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts index 29d27c2f3c..029096047a 100644 --- a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts +++ b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts @@ -132,7 +132,7 @@ test // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); // should be deleted after https://redislabs.atlassian.net/browse/RI-5995 - await t.expect(6000); + await t.wait(6000); await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); //verify that db is added and profiler works 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 85f00497ac..df7b581fdf 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 @@ -197,8 +197,8 @@ test await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); await Common.checkURLContainsText('browser'); }); -// Unskip in RI-6478 -test.skip + +test .meta({ rte: rte.none }) .before(async() => { await databaseAPIRequests.deleteAllDatabasesApi(); @@ -212,9 +212,10 @@ test.skip 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(); + // skipped until https://redislabs.atlassian.net/browse/RI-6556 + // await t.click(myRedisDatabasePage.tableRowContent); + // await Common.checkURL(externalPageLinkList); + // await goBackHistory(); await t.click(myRedisDatabasePage.NavigationPanel.cloudButton); await Common.checkURL(externalPageLinkNavigation); From 82fabd46ee9a0c23b9c93c33a8ebfc1a9c577fe6 Mon Sep 17 00:00:00 2001 From: mariasergeenko Date: Mon, 6 Jan 2025 15:47:07 +0100 Subject: [PATCH 6/6] fix per comments --- .../tests/electron/critical-path/database/add-ssh-db.e2e.ts | 6 ++++-- .../web/critical-path/database/connecting-to-the-db.e2e.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts index 029096047a..fe390ac1dc 100644 --- a/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts +++ b/tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts @@ -131,10 +131,12 @@ test }; // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); - // should be deleted after https://redislabs.atlassian.net/browse/RI-5995 + //TODO should be deleted after https://redislabs.atlassian.net/browse/RI-5995 await t.wait(6000); await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); - + if(! await browserPage.plusAddKeyButton.exists){ + await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); + } //verify that db is added and profiler works await t.click(browserPage.Profiler.expandMonitor); await t.click(browserPage.Profiler.startMonitorButton); 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 df7b581fdf..2277dfd312 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 @@ -192,9 +192,12 @@ test }; // Verify that user can add SSH tunnel with Password for OSS Cluster database await myRedisDatabasePage.AddRedisDatabaseDialog.addStandaloneSSHDatabase(sshDbClusterPass, sshWithPass); - // should be deleted after https://redislabs.atlassian.net/browse/RI-5995 + // TODO should be deleted after https://redislabs.atlassian.net/browse/RI-5995 await t.wait(6000) await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); + if(! await browserPage.plusAddKeyButton.exists){ + await myRedisDatabasePage.clickOnDBByName(sshDbClusterPass.databaseName); + } await Common.checkURLContainsText('browser'); });