From: Afreen Misbah Date: Fri, 27 Mar 2026 20:36:54 +0000 (+0530) Subject: mgr/dashboard: Fix overview a11y tests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=492d1a023d9b0a6ea6ee5682212561200b1d3197;p=ceph.git mgr/dashboard: Fix overview a11y tests Fixes https://tracker.ceph.com/issues/75696 Signed-off-by: Afreen Misbah --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/dashboard.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/dashboard.e2e-spec.ts deleted file mode 100644 index b6f6ad21cf88..000000000000 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/dashboard.e2e-spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { DashboardV3PageHelper } from '../ui/dashboard-v3.po'; - -describe('Overview Page', { retries: 0 }, () => { - const overview = new DashboardV3PageHelper(); - - beforeEach(() => { - cy.intercept('GET', '**/api/prometheus/data*', { - statusCode: 200, - body: { - status: 'success', - data: { - resultType: 'matrix', - result: [] - } - } - }); - cy.intercept('GET', '**/api/prometheus/prometheus_query_data*', { - statusCode: 200, - body: { - status: 'success', - data: { - resultType: 'vector', - result: [] - } - } - }); - cy.login(); - overview.navigateTo(); - }); - - describe('Dashboard accessibility', () => { - it('should have no accessibility violations', () => { - cy.injectAxe(); - cy.checkAccessibility( - { - exclude: [['.cd-navbar-main']] - }, - { - rules: { - 'page-has-heading-one': { enabled: false } - } - } - ); - }); - }); -}); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/overview.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/overview.e2e-spec.ts new file mode 100644 index 000000000000..720718f0d6c6 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/overview.e2e-spec.ts @@ -0,0 +1,46 @@ +import { OvevriewPagehelper } from '../ui/dashboard-v3.po'; + +describe('Overview Page', { retries: 0 }, () => { + const overview = new OvevriewPagehelper(); + + beforeEach(() => { + cy.intercept('GET', '**/api/prometheus/data*', { + statusCode: 200, + body: { + status: 'success', + data: { + resultType: 'matrix', + result: [] + } + } + }); + cy.intercept('GET', '**/api/prometheus/prometheus_query_data*', { + statusCode: 200, + body: { + status: 'success', + data: { + resultType: 'vector', + result: [] + } + } + }); + cy.login(); + overview.navigateTo(); + }); + + describe('Overview accessibility', () => { + it('should have no accessibility violations', () => { + cy.injectAxe(); + cy.checkAccessibility( + { + exclude: [['.cd-navbar-main']] + }, + { + rules: { + 'page-has-heading-one': { enabled: false } + } + } + ); + }); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts index fc3a3ca6a115..e526fd615743 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts @@ -1,9 +1,9 @@ import { OSDsPageHelper } from '../cluster/osds.po'; -import { DashboardV3PageHelper } from '../ui/dashboard-v3.po'; +import { OvevriewPagehelper } from '../ui/dashboard-v3.po'; describe('OSDs page', () => { const osds = new OSDsPageHelper(); - const overview = new DashboardV3PageHelper(); + const overview = new OvevriewPagehelper(); before(() => { cy.login(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.e2e-spec.ts index 74dc43eb67bc..0a4666d685e1 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.e2e-spec.ts @@ -1,7 +1,7 @@ -import { DashboardV3PageHelper } from './dashboard-v3.po'; +import { OvevriewPagehelper } from './dashboard-v3.po'; describe('Dashboard-v3 Main Page', () => { - const overview = new DashboardV3PageHelper(); + const overview = new OvevriewPagehelper(); before(() => { cy.login(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.po.ts index 75f4c405f7bc..059938b86e9d 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.po.ts @@ -1,6 +1,6 @@ import { PageHelper } from '../page-helper.po'; -export class DashboardV3PageHelper extends PageHelper { +export class OvevriewPagehelper extends PageHelper { pages = { index: { url: '#/overview', id: 'cd-overview' } }; cardTitle(index: number) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.html index 796fbe7baf74..84bfcfc9c908 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.html @@ -8,12 +8,11 @@ @let storageCard = (storageCardVm$ | async); @let health = (healthCardVm$ | async); -
-
+
+
-
+ @if (isHealthPanelOpen && health?.incidents > 0) {