summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/crush-map.e2e-spec.ts
blob: 0a454739fd40632fe48ec02fab8899a02fd31ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { CrushMapPageHelper } from './crush-map.po';

describe('CRUSH map page', () => {
  const crushmap = new CrushMapPageHelper();

  beforeEach(() => {
    cy.login();
    Cypress.Cookies.preserveOnce('token');
    crushmap.navigateTo();
  });

  describe('breadcrumb test', () => {
    it('should open and show breadcrumb', () => {
      crushmap.expectBreadcrumbText('CRUSH map');
    });
  });

  describe('fields check', () => {
    it('should check that title & table appears', () => {
      // Check that title (CRUSH map viewer) appears
      crushmap.getPageTitle().should('equal', 'CRUSH map viewer');

      // Check that title appears once OSD is clicked
      crushmap.getCrushNode(0).click();

      crushmap
        .getLegends()
        .invoke('text')
        .then((legend) => {
          crushmap.getCrushNode(0).should('have.text', legend);
        });

      // Check that table appears once OSD is clicked
      crushmap.getDataTables().should('be.visible');
    });
  });
});