--- /dev/null
+import { ManagerModulesPageHelper } from '../cluster/mgr-modules.po';
+import { DashboardV3PageHelper } from './dashboard-v3.po';
+
+describe('Dashboard-v3 Main Page', () => {
+ const dashboard = new DashboardV3PageHelper();
+ const mgrmodules = new ManagerModulesPageHelper();
+
+ before(() => {
+ cy.login();
+ mgrmodules.navigateTo();
+ mgrmodules.navigateEdit('dashboard');
+ cy.get('#FEATURE_TOGGLE_DASHBOARD').check();
+ cy.contains('button', 'Update').click();
+ });
+
+ beforeEach(() => {
+ cy.login();
+ Cypress.Cookies.preserveOnce('token');
+ dashboard.navigateTo();
+ });
+
+ describe('Check that all hyperlinks on inventory card lead to the correct page and fields exist', () => {
+ it('should ensure that all linked pages in the inventory card lead to correct page', () => {
+ const expectationMap = {
+ Host: 'Hosts',
+ Monitor: 'Monitors',
+ OSDs: 'OSDs',
+ Pool: 'Pools',
+ 'Object Gateway': 'Daemons'
+ };
+
+ for (const [linkText, breadcrumbText] of Object.entries(expectationMap)) {
+ cy.location('hash').should('eq', '#/dashboard');
+ dashboard.clickInventoryCardLink(linkText);
+ dashboard.expectBreadcrumbText(breadcrumbText);
+ dashboard.navigateBack();
+ }
+ });
+
+ it('should verify that cards exist on dashboard in proper order', () => {
+ // Ensures that cards are all displayed on the dashboard tab while being in the proper
+ // order, checks for card title and position via indexing into a list of all cards.
+ const order = ['Details', 'Status', 'Capacity', 'Inventory', 'Cluster utilization'];
+
+ for (let i = 0; i < order.length; i++) {
+ dashboard.card(i).should('contain.text', order[i]);
+ }
+ });
+ });
+});
--- /dev/null
+import { PageHelper } from '../page-helper.po';
+
+export class DashboardV3PageHelper extends PageHelper {
+ pages = { index: { url: '#/dashboard', id: 'cd-dashboard-v3' } };
+
+ cardTitle(index: number) {
+ return cy.get('.card-title').its(index).text();
+ }
+
+ clickInventoryCardLink(link: string) {
+ console.log(link);
+ cy.get(`cd-card[title="Inventory"]`).contains('a', link).click();
+ }
+
+ card(indexOrTitle: number) {
+ cy.get('cd-card').as('cards');
+
+ return cy.get('@cards').its(indexOrTitle);
+ }
+}
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';
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();
});
}
});
+
+ after(() => {
+ cy.login();
+ mgrmodules.navigateTo();
+ mgrmodules.navigateEdit('dashboard');
+ cy.get('#FEATURE_TOGGLE_DASHBOARD').click();
+ cy.contains('button', 'Update').click();
+ });
});
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' });
});
});
<cd-card title="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>
<cd-card title="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]"
<cd-card title="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}"
<!-- Inventory Card -->
<cd-card title="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 title="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>