]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/blob
565c5da21e05a0164e07bfe453c8a9dacd5f21de
[ceph-ci.git] /
1 /* tslint:disable*/
2 import { CreateClusterWizardHelper } from '../../cluster/create-cluster.po';
3 import { HostsPageHelper } from '../../cluster/hosts.po';
4 import { ServicesPageHelper } from '../../cluster/services.po';
5 /* tslint:enable*/
6
7 describe('when cluster creation is completed', () => {
8   const createCluster = new CreateClusterWizardHelper();
9   const services = new ServicesPageHelper();
10   const hosts = new HostsPageHelper();
11
12   const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];
13
14   beforeEach(() => {
15     cy.login();
16     Cypress.Cookies.preserveOnce('token');
17   });
18
19   it('should redirect to dashboard landing page after cluster creation', () => {
20     createCluster.navigateTo();
21     createCluster.createCluster();
22
23     cy.get('.nav-link').contains('Review').click();
24     cy.get('button[aria-label="Next"]').click();
25     cy.get('cd-dashboard').should('exist');
26   });
27
28   describe('Hosts page', () => {
29     beforeEach(() => {
30       hosts.navigateTo();
31     });
32
33     it('should add one more host', () => {
34       hosts.navigateTo('add');
35       hosts.add(hostnames[3]);
36       hosts.checkExist(hostnames[3], true);
37     });
38
39     it('should check if monitoring stacks are running on the root host', { retries: 2 }, () => {
40       const monitoringStack = ['alertmanager', 'grafana', 'node-exporter', 'prometheus'];
41       hosts.clickTab('cd-host-details', 'ceph-node-00', 'Daemons');
42       for (const daemon of monitoringStack) {
43         cy.get('cd-host-details').within(() => {
44           services.checkServiceStatus(daemon);
45         });
46       }
47     });
48
49     it('should have removed "_no_schedule" label', () => {
50       for (const hostname of hostnames) {
51         hosts.checkLabelExists(hostname, ['_no_schedule'], false);
52       }
53     });
54
55     it('should display inventory', () => {
56       hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
57       cy.get('cd-host-details').within(() => {
58         hosts.getTableCount('total').should('be.gte', 0);
59       });
60     });
61
62     it('should display daemons', () => {
63       hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
64       cy.get('cd-host-details').within(() => {
65         hosts.getTableCount('total').should('be.gte', 0);
66       });
67     });
68
69     it('should check if mon daemon is running on all hosts', () => {
70       for (const hostname of hostnames) {
71         hosts.clickTab('cd-host-details', hostname, 'Daemons');
72         cy.get('cd-host-details').within(() => {
73           services.checkServiceStatus('mon');
74         });
75       }
76     });
77   });
78 });