]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix cephadm e2e tests
authorAfreen Misbah <afreen@ibm.com>
Fri, 27 Mar 2026 21:58:02 +0000 (03:28 +0530)
committerAfreen Misbah <afreen@ibm.com>
Tue, 12 May 2026 09:09:48 +0000 (14:39 +0530)
- these tests failing due to new onboarding page changes

Fixes https://tracker.ceph.com/issues/75697

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/create-cluster.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/06-cluster-check.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts

index 85a983f945f5e3f1e6b994aeea77840ec7f2a1bb..00bd27633825ade9ffcae9855dd70513767077ed 100644 (file)
@@ -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' }
   };
 
index 0f55fd9a99feff58d55abb51d1767897d4356e56..a380a0e5d977030b05becb7e12b0cd0f86d7c46c 100644 (file)
@@ -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();
index 858126774f8103ff53d13611baf65c74cba2c212..d2c1e5b676965f6f9bb59f1ec9a084b30dd621ed 100644 (file)
@@ -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();
         });
index b0acb6964aa706ba308689c52a1cece9887b09ef..ad9930b01e2724d77ac19564996f4bd1690b4980 100644 (file)
@@ -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', () => {
index e1c66c0f4af3c33d0147f9576e4e4436cc5c0f7c..35905ebd54958e3ba8cd9c1f818a2812140b4b21 100644 (file)
@@ -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', () => {
index c865161a3cf1d43cd66d20ed11fdaaf2c362b795..133c489901fffbfb7a8b34ebb53566903f669902 100644 (file)
@@ -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({