]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
be09371013cb358610d2d1075aa11d00f0e0edd7
[ceph.git] /
1 import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
2 import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
3 import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
4 import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
5
6 describe('when cluster creation is completed', () => {
7   const createCluster = new CreateClusterWizardHelper();
8   const services = new ServicesPageHelper();
9   const serviceName = 'rgw.foo';
10
11   beforeEach(() => {
12     cy.login();
13     Cypress.Cookies.preserveOnce('token');
14   });
15
16   it('should redirect to dashboard landing page after cluster creation', () => {
17     createCluster.navigateTo();
18     createCluster.createCluster();
19
20     cy.get('.nav-link').contains('Review').click();
21     cy.get('button[aria-label="Next"]').click();
22     cy.get('cd-dashboard').should('exist');
23   });
24
25   describe('Hosts page', () => {
26     const hosts = new HostsPageHelper();
27     const hostnames = [
28       'ceph-node-00.cephlab.com',
29       'ceph-node-01.cephlab.com',
30       'ceph-node-02.cephlab.com',
31       'ceph-node-03.cephlab.com'
32     ];
33
34     beforeEach(() => {
35       hosts.navigateTo();
36     });
37
38     it('should have removed "_no_schedule" label', () => {
39       for (const hostname of hostnames) {
40         hosts.checkLabelExists(hostname, ['_no_schedule'], false);
41       }
42     });
43
44     it('should display inventory', () => {
45       hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
46       cy.get('cd-host-details').within(() => {
47         hosts.getTableCount('total').should('be.gte', 0);
48       });
49     });
50
51     it('should display daemons', () => {
52       hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
53       cy.get('cd-host-details').within(() => {
54         hosts.getTableCount('total').should('be.gte', 0);
55       });
56     });
57
58     it('should check if rgw service is running', () => {
59       hosts.clickTab('cd-host-details', hostnames[3], 'Daemons');
60       cy.get('cd-host-details').within(() => {
61         services.checkServiceStatus('rgw');
62       });
63     });
64
65     it('should force maintenance and exit', { retries: 1 }, () => {
66       hosts.maintenance(hostnames[3], true, true);
67     });
68
69     it('should drain, remove and add the host back', () => {
70       hosts.drain(hostnames[1]);
71       hosts.remove(hostnames[1]);
72       hosts.navigateTo('add');
73       hosts.add(hostnames[1]);
74       hosts.checkExist(hostnames[1], true);
75     });
76   });
77
78   describe('OSDs page', () => {
79     const osds = new OSDsPageHelper();
80
81     beforeEach(() => {
82       osds.navigateTo();
83     });
84
85     it('should check if osds are created', { retries: 1 }, () => {
86       osds.getTableCount('total').should('be.gte', 1);
87     });
88   });
89
90   describe('Services page', () => {
91     beforeEach(() => {
92       services.navigateTo();
93     });
94
95     it('should check if services are created', () => {
96       services.checkExist(serviceName, true);
97     });
98   });
99 });