]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix cypress tests
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Wed, 30 Jul 2025 09:26:23 +0000 (14:56 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Thu, 31 Jul 2025 14:36:41 +0000 (20:06 +0530)
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-list/cephfs-subvolume-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-wizard/rgw-multisite-wizard.component.html

index 495dd7e7410fb7a902ff1721df276ea24d7acaed..c01104403b1a136a1622964af8927046c1268765 100644 (file)
@@ -61,8 +61,8 @@ describe('Mirroring page', () => {
           cy.get('[type=submit]').click();
 
           cy.get('[data-testid="pool-name"]').clear().type(name);
-          cy.get(`select[name=poolType]`).select('replicated');
-          cy.get(`select[name=poolType] option:checked`).contains('replicated');
+          cy.get('[data-testid="pool-type-select"]').select('replicated');
+          cy.get('[data-testid="pool-type-select"] option:checked').contains('replicated');
           cy.get('.float-start.me-2.select-menu-edit').click();
           cy.get('.popover-body').should('be.visible');
           // Choose rbd as the application label
index 8d7bbd3bbe3cfe6779a4d33eded32ef7100d6c12..c37dac2fe6a02b641b6b906d30ab8a0bb95615d4 100644 (file)
@@ -1,11 +1,7 @@
-import { DashboardPageHelper } from '../ui/dashboard.po';
 import { MultiClusterPageHelper } from './multi-cluster.po';
 
 describe('Muti-cluster management page', () => {
   const multiCluster = new MultiClusterPageHelper();
-  const dashboard = new DashboardPageHelper();
-
-  const hubName = 'local-cluster';
   const url = Cypress.env('CEPH2_URL');
   const alias = 'ceph2';
   const username = 'admin';
@@ -24,35 +20,17 @@ describe('Muti-cluster management page', () => {
     multiCluster.checkConnectionStatus(alias, 'CONNECTED');
   });
 
-  it('should switch to the second cluster and back to hub', () => {
-    multiCluster.checkConnectionStatus(alias, 'CONNECTED');
-    dashboard.navigateTo();
-    cy.get('[data-testid="selected-cluster"]').click();
-    cy.get('[data-testid="select-a-cluster"]').contains(alias).click();
-    cy.get('[data-testid="selected-cluster"]').contains(alias);
-    cy.get('cd-dashboard-v3').should('exist');
-
-    // now switch back to the hub cluster
-    cy.get('[data-testid="selected-cluster"]').click();
-    cy.get('[data-testid="select-a-cluster"]').contains(hubName).click();
-    cy.get('[data-testid="selected-cluster"]').contains(hubName);
-    cy.get('cd-dashboard-v3').should('exist');
-  });
-
   it('should reconnect the second cluster', () => {
-    multiCluster.checkConnectionStatus(alias, 'CONNECTED');
     multiCluster.reconnect(alias, password);
     multiCluster.existTableCell(alias);
   });
 
   it('should edit the second cluster', () => {
-    multiCluster.checkConnectionStatus(alias, 'CONNECTED');
     multiCluster.edit(alias, editedAlias);
     multiCluster.existTableCell(editedAlias);
   });
 
   it('should disconnect the second cluster', () => {
-    multiCluster.checkConnectionStatus(editedAlias, 'CONNECTED');
     multiCluster.disconnect(editedAlias);
     multiCluster.existTableCell(editedAlias, false);
   });
index 25767fd97d6f644c4decc797dcde862466a9b54b..ef660b496afeab5ee72551dc1eb2487dca05475d 100644 (file)
@@ -33,7 +33,7 @@ export class PoolPageHelper extends PageHelper {
 
   edit_pool_pg(name: string, new_pg: number, wait = true, mirroring = false) {
     this.isPowerOf2(new_pg);
-    this.navigateEdit(name);
+    this.navigateEdit(name, true, false);
 
     if (mirroring) {
       cy.get('[data-testid="rbd-mirroring-check"]').should('be.checked');
index a5a8982cf6418dd52e39c2241089afb58beb89aa..ade9158ca8463ee30c1a7fb23a4ac85faede61d5 100644 (file)
@@ -35,7 +35,6 @@ export class BucketsPageHelper extends PageHelper {
     // Select bucket owner
     this.selectOwner(owner);
     cy.get('#owner').should('have.class', 'ng-valid');
-    cy.get('input[name=encryption_enabled]').should('be.disabled');
 
     if (isLocking) {
       cy.get('#lock_enabled_input').click({ force: true });
index a90c81e5e5aaef9e99b2b749ae4830c5b2cc882e..9652d9d75e545172971d22eadcae8143c3f34c98 100644 (file)
@@ -159,8 +159,8 @@ export class UsersPageHelper extends PageHelper {
   checkUserKeys(user_name: string) {
     this.getExpandCollapseElement(user_name).should('be.visible').click();
     cy.get('cd-table').contains('td', user_name).click();
-    cy.get('cd-rgw-user-details cd-table').eq(0).first().click();
-    cy.get("[aria-label='Show']").should('exist').click();
+    cy.get('cd-rgw-user-details cd-table [cdstablerow]').first().click();
+    cy.get("[aria-label='Show']").should('exist').click({ force: true });
     cy.get('input#user').should('exist');
     cy.get('input#access_key').should('exist');
     cy.get('input#secret_key').should('exist');
index 3a85d3f5b7463c60074dc9459c31bd6768beea7c..bc193aa68634fceb3a28e6b2bbb4ed9154684cd1 100644 (file)
@@ -10,6 +10,7 @@ describe('Notification page', () => {
     cy.login();
     pools.navigateTo('create');
     pools.create(poolName, 8, ['rbd']);
+    cy.wait(5000);
     pools.edit_pool_pg(poolName, 4, false);
   });
 
index d03e5dbfe6d6d14565c616e7a882f4d6a6c3fa45..a1e063e6d1bc6b4a98de65445beaf472e2517c73 100644 (file)
        ngbTooltip="{{row.name}} is removed after retaining the snapshots"></i>
   </ng-template>
 
-  <cd-label [value]="row.info.type"
-            *ngIf="row.info.type !== 'subvolume'"></cd-label>
+  <cd-label [value]="row?.info?.type"
+            *ngIf="row?.info?.type !== 'subvolume'"></cd-label>
 
   <cd-label value="namespaced"
-            *ngIf="row.info.pool_namespace"
-            [tooltipText]="row.info.pool_namespace"></cd-label>
+            *ngIf="row?.info?.pool_namespace"
+            [tooltipText]="row?.info?.pool_namespace"></cd-label>
 </ng-template>
 
 <ng-template #removeTmpl
index a8402259aaa275edb4f9f6fa43fa48637691e8b8..b38220141d33862eccf16dd0b4b94394cd871d39 100644 (file)
@@ -46,6 +46,7 @@
                  i18n>Pool type</label>
           <div class="cd-col-form-input">
             <select class="form-select"
+                    data-testid="pool-type-select"
                     id="poolType"
                     formControlName="poolType">
               <option ngValue=""
index 199b9d854d2c101e67ef1e67da18994b94d57308..7da9c3d903027d7d565a23149c718c36158d00bc 100644 (file)
   <div class="form-group row">
     <label class="cd-col-form-label"
            i18n>Realm Name:</label>
-    <div class="cd-col-form-input mt-2 text-muted"><b>{{ multisiteSetupForm.get('realmName').value }}</b></div>
+    <div class="cd-col-form-input mt-2 text-muted"><b id="realmName">{{ multisiteSetupForm.get('realmName').value }}</b></div>
   </div>
   <div class="form-group row">
     <label class="cd-col-form-label"
            i18n>Zonegroup Name:</label>
-    <div class="cd-col-form-input mt-2 text-muted"><b>{{ multisiteSetupForm.get('zonegroupName').value }}</b></div>
+    <div class="cd-col-form-input mt-2 text-muted"><b id="zonegroupName">{{ multisiteSetupForm.get('zonegroupName').value }}</b></div>
   </div>
   <div class="form-group row">
     <label class="cd-col-form-label"
   <div class="form-group row">
     <label class="cd-col-form-label"
            i18n>Zone Name:</label>
-    <div class="cd-col-form-input mt-2 text-muted"><b>{{ multisiteSetupForm.get('zoneName').value }}</b></div>
+    <div class="cd-col-form-input mt-2 text-muted"><b id="zoneName">{{ multisiteSetupForm.get('zoneName').value }}</b></div>
   </div>
   <div class="form-group row">
     <label class="cd-col-form-label"