const createCluster = new CreateClusterWizardHelper();
const createClusterServicePage = new CreateClusterServicePageHelper();
+ const createService = (serviceType: string, serviceName: string, count?: string) => {
+ cy.get('.btn.btn-accent').first().click({ force: true });
+ createClusterServicePage.addService(serviceType, false, count);
+ createClusterServicePage.checkExist(serviceName, true);
+ };
+
beforeEach(() => {
cy.login();
Cypress.Cookies.preserveOnce('token');
const serviceName = 'rgw.foo';
it('should create an rgw service', () => {
- cy.get('.btn.btn-accent').first().click({ force: true });
+ createService('rgw', serviceName, '2');
+ });
- createClusterServicePage.addService('rgw', false, '2');
- createClusterServicePage.checkExist(serviceName, true);
+ it('should delete the service and add it back', () => {
+ createClusterServicePage.deleteService(serviceName);
+
+ createService('rgw', serviceName, '2');
});
it('should edit a service', () => {
createClusterServicePage.expectPlacementCount(serviceName, count);
});
- it('should create and delete an ingress service', () => {
- cy.get('.btn.btn-accent').first().click({ force: true });
-
- createClusterServicePage.addService('ingress');
- createClusterServicePage.checkExist('ingress.rgw.foo', true);
- createClusterServicePage.deleteService('ingress.rgw.foo');
+ it('should create an ingress service', () => {
+ createService('ingress', 'ingress.rgw.foo', '2');
});
});
});
describe('when cluster creation is completed', () => {
const createCluster = new CreateClusterWizardHelper();
const services = new ServicesPageHelper();
+ const hosts = new HostsPageHelper();
+
const serviceName = 'rgw.foo';
+ const hostnames = [
+ 'ceph-node-00.cephlab.com',
+ 'ceph-node-01.cephlab.com',
+ 'ceph-node-02.cephlab.com',
+ 'ceph-node-03.cephlab.com'
+ ];
beforeEach(() => {
cy.login();
});
describe('Hosts page', () => {
- const hosts = new HostsPageHelper();
- const hostnames = [
- 'ceph-node-00.cephlab.com',
- 'ceph-node-01.cephlab.com',
- 'ceph-node-02.cephlab.com',
- 'ceph-node-03.cephlab.com'
- ];
-
beforeEach(() => {
hosts.navigateTo();
});
services.checkServiceStatus('rgw');
});
});
-
- 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);
- });
-
- it('should force maintenance and exit', { retries: 1 }, () => {
- hosts.maintenance(hostnames[3], true, true);
- });
});
describe('OSDs page', () => {
services.checkExist(serviceName, true);
});
});
+
+ describe('Host actions', () => {
+ beforeEach(() => {
+ hosts.navigateTo();
+ });
+
+ 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);
+ });
+ });
});