]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
266983df155b90028661adaffdb68b1025eb9ad4
[ceph.git] /
1 import {
2   CreateClusterServicePageHelper,
3   CreateClusterWizardHelper
4 } from 'cypress/integration/cluster/create-cluster.po';
5
6 describe('Create cluster create services page', () => {
7   const createCluster = new CreateClusterWizardHelper();
8   const createClusterServicePage = new CreateClusterServicePageHelper();
9
10   const createService = (serviceType: string, serviceName: string, count?: string) => {
11     cy.get('.btn.btn-accent').first().click({ force: true });
12     createClusterServicePage.addService(serviceType, false, count);
13     createClusterServicePage.checkExist(serviceName, true);
14   };
15
16   beforeEach(() => {
17     cy.login();
18     Cypress.Cookies.preserveOnce('token');
19     createCluster.navigateTo();
20     createCluster.createCluster();
21     cy.get('.nav-link').contains('Create Services').click();
22   });
23
24   it('should check if title contains Create Services', () => {
25     cy.get('.title').should('contain.text', 'Create Services');
26   });
27
28   describe('when Orchestrator is available', () => {
29     const serviceName = 'rgw.foo';
30
31     it('should create an rgw service', () => {
32       createService('rgw', serviceName, '2');
33     });
34
35     it('should delete the service and add it back', () => {
36       createClusterServicePage.deleteService(serviceName);
37
38       createService('rgw', serviceName, '2');
39     });
40
41     it('should edit a service', () => {
42       const count = '3';
43       createClusterServicePage.editService(serviceName, count);
44       createClusterServicePage.expectPlacementCount(serviceName, count);
45     });
46
47     it('should create an ingress service', () => {
48       createService('ingress', 'ingress.rgw.foo', '2');
49     });
50   });
51 });