]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: navigation page e2e fix 44824/head
authorNizamudeen A <nia@redhat.com>
Thu, 20 Jan 2022 16:52:50 +0000 (22:22 +0530)
committerErnesto Puerta <epuertat@redhat.com>
Fri, 28 Jan 2022 11:52:03 +0000 (12:52 +0100)
Looks like the newly added relative position for the sidebar is
causing cypress to verify that the sidebar is hidden from the user view.

Fixes: https://tracker.ceph.com/issues/53960
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 6b2be10dbba639cea4d40c39fb63900b7bc0ccd0)

src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.po.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html

index 71bfa4b9f2452627f36885ed9644fd8b2c073e4d..fee2d2db967adcdc2a638fa19a91efc48fcba894 100644 (file)
@@ -10,12 +10,12 @@ describe('Shared pages', () => {
   });
 
   it('should display the vertical menu by default', () => {
-    shared.getVerticalMenu().should('be.visible');
+    shared.getVerticalMenu().should('not.have.class', 'active');
   });
 
   it('should hide the vertical menu', () => {
     shared.getMenuToggler().click();
-    shared.getVerticalMenu().should('not.be.visible');
+    shared.getVerticalMenu().should('have.class', 'active');
   });
 
   it('should navigate to the correct page', () => {
index f81e8aa7be103bb9a958054c06c29577eb7bbfaf..a3673284cdfb3282250f16435fee2424696a099d 100644 (file)
@@ -44,11 +44,11 @@ export class NavigationPageHelper extends PageHelper {
   ];
 
   getVerticalMenu() {
-    return cy.get('ul.cd-navbar-primary');
+    return cy.get('nav[id=sidebar]');
   }
 
   getMenuToggler() {
-    return cy.get('cd-navigation > div.cd-navbar-top button.btn.btn-link');
+    return cy.get('[aria-label="toggle sidebar visibility"]');
   }
 
   checkNavigations(navs: any) {
index 0e2325dd602543a085f3ca30ff41594f5e1e50e3..bdb35a610d973036def487cee01a53bbfc5acf63 100644 (file)
@@ -6,7 +6,8 @@
   <div class="cd-navbar-top">
     <nav class="navbar navbar-expand-md navbar-dark cd-navbar-brand">
       <button class="btn btn-link py-0"
-              (click)="showMenuSidebar = !showMenuSidebar">
+              (click)="showMenuSidebar = !showMenuSidebar"
+              aria-label="toggle sidebar visibility">
         <i class="fa fa-bars fa-2x"
            aria-hidden="true"></i>
       </button>