From 38498c66f986f69d44ffcd852503d3ba460a961d Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Tue, 8 Feb 2022 09:32:17 +0100 Subject: [PATCH] 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) --- .../frontend/cypress/integration/ui/navigation.e2e-spec.ts | 4 ++-- .../frontend/cypress/integration/ui/navigation.po.ts | 4 ++-- .../app/core/navigation/navigation/navigation.component.html | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) 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 71bfa4b9f2452..fee2d2db967ad 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 f81e8aa7be103..a3673284cdfb3 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 0e2325dd60254..bdb35a610d973 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 @@