]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: update landing page e2e tests
authorPedro Gonzalez Gomez <pegonzal@redhat.com>
Fri, 31 Mar 2023 17:51:16 +0000 (19:51 +0200)
committerNizamudeen A <nia@redhat.com>
Mon, 29 May 2023 14:02:38 +0000 (19:32 +0530)
ignore the region that can vary on different clusters like charts

fixes: https://tracker.ceph.com/issues/59142
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
(cherry picked from commit 1157e3bff978b19573549c1af1a8fac720b678f6)

src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/dashboard.vrt-spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html

index 6e95c596d0751c29877ec7c3f8e96c8528457078..43def20e1fdc29fd77a9b831333414777213ee63 100644 (file)
@@ -1,5 +1,6 @@
 import { IscsiPageHelper } from '../block/iscsi.po';
 import { HostsPageHelper } from '../cluster/hosts.po';
+import { ManagerModulesPageHelper } from '../cluster/mgr-modules.po';
 import { MonitorsPageHelper } from '../cluster/monitors.po';
 import { OSDsPageHelper } from '../cluster/osds.po';
 import { PageHelper } from '../page-helper.po';
@@ -15,6 +16,15 @@ describe('Dashboard Main Page', () => {
   const pools = new PoolPageHelper();
   const monitors = new MonitorsPageHelper();
   const iscsi = new IscsiPageHelper();
+  const mgrmodules = new ManagerModulesPageHelper();
+
+  before(() => {
+    cy.login();
+    mgrmodules.navigateTo();
+    mgrmodules.navigateEdit('dashboard');
+    cy.get('#FEATURE_TOGGLE_DASHBOARD').uncheck();
+    cy.contains('button', 'Update').click();
+  });
 
   beforeEach(() => {
     cy.login();
@@ -121,4 +131,12 @@ describe('Dashboard Main Page', () => {
       });
     }
   });
+
+  after(() => {
+    cy.login();
+    mgrmodules.navigateTo();
+    mgrmodules.navigateEdit('dashboard');
+    cy.get('#FEATURE_TOGGLE_DASHBOARD').click();
+    cy.contains('button', 'Update').click();
+  });
 });
index b83d16d3d86ce69c04b7b6a3e10c1b4c9e1940ff..9613dbc85802a5c7c213d9397f7b915f3073f973 100644 (file)
@@ -16,7 +16,10 @@ describe('Dashboard Landing Page', () => {
   it('should take screenshot of dashboard landing page', () => {
     login.navigateTo();
     login.doLogin();
-    cy.get('.card-text').should('be.visible');
-    cy.eyesCheckWindow({ tag: 'Dashboard landing page', ignore: { selector: '.card-text' } });
+    cy.get('[aria-label="Details card"]').should('be.visible');
+    cy.get('[aria-label="Status card"]').should('be.visible');
+    cy.get('[aria-label="Inventory card"]').should('be.visible');
+    cy.get('[aria-label="Cluster utilization card"]').should('be.visible');
+    cy.eyesCheckWindow({ tag: 'Dashboard landing page' });
   });
 });
index 88edeb9ee15e44cc58ff037d4a8883c561f98e9c..94c1435557c110f0b8bf449a9382acf24e29bebd 100644 (file)
@@ -4,7 +4,8 @@
     <cd-card cardTitle="Details"
              i18n-title
              class="col-sm-3 px-3"
-             [ngClass]="{'d-flex': flexHeight}">
+             [ngClass]="{'d-flex': flexHeight}"
+             aria-label="Details card">
       <dl class="ms-4 me-4">
         <dt>FSID</dt>
         <dd>{{ detailsCardData.fsid }}</dd>
@@ -17,7 +18,8 @@
 
     <cd-card cardTitle="Status"
              i18n-title
-             class="col-sm-6 px-3 d-flex">
+             class="col-sm-6 px-3 d-flex"
+             aria-label="Status card">
       <div class="d-flex ms-4 me-4 mb-5 center-content">
         <i *ngIf="healthData.health?.status"
            [ngClass]="[healthData.health.status | healthIcon, icons.large2x]"
@@ -78,7 +80,8 @@
     <cd-card cardTitle="Capacity"
              i18n-title
              class="col-sm-3 px-3"
-             [ngClass]="{'d-flex': flexHeight}">
+             [ngClass]="{'d-flex': flexHeight}"
+             aria-label="Capacity card">
       <ng-container class="ms-4 me-4"
                     *ngIf="capacity && osdSettings">
         <cd-dashboard-pie [data]="{max: capacity.total_bytes, current: capacity.total_used_raw_bytes}"
@@ -93,7 +96,8 @@
     <!-- Inventory Card -->
     <cd-card cardTitle="Inventory"
              i18n-title
-             class="col-sm-3 px-3 d-flex">
+             class="col-sm-3 px-3 d-flex"
+             aria-label="Inventory card">
       <hr>
       <!-- Hosts -->
       <li class="list-group-item">
 
     <cd-card cardTitle="Cluster utilization"
              i18n-title
-             class="col-sm-9 px-3 d-flex">
+             class="col-sm-9 px-3 d-flex"
+             aria-label="Cluster utilization card">
       <div class="ms-4 me-4 mt-0">
         <cd-dashboard-time-selector (selectedTime)="getPrometheusData($event)">
         </cd-dashboard-time-selector>