/
06-cluster-check.e2e-spec.ts
99 lines (82 loc) · 2.82 KB
/
06-cluster-check.e2e-spec.ts
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
describe('when cluster creation is completed', () => {
const createCluster = new CreateClusterWizardHelper();
const services = new ServicesPageHelper();
const serviceName = 'rgw.foo';
beforeEach(() => {
cy.login();
Cypress.Cookies.preserveOnce('token');
});
it('should redirect to dashboard landing page after cluster creation', () => {
createCluster.navigateTo();
createCluster.createCluster();
cy.get('.nav-link').contains('Review').click();
cy.get('button[aria-label="Next"]').click();
cy.get('cd-dashboard').should('exist');
});
describe('Hosts page', () => {
const hosts = new HostsPageHelper();
const hostnames = [
'ceph-node-00',
'ceph-node-01',
'ceph-node-02',
'ceph-node-03'
];
beforeEach(() => {
hosts.navigateTo();
});
it('should have removed "_no_schedule" label', () => {
for (const hostname of hostnames) {
hosts.checkLabelExists(hostname, ['_no_schedule'], false);
}
});
it('should display inventory', () => {
hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
cy.get('cd-host-details').within(() => {
hosts.getTableCount('total').should('be.gte', 0);
});
});
it('should display daemons', () => {
hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
cy.get('cd-host-details').within(() => {
hosts.getTableCount('total').should('be.gte', 0);
});
});
it('should check if rgw service is running', () => {
hosts.clickTab('cd-host-details', hostnames[3], 'Daemons');
cy.get('cd-host-details').within(() => {
services.checkServiceStatus('rgw');
});
});
it('should force maintenance and exit', { retries: 1 }, () => {
hosts.maintenance(hostnames[3], true, true);
});
it('should drain, remove and add the host back', () => {
hosts.drain(hostnames[1]);
hosts.remove(hostnames[1]);
hosts.navigateTo('add');
hosts.add(hostnames[1]);
hosts.checkExist(hostnames[1], true);
});
});
describe('OSDs page', () => {
const osds = new OSDsPageHelper();
beforeEach(() => {
osds.navigateTo();
});
it('should check if osds are created', { retries: 1 }, () => {
osds.getTableCount('total').should('be.gte', 1);
});
});
describe('Services page', () => {
beforeEach(() => {
services.navigateTo();
});
it('should check if services are created', () => {
services.checkExist(serviceName, true);
});
});
});