From: Afreen Misbah Date: Fri, 27 Mar 2026 21:58:02 +0000 (+0530) Subject: mgr/dashboard: Fix cephadm e2e tests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=978b6c20350c374dc5dc33f0fee94408b9098c58;p=ceph.git mgr/dashboard: Fix cephadm e2e tests - these tests failing due to new onboarding page changes Fixes https://tracker.ceph.com/issues/75697 Signed-off-by: Afreen Misbah --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/create-cluster.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/create-cluster.po.ts index 85a983f945f5..00bd27633825 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/create-cluster.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/create-cluster.po.ts @@ -3,23 +3,20 @@ import { NotificationSidebarPageHelper } from '../ui/notification.po'; import { HostsPageHelper } from './hosts.po'; import { ServicesPageHelper } from './services.po'; -const pages = { - index: { url: '#/add-storage?welcome=true', id: 'cd-create-cluster' } -}; -export class CreateClusterWizardHelper extends PageHelper { - pages = pages; - - createCluster() { - cy.get('cd-create-cluster').should('contain.text', 'Please expand your cluster first'); - cy.get('[name=add-storage]').click(); +export class OnboardingHelper extends PageHelper { + pages = { index: { url: '#/add-storage?welcome=true', id: 'cd-create-cluster' } }; + + onboarding() { + cy.get('cd-create-cluster').should('contain.text', 'Welcome to Ceph Dashboard'); + cy.get('[aria-label="Add Storage"]').first().click({ force: true }); cy.get('cd-wizard').should('exist'); } doSkip() { - cy.get('[name=skip-cluster-creation]').click(); + cy.get('[aria-label="View cluster overview"]').first().click({ force: true }); cy.contains('cd-modal button', 'Continue').click(); - cy.get('cd-dashboard').should('exist'); + cy.get('cd-overview').should('exist'); const notification = new NotificationSidebarPageHelper(); notification.open(); notification.getNotifications().should('contain', 'Storage setup skipped by user'); @@ -28,7 +25,7 @@ export class CreateClusterWizardHelper extends PageHelper { export class CreateClusterHostPageHelper extends HostsPageHelper { pages = { - index: { url: '#/add-storage?welcome=true', id: 'cd-wizard' }, + index: { url: '#/add-storage', id: 'cd-create-cluster' }, add: { url: '', id: 'cd-host-form' } }; @@ -42,7 +39,7 @@ export class CreateClusterHostPageHelper extends HostsPageHelper { export class CreateClusterServicePageHelper extends ServicesPageHelper { pages = { - index: { url: '#/add-storage?welcome=true', id: 'cd-wizard' }, + index: { url: '#/add-storage', id: 'cd-create-cluster' }, create: { url: '', id: 'cd-service-form' } }; diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts index 0f55fd9a99fe..a380a0e5d977 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts @@ -1,12 +1,9 @@ /* tslint:disable*/ -import { - CreateClusterServicePageHelper, - CreateClusterWizardHelper -} from '../../cluster/create-cluster.po'; +import { CreateClusterServicePageHelper, OnboardingHelper } from '../../cluster/create-cluster.po'; /* tslint:enable*/ describe('Create cluster create services page', () => { - const createCluster = new CreateClusterWizardHelper(); + const onboardingPage = new OnboardingHelper(); const createClusterServicePage = new CreateClusterServicePageHelper(); const createService = (serviceType: string, serviceName: string, count = 1) => { @@ -17,8 +14,8 @@ describe('Create cluster create services page', () => { beforeEach(() => { cy.login(); - createCluster.navigateTo(); - createCluster.createCluster(); + onboardingPage.navigateTo(); + onboardingPage.onboarding(); cy.get('cd-wizard').within(() => { cy.get('button').contains('Create Services').click(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts index 858126774f81..d2c1e5b67696 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts @@ -1,17 +1,17 @@ /* tslint:disable*/ -import { CreateClusterWizardHelper } from '../../cluster/create-cluster.po'; +import { OnboardingHelper } from '../../cluster/create-cluster.po'; import { OSDsPageHelper } from '../../cluster/osds.po'; /* tslint:enable*/ const osds = new OSDsPageHelper(); -describe('Create cluster create osds page', () => { - const createCluster = new CreateClusterWizardHelper(); +describe('Add storage - create osds page', () => { + const onboarding = new OnboardingHelper(); beforeEach(() => { cy.login(); - createCluster.navigateTo(); - createCluster.createCluster(); + onboarding.navigateTo(); + onboarding.onboarding(); cy.get('cd-wizard').within(() => { cy.get('button').contains('Create OSDs').click(); }); @@ -34,9 +34,9 @@ describe('Create cluster create osds page', () => { cy.get('button').contains('Review').click(); }); cy.get('button[aria-label="Next"]').click(); - cy.get('cd-dashboard').should('exist'); - createCluster.navigateTo(); - createCluster.createCluster(); + cy.get('cd-overview').should('exist'); + onboarding.navigateTo(); + onboarding.onboarding(); cy.get('cd-wizard').within(() => { cy.get('button').contains('Create OSDs').click(); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts index b0acb6964aa7..ad9930b01e27 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts @@ -1,18 +1,15 @@ /* tslint:disable*/ -import { - CreateClusterHostPageHelper, - CreateClusterWizardHelper -} from '../../cluster/create-cluster.po'; +import { CreateClusterHostPageHelper, OnboardingHelper } from '../../cluster/create-cluster.po'; /* tslint:enable*/ describe('Create Cluster Review page', () => { - const createCluster = new CreateClusterWizardHelper(); + const onboarding = new OnboardingHelper(); const createClusterHostPage = new CreateClusterHostPageHelper(); beforeEach(() => { cy.login(); - createCluster.navigateTo(); - createCluster.createCluster(); + onboarding.navigateTo(); + onboarding.onboarding(); cy.get('cd-wizard').within(() => { cy.get('button').contains('Review').click(); @@ -22,37 +19,37 @@ describe('Create Cluster Review page', () => { describe('fields check', () => { it('should check cluster resources table is present', () => { // check for table header 'Cluster Resources' - createCluster.getLegends().its(0).should('have.text', 'Cluster Resources'); + onboarding.getLegends().its(0).should('have.text', 'Cluster Resources'); // check for fields in table - createCluster.getStatusTables().should('contain.text', 'Hosts'); - createCluster.getStatusTables().should('contain.text', 'Storage Capacity'); - createCluster.getStatusTables().should('contain.text', 'CPUs'); - createCluster.getStatusTables().should('contain.text', 'Memory'); + onboarding.getStatusTables().should('contain.text', 'Hosts'); + onboarding.getStatusTables().should('contain.text', 'Storage Capacity'); + onboarding.getStatusTables().should('contain.text', 'CPUs'); + onboarding.getStatusTables().should('contain.text', 'Memory'); }); it('should check Host Details table is present', () => { // check for there to be two tables - createCluster.getDataTables().should('have.length', 1); + onboarding.getDataTables().should('have.length', 1); // verify correct columns on Host Details table - createCluster.getDataTableHeaders().contains('Hostname'); + onboarding.getDataTableHeaders().contains('Hostname'); - createCluster.getDataTableHeaders().contains('Labels'); + onboarding.getDataTableHeaders().contains('Labels'); - createCluster.getDataTableHeaders().contains('CPUs'); + onboarding.getDataTableHeaders().contains('CPUs'); - createCluster.getDataTableHeaders().contains('Cores'); + onboarding.getDataTableHeaders().contains('Cores'); - createCluster.getDataTableHeaders().contains('Total Memory'); + onboarding.getDataTableHeaders().contains('Total Memory'); - createCluster.getDataTableHeaders().contains('Raw Capacity'); + onboarding.getDataTableHeaders().contains('Raw Capacity'); - createCluster.getDataTableHeaders().contains('HDDs'); + onboarding.getDataTableHeaders().contains('HDDs'); - createCluster.getDataTableHeaders().contains('Flash'); + onboarding.getDataTableHeaders().contains('Flash'); - createCluster.getDataTableHeaders().contains('NICs'); + onboarding.getDataTableHeaders().contains('NICs'); }); it('should check default host name is present', () => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/06-cluster-check.e2e-spec.ts index e1c66c0f4af3..35905ebd5495 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/06-cluster-check.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/06-cluster-check.e2e-spec.ts @@ -1,11 +1,11 @@ /* tslint:disable*/ -import { CreateClusterWizardHelper } from '../../cluster/create-cluster.po'; +import { OnboardingHelper } from '../../cluster/create-cluster.po'; import { HostsPageHelper } from '../../cluster/hosts.po'; import { ServicesPageHelper } from '../../cluster/services.po'; /* tslint:enable*/ describe('when cluster creation is completed', () => { - const createCluster = new CreateClusterWizardHelper(); + const onboarding = new OnboardingHelper(); const services = new ServicesPageHelper(); const hosts = new HostsPageHelper(); @@ -15,9 +15,9 @@ describe('when cluster creation is completed', () => { cy.login(); }); - it('should redirect to dashboard landing page after cluster creation', () => { - createCluster.navigateTo(); - createCluster.createCluster(); + it('should redirect to overview landing page after adding storage', () => { + onboarding.navigateTo(); + onboarding.onboarding(); // Explicitly skip OSD Creation Step so that it prevents from // deploying OSDs to the hosts automatically. @@ -30,7 +30,7 @@ describe('when cluster creation is completed', () => { cy.get('button').contains('Review').click(); }); cy.get('button[aria-label="Next"]').click(); - cy.get('cd-dashboard').should('exist'); + cy.get('cd-overview').should('exist'); }); describe('Hosts page', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts index c865161a3cf1..133c489901ff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts @@ -199,7 +199,7 @@ export class CreateClusterComponent implements OnInit, OnDestroy, AfterViewInit } if (this.simpleDeployment) { - const title = this.deploymentOption?.options[this.selectedOption['option']].title; + const title = this.deploymentOption?.options[this.selectedOption['option']]?.title; const trackingId = $localize`${title} deployment`; this.taskWrapper .wrapTaskAroundCall({