From: Nizamudeen A Date: Fri, 31 Oct 2025 15:40:37 +0000 (+0530) Subject: mgr/dashboard: fix cephadm e2e failure X-Git-Tag: testing/wip-pdonnell-testing-20251117.182723-debug~74^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cd6fab28706465bd2b4a8ad25e4c1678214e86b4;p=ceph-ci.git mgr/dashboard: fix cephadm e2e failure - fix add host failure because of cds-tag migration - fix draining issue where start/stop toggle was not working properly - supress an undefined class error in cypress which is raised in different place from table component Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts index 402662c2c46..2591578de2f 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts @@ -95,7 +95,7 @@ export class HostsPageHelper extends PageHelper { this.getTableCell(this.columnIndex.hostname, hostname, true).as('row').click(); cy.get('@row') .parent() - .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) .tag`) + .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) cds-tag span`) .should(($ele) => { const newLabels = $ele.toArray().map((v) => v.innerText); for (const label of labels) { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts index d5ed9c26b11..5286676634e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts @@ -155,6 +155,7 @@ export class ServicesPageHelper extends PageHelper { } cy.get('cd-service-daemon-list').within(() => { + cy.wait(1000); // wait for the status to be updated this.getTableCell(daemonNameIndex, daemon, true) .parent() .find(`[cdstabledata]:nth-child(${statusIndex}) cds-tag`) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/grafana.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/grafana.feature.po.ts index 4f592fb2464..eb057fd34a6 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/grafana.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/grafana.feature.po.ts @@ -26,8 +26,10 @@ When('I view the grafana panel {string}', (panels: string) => { cy.get('.grafana-app') .wait(WAIT_TO_LOAD) .within(() => { - cy.get(`[data-testid="data-testid Panel header ${panel}"]`).click(); - cy.get(`[aria-label="Menu for panel with title ${panel}"]`).click(); + cy.contains('[data-testid="data-testid header-container"] h2', panel) + .closest('[data-testid="data-testid header-container"]') + .click(); + cy.get(`[data-testid="data-testid Panel menu ${panel}"]`).click(); }); cy.get('[data-testid="data-testid Panel menu item View"]').click(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts index 91503335855..b82916fb68a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts @@ -79,7 +79,7 @@ And('I should see row {string} have {string}', (row: string, options: string) => if (options) { cy.get('.cds--search-input').first().clear().type(row); for (const option of options.split(',')) { - cy.contains(`[cdstablerow] [cdstabledata] .tag`, option).should('exist'); + cy.contains(`[cdstablerow] [cdstabledata] cds-tag span`, option).should('exist'); } } }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/grafana/grafana.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/grafana/grafana.feature index fc023712ec2..9bc59f3266e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/grafana/grafana.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/grafana/grafana.feature @@ -37,7 +37,6 @@ Feature: Grafana panels | Total Requests/sec by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 | | GET Latencies by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 | | Bandwidth by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 | - | PUT Latencies by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 | | Average GET/PUT Latencies by RGW Instance | GET, PUT | | Bandwidth Consumed by Type | GETs, PUTs | diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts index 78ef39682ab..1576b2d8eb7 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts @@ -316,7 +316,7 @@ export abstract class PageHelper { .find('[cdstabledata] [data-testid="table-action-btn"]') .click({ force: true }); cy.wait(waitTime); - cy.get(`button.${action}`).click({ force: true }); + cy.get(`button.${action}`).should('not.be.disabled').click({ force: true }); } /** diff --git a/src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts b/src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts index bfcdd775dcc..924fb8f4cfc 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts @@ -8,11 +8,13 @@ afterEach(() => { }); Cypress.on('uncaught:exception', (err: Error) => { - if ( - err.message.includes('ResizeObserver loop limit exceeded') || - err.message.includes('api/prometheus/rules') || - err.message.includes('NG0100: ExpressionChangedAfterItHasBeenCheckedError') - ) { + const ignoredErrors = [ + 'ResizeObserver loop limit exceeded', + 'api/prometheus/rules', + 'NG0100: ExpressionChangedAfterItHasBeenCheckedError', + 'NgClass can only toggle CSS classes' + ]; + if (ignoredErrors.some((error) => err.message.includes(error))) { return false; } return true; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html index e474fb854cd..a48697bf7cc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html @@ -72,7 +72,7 @@ - + {{ row.hostname }}
this.hostDrain(), - disable: (selection: CdTableSelection) => - this.getDisable('drain', selection) || !this.enableDrainBtn, - visible: () => !this.showGeneralActionsOnly && this.enableDrainBtn + visible: () => !this.showGeneralActionsOnly && !this.draining }, { name: this.actionLabels.STOP_DRAIN, permission: 'update', icon: Icons.exit, click: () => this.hostDrain(true), - disable: (selection: CdTableSelection) => - this.getDisable('drain', selection) || this.enableDrainBtn, - visible: () => !this.showGeneralActionsOnly && !this.enableDrainBtn + visible: () => !this.showGeneralActionsOnly && this.draining }, { name: this.actionLabels.REMOVE, @@ -212,9 +211,6 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit visible: () => !this.showGeneralActionsOnly && this.enableMaintenanceBtn } ]; - } - - ngOnInit() { this.columns = [ { name: $localize`Hostname`, @@ -305,15 +301,14 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit updateSelection(selection: CdTableSelection) { this.selection = selection; this.enableMaintenanceBtn = false; - this.enableDrainBtn = false; if (this.selection.hasSelection) { if (this.selection.first().status === 'maintenance') { this.enableMaintenanceBtn = true; } - if (!this.selection.first().labels.includes('_no_schedule')) { - this.enableDrainBtn = true; - } + this.selection.first().labels.includes('_no_schedule') + ? (this.draining = true) + : (this.draining = false); } }