From: Nizamudeen A Date: Thu, 20 Jan 2022 16:52:50 +0000 (+0530) Subject: mgr/dashboard: navigation page e2e fix X-Git-Tag: v17.1.0~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44824%2Fhead;p=ceph.git mgr/dashboard: navigation page e2e fix 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 (cherry picked from commit 6b2be10dbba639cea4d40c39fb63900b7bc0ccd0) --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.e2e-spec.ts index 71bfa4b9f245..fee2d2db967a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.e2e-spec.ts @@ -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', () => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.po.ts index f81e8aa7be10..a3673284cdfb 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/navigation.po.ts @@ -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) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html index 0e2325dd6025..bdb35a610d97 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html @@ -6,7 +6,8 @@