summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/monitors.e2e-spec.ts
blob: a23d071e6d7213f0c9140c84ba7279b70be8b758 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { MonitorsPageHelper } from './monitors.po';

describe('Monitors page', () => {
  const monitors = new MonitorsPageHelper();

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

  describe('breadcrumb test', () => {
    it('should open and show breadcrumb', () => {
      monitors.expectBreadcrumbText('Monitors');
    });
  });

  describe('fields check', () => {
    it('should check status table is present', () => {
      // check for table header 'Status'
      monitors.getLegends().its(0).should('have.text', 'Status');

      // check for fields in table
      monitors
        .getStatusTables()
        .should('contain.text', 'Cluster ID')
        .and('contain.text', 'monmap modified')
        .and('contain.text', 'monmap epoch')
        .and('contain.text', 'quorum con')
        .and('contain.text', 'quorum mon')
        .and('contain.text', 'required con')
        .and('contain.text', 'required mon');
    });

    it('should check In Quorum and Not In Quorum tables are present', () => {
      // check for there to be two tables
      monitors.getDataTables().should('have.length', 2);

      // check for table header 'In Quorum'
      monitors.getLegends().its(1).should('have.text', 'In Quorum');

      // check for table header 'Not In Quorum'
      monitors.getLegends().its(2).should('have.text', 'Not In Quorum');

      // verify correct columns on In Quorum table
      monitors.getDataTableHeaders(0).contains('Name');

      monitors.getDataTableHeaders(0).contains('Rank');

      monitors.getDataTableHeaders(0).contains('Public Address');

      monitors.getDataTableHeaders(0).contains('Open Sessions');

      // verify correct columns on Not In Quorum table
      monitors.getDataTableHeaders(1).contains('Name');

      monitors.getDataTableHeaders(1).contains('Rank');

      monitors.getDataTableHeaders(1).contains('Public Address');
    });
  });
});