]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix dashboard cephadm e2e 70244/head
authorNaman Munet <naman.munet@ibm.com>
Thu, 16 Jul 2026 05:56:25 +0000 (11:26 +0530)
committerNaman Munet <naman.munet@ibm.com>
Tue, 21 Jul 2026 06:32:06 +0000 (12:02 +0530)
fixes: https://tracker.ceph.com/issues/78279

Signed-off-by: Naman Munet <naman.munet@ibm.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/osds.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/create-cluster/create-cluster.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.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/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts

index a9c7c6e9a545c4929b7e91c32984e17717e6b823..8ed64146135d4b684de3461e1f99bd063f15f5b7 100644 (file)
@@ -52,12 +52,14 @@ export class OSDsPageHelper extends PageHelper {
   checkStatus(id: number, status: string[]) {
     this.searchTable(id.toString());
     cy.wait(5 * 1000);
-    cy.get(`[cdstabledata]:nth-child(${this.columnIndex.status}) cds-tag`).should(($ele) => {
-      const allStatus = $ele.toArray().map((v) => v.innerText);
-      for (const s of status) {
-        expect(allStatus).to.include(s);
+    cy.get(`[cdstablerow] [cdstabledata]:nth-child(${this.columnIndex.status}) cds-tag`).should(
+      ($ele) => {
+        const allStatus = $ele.toArray().map((v) => v.innerText);
+        for (const s of status) {
+          expect(allStatus).to.include(s);
+        }
       }
-    });
+    );
   }
 
   @PageHelper.restrictTo(pages.index.url)
index 947b0431f6e7c8e919ffecfed06acee2130ead91..c23399fd6cfdeae6e318a3633243e3ba0e9ca739 100644 (file)
@@ -6,4 +6,5 @@ Given('I am on the {string} section', (page: string) => {
 
 Then('I should see a message {string}', () => {
   cy.get('cd-create-cluster').should('contain.text', 'Welcome to Ceph Dashboard');
+  cy.contains('Welcome to Ceph Dashboard').should('be.visible');
 });
index b82916fb68a9651e31e4c0d187097f0a55ffeecd..18a2f4f2f826b3a82599c38eac92d17c2244e4d2 100644 (file)
@@ -46,12 +46,12 @@ When('I select a row {string} in the expanded row', (row: string) => {
 
 Then('I should see a row with {string}', (row: string) => {
   cy.get('.cds--search-input').first().clear().type(row);
-  cy.contains(`[cdstablerow] [cdstabledata]`, row).should('exist');
+  cy.contains(`[cdstablerow]`, row).should('exist');
 });
 
 Then('I should not see a row with {string}', (row: string) => {
   cy.get('.cds--search-input').first().clear().type(row);
-  cy.contains(`[cdstablerow] [cdstabledata]`, row).should('not.exist');
+  cy.contains(`[cdstablerow]`, row).should('not.exist');
 });
 
 Then('I should see a table in the expanded row', () => {
index 9c96d2a19ed93e1d53862053a2b8d2c444f4dbf5..aca084f4c025e50ae584eb44b3650465ab54dc63 100644 (file)
@@ -21,7 +21,7 @@ describe('Create cluster create services page', () => {
   });
 
   it('should check if title contains Create Services', () => {
-    cy.get('.title').should('contain.text', 'Create Services');
+    cy.get('.tearsheet-body .tearsheet-content h4').should('contain.text', 'Create Services');
   });
 
   describe('when Orchestrator is available', () => {
index 541fff0bcb4eb4cdd128107cdd1d43fb9c2c10ba..d4620e7c2f762e0789bfa402bb7e9f2cd2337a89 100644 (file)
@@ -16,7 +16,7 @@ describe('Add storage - create osds page', () => {
   });
 
   it('should check if title contains Create OSDs', () => {
-    cy.get('.title').should('contain.text', 'Create OSDs');
+    cy.get('.tearsheet-body .tearsheet-content h4').should('contain.text', 'Create OSDs');
   });
 
   describe('when Orchestrator is available', () => {
index b81c388faab6eaff9020eb54462fe3a44e1d1b62..b3da0ffc7a7ec5e1702f460e728cd83097f4ad38 100644 (file)
@@ -17,7 +17,7 @@ describe('Create Cluster Review page', () => {
   describe('fields check', () => {
     it('should check cluster resources table is present', () => {
       // check for table header 'Cluster Resources'
-      onboarding.getLegends().its(0).should('have.text', 'Cluster Resources');
+      onboarding.getLegends().its(0).should('contain.text', 'Cluster Resources');
 
       // check for fields in table
       onboarding.getStatusTables().should('contain.text', 'Hosts');
index 18fe82a0959b341ef8f1486948b8afb868dcb980..f93f7edb74a209e9443098eb61b856ebf9578430 100644 (file)
@@ -841,25 +841,53 @@ x4Ea7kGVgx9kWh5XjWz9wjZvY49UKIT5ppIAWPMbLl3UpfckiuNhTA==
         component.editing = true;
       });
 
-      it('should check whether edit field is correctly loaded', () => {
-        const paginate_obs = new PaginateObservable<any>(of({}));
+      it('should check whether edit field is correctly loaded', (done) => {
+        const mockService = {
+          service_type: 'mds',
+          service_id: 'test',
+          unmanaged: false,
+          placement: {}
+        };
+        const paginate_obs = new PaginateObservable<any>(of([mockService]));
         const cephServiceSpy = spyOn(cephServiceService, 'list').and.returnValue(paginate_obs);
         component.ngOnInit();
         expect(cephServiceSpy).toBeCalledTimes(2);
         expect(component.action).toBe('Edit');
-        const serviceType = fixture.componentInstance.serviceForm.get('service_type');
-        const serviceId = fixture.componentInstance.serviceForm.get('service_id');
-        expect(serviceType.disabled).toBeTruthy();
-        expect(serviceId.disabled).toBeTruthy();
+
+        // Wait for async observable to complete before checking disabled state
+        setTimeout(() => {
+          const serviceType = fixture.componentInstance.serviceForm.get('service_type');
+          const serviceId = fixture.componentInstance.serviceForm.get('service_id');
+          expect(serviceType.disabled).toBeTruthy();
+          expect(serviceId.disabled).toBeTruthy();
+          done();
+        }, 0);
       });
 
-      it('should not edit groups for nvmeof service', () => {
+      it('should not edit groups for nvmeof service', (done) => {
+        const mockService = {
+          service_type: 'nvmeof',
+          service_id: 'default',
+          unmanaged: false,
+          placement: {},
+          spec: {
+            group: 'default'
+          }
+        };
+        const paginate_obs = new PaginateObservable<any>(of([mockService]));
+        spyOn(cephServiceService, 'list').and.returnValue(paginate_obs);
+
         component.serviceType = 'nvmeof';
         formHelper.setValue('service_type', 'nvmeof');
         component.ngOnInit();
-        fixture.detectChanges();
-        const groupId = fixture.debugElement.query(By.css('#group')).nativeElement;
-        expect(groupId.disabled).toBeTruthy();
+
+        // Wait for async observable to complete before checking disabled state
+        setTimeout(() => {
+          fixture.detectChanges();
+          const groupId = fixture.debugElement.query(By.css('#group')).nativeElement;
+          expect(groupId.disabled).toBeTruthy();
+          done();
+        }, 0);
       });
 
       it('should update nvmeof service to disable mTLS', () => {
index 3371cc199e07a013f7acb87ce4550a3c0b1718c6..a695b958a0f28cb97724db94ef80d2533459ab0e 100644 (file)
@@ -735,7 +735,6 @@ export class ServiceFormComponent extends CdForm implements OnInit {
 
     if (this.editing) {
       this.action = this.actionLabels.EDIT;
-      this.disableForEditing(this.serviceType);
       this.cephServiceService
         .list(new HttpParams({ fromObject: { limit: -1, offset: 0 } }), this.serviceName)
         .observable.subscribe((response: CephServiceSpec[]) => {
@@ -743,6 +742,15 @@ export class ServiceFormComponent extends CdForm implements OnInit {
           formKeys.forEach((keys) => {
             this.serviceForm.get(keys).setValue(response[0][keys]);
           });
+          // change is made because on editing mds service, a new service was created with mds.mds.service
+          // For non-prefixed services (mgr, mon, etc.), if service_id is empty,
+          // set it to the full service name
+          if (!response[0]['service_id'] && !this.isPrefixedNamedService) {
+            this.serviceForm.get('service_id').setValue(this.serviceName);
+          }
+
+          // Disable fields AFTER setting values to ensure the view updates properly
+          this.disableForEditing(this.serviceType);
           if (response[0].certificate) {
             this.currentCertificate = response[0].certificate;
           }
@@ -972,7 +980,9 @@ export class ServiceFormComponent extends CdForm implements OnInit {
               }
               break;
             default:
-              this.serviceForm.get('service_id').setValue(this.serviceName);
+              // No special handling needed for other service types (mds, nfs, etc.)
+              // service_id is already correctly set from API response at line 749
+              break;
           }
         });
     }