]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
d52c7d53864c24f5801972b89a779f946a081f00
[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 = '1') => {
11     cy.get('button[data-testid=table-action-button]').click();
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 and mds service', () => {
32       createService('rgw', serviceName, '2');
33       createService('mds', 'mds.test');
34     });
35
36     it('should edit a service', () => {
37       const daemonCount = '4';
38       createClusterServicePage.editService(serviceName, daemonCount);
39       createClusterServicePage.expectPlacementCount(serviceName, daemonCount);
40     });
41
42     it('should delete the mds service', () => {
43       createClusterServicePage.deleteService('mds.test');
44     });
45   });
46 });