From: Nizamudeen A Date: Sun, 16 Jun 2024 11:15:43 +0000 (+0530) Subject: mgr/dashboard: disable telemetry notification in e2e X-Git-Tag: testing/wip-pdonnell-testing-20240622.145006-debug~24^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=795274a26112a2e9b2a99d34a00effb928681056;p=ceph-ci.git mgr/dashboard: disable telemetry notification in e2e After the new UI shell, the telemetry notifications are displayed on the bottom side, which kind of exists on top of some buttons and that causes some cypress failures while clicking Submit button in the form. I am disabling the notification itself in e2e because its not checked in the e2e at all so we can afford to disable it. Incase we decide to add an e2e for the notification, we can just toggle it on later on and we can check it Fixes: https://tracker.ceph.com/issues/66506 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts index 962c135d56f..bd8932509f8 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts @@ -11,7 +11,7 @@ describe('Images page', () => { cy.login(); // Need pool for image testing pools.navigateTo('create'); - pools.create(poolName, 8, 'rbd'); + pools.create(poolName, 8, ['rbd']); pools.existTableCell(poolName); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts index fb7db27122d..73f668a17bc 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts @@ -32,7 +32,7 @@ describe('Mirroring page', () => { cy.ceph2Login(); cy.login(); pools.navigateTo('create'); - pools.create(poolName, 8, 'rbd'); + pools.create(poolName, 8, ['rbd']); pools.navigateTo(); pools.existTableCell(poolName, true); mirroring.navigateTo(); @@ -49,16 +49,17 @@ describe('Mirroring page', () => { // so writing the code to copy the token inside the origin manually // rather than using a function call // @ts-ignore + cy.ceph2Login(); cy.origin(url, { args }, ({ name, bootstrapToken }) => { // Create an rbd pool in the second cluster + cy.visit('#/pool/create').wait(100); // Login to the second cluster // Somehow its not working with the cypress login function - cy.visit('#/pool/create').wait(100); - cy.get('[name=username]').type('admin'); cy.get('#password').type('admin'); cy.get('[type=submit]').click(); + cy.get('input[name=name]').clear().type(name); cy.get(`select[name=poolType]`).select('replicated'); cy.get(`select[name=poolType] option:checked`).contains('replicated'); @@ -93,7 +94,7 @@ describe('Mirroring page', () => { beforeEach(() => { pools.navigateTo('create'); // Need pool for mirroring testing - pools.create(poolName, 8, 'rbd'); + pools.create(poolName, 8, ['rbd']); pools.navigateTo(); pools.existTableCell(poolName, true); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts index 87184a1e241..f4c869c10e3 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts @@ -46,7 +46,7 @@ describe('Logs page', () => { describe('audit logs respond to pool creation and deletion test', () => { it('should create pool and check audit logs reacted', () => { pools.navigateTo('create'); - pools.create(poolname, 8, 'rbd'); + pools.create(poolname, 8, ['rbd']); pools.navigateTo(); pools.existTableCell(poolname, true); logs.checkAuditForPoolFunction(poolname, 'create', hour, minute); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts index 536f5fbadc7..42f9c76d465 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts @@ -28,14 +28,14 @@ describe('Pools page', () => { }); describe('Create, update and destroy', () => { - it('should create a pool with mirroring enabled', () => { + it('should create a pool', () => { pools.existTableCell(poolName, false); pools.navigateTo('create'); - pools.create(poolName, 8, 'rbd'); + pools.create(poolName, 8, ['rbd']); pools.existTableCell(poolName); }); - it('should edit a pools placement group and check if mirroring is enabled', () => { + it('should edit a pools placement group', () => { pools.existTableCell(poolName); pools.edit_pool_pg(poolName, 32); }); @@ -50,4 +50,22 @@ describe('Pools page', () => { pools.delete(poolName); }); }); + + describe('Pool with mirroring', () => { + it('should create a pool with mirroring enabled', () => { + pools.existTableCell(poolName, false); + pools.navigateTo('create'); + pools.create(poolName, 8, ['rbd'], true); + pools.existTableCell(poolName); + }); + + it('should edit a pools placement group with mirroring enabled', () => { + pools.existTableCell(poolName); + pools.edit_pool_pg(poolName, 32, true, true); + }); + + it('should delete the pool', () => { + pools.delete(poolName); + }); + }) }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts index b1c0263dde1..646bf93288b 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts @@ -14,7 +14,7 @@ export class PoolPageHelper extends PageHelper { } @PageHelper.restrictTo(pages.create.url) - create(name: string, placement_groups: number, ...apps: string[]) { + create(name: string, placement_groups: number, apps: string[], mirroring = false) { cy.get('input[name=name]').clear().type(name); this.isPowerOf2(placement_groups); @@ -25,15 +25,19 @@ export class PoolPageHelper extends PageHelper { this.selectOption('pgAutoscaleMode', 'off'); // To show pgNum field cy.get('input[name=pgNum]').clear().type(`${placement_groups}`); this.setApplications(apps); - cy.get('#rbdMirroring').check({ force: true }); + if (mirroring) { + cy.get('#rbdMirroring').check({ force: true }); + } cy.get('cd-submit-button').click(); } - edit_pool_pg(name: string, new_pg: number, wait = true) { + edit_pool_pg(name: string, new_pg: number, wait = true, mirroring=false) { this.isPowerOf2(new_pg); this.navigateEdit(name); - cy.get('#rbdMirroring').should('be.checked'); + if (mirroring) { + cy.get('#rbdMirroring').should('be.checked'); + } cy.get('input[name=pgNum]').clear().type(`${new_pg}`); cy.get('cd-submit-button').click(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.po.ts index b82efd4747f..fc443f28ffd 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.po.ts @@ -10,6 +10,6 @@ export class LanguagePageHelper extends PageHelper { } getAllLanguages() { - return cy.get('cd-language-selector cds-header-menu'); + return cy.get('cd-language-selector cds-header-menu cds-header-item'); } } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts index 18948f0d408..9eb6cbc7cff 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts @@ -9,7 +9,7 @@ describe('Notification page', () => { before(() => { cy.login(); pools.navigateTo('create'); - pools.create(poolName, 8, 'rbd'); + pools.create(poolName, 8, ['rbd']); pools.edit_pool_pg(poolName, 4, false); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts b/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts index 09a2788eb00..f437ebbdc55 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts @@ -27,6 +27,7 @@ const fillAuth = () => { window.localStorage.setItem('user_pwd_expiration_date', auth.pwdExpirationDate); window.localStorage.setItem('user_pwd_update_required', auth.pwdUpdateRequired); window.localStorage.setItem('sso', auth.sso); + window.localStorage.setItem('telemetry_notification_hidden', 'true'); // disable telemetry notification in e2e }; Cypress.Commands.add('login', (username, password) => { @@ -68,6 +69,7 @@ Cypress.Commands.add('ceph2Login', (username, password) => { window.localStorage.setItem('user_pwd_expiration_date', pwdExpirationDate); window.localStorage.setItem('user_pwd_update_required', pwdUpdateRequired); window.localStorage.setItem('sso', sso); + window.localStorage.setItem('telemetry_notification_hidden', 'true'); // disable telemetry notification in e2e } ); });