]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: disable telemetry notification in e2e
authorNizamudeen A <nia@redhat.com>
Sun, 16 Jun 2024 11:15:43 +0000 (16:45 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 18 Jun 2024 13:40:11 +0000 (19:10 +0530)
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 <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts

index 962c135d56fc06eb1b700d17b5076be6ded920ea..bd8932509f8b9ffac3481bf91e90330693e252f4 100644 (file)
@@ -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);
   });
 
index fb7db27122d4a2ce68b7c7e7379286592586314d..73f668a17bc265866227260cfdb580f5aeff5fd0 100644 (file)
@@ -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);
     });
index 87184a1e2412818fdebcd649ae00716994ac1112..f4c869c10e31d66f3993e889a70c9bab826fa548 100644 (file)
@@ -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);
index 536f5fbadc739da46111c8807da6b61a6daf5cfd..42f9c76d465babd30f28607770413458890e09ef 100644 (file)
@@ -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);
+    });
+  })
 });
index b1c0263dde123ecb6da514bf37052cbe03788364..646bf93288b887a47c6b9805ca9aaf4af97d8412 100644 (file)
@@ -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();
index b82efd4747f5aa51bdfdb30e462c973fc68b638f..fc443f28ffdc9adbb5d645cf3ddde326d87bba5d 100644 (file)
@@ -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');
   }
 }
index 18948f0d4080125668398b2c6aa0ee9be54289fe..9eb6cbc7cffe5cdac8f2e1eacae7190ac2c70591 100644 (file)
@@ -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);
   });
 
index 09a2788eb0042946124b9b59a5cd9ccf0246c56d..f437ebbdc554c1b32e4750127b9541584a49ea35 100644 (file)
@@ -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
         }
       );
     });