summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/10-nfs-exports.e2e-spec.ts
blob: f4b5499f08b27eea6518537ff6426aa36b4eeeb2 (plain)
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
/* tslint:disable*/
import { ServicesPageHelper } from '../../cluster/services.po';
import { NFSPageHelper } from '../../orchestrator/workflow/nfs/nfs-export.po';
import { BucketsPageHelper } from '../../rgw/buckets.po';
/* tslint:enable*/

describe('nfsExport page', () => {
  const nfsExport = new NFSPageHelper();
  const services = new ServicesPageHelper();
  const buckets = new BucketsPageHelper();
  const bucketName = 'e2e.nfs.bucket';
  // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
  // const fsPseudo = '/fsPseudo';
  const rgwPseudo = '/rgwPseudo';
  const editPseudo = '/editPseudo';
  const backends = ['CephFS', 'Object Gateway'];
  const squash = 'no_root_squash';
  const client: object = { addresses: '192.168.0.10' };

  beforeEach(() => {
    cy.login();
    Cypress.Cookies.preserveOnce('token');
    nfsExport.navigateTo();
  });

  describe('breadcrumb test', () => {
    it('should open and show breadcrumb', () => {
      nfsExport.expectBreadcrumbText('NFS');
    });
  });

  describe('Create, edit and delete', () => {
    it('should create an NFS cluster', () => {
      services.navigateTo('create');

      services.addService('nfs');

      services.checkExist('nfs.testnfs', true);
      services.getExpandCollapseElement().click();
      services.checkServiceStatus('nfs');
    });

    it('should create a nfs-export with RGW backend', () => {
      buckets.navigateTo('create');
      buckets.create(bucketName, 'dashboard', 'default-placement');

      nfsExport.navigateTo();
      nfsExport.existTableCell(rgwPseudo, false);
      nfsExport.navigateTo('create');
      nfsExport.create(backends[1], squash, client, rgwPseudo, bucketName);
      nfsExport.existTableCell(rgwPseudo);
    });

    // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
    // it('should create a nfs-export with CephFS backend', () => {
    //   nfsExport.navigateTo();
    //   nfsExport.existTableCell(fsPseudo, false);
    //   nfsExport.navigateTo('create');
    //   nfsExport.create(backends[0], squash, client, fsPseudo);
    //   nfsExport.existTableCell(fsPseudo);
    // });

    it('should show Clients', () => {
      nfsExport.clickTab('cd-nfs-details', rgwPseudo, 'Clients (1)');
      cy.get('cd-nfs-details').within(() => {
        nfsExport.getTableCount('total').should('be.gte', 0);
      });
    });

    it('should edit an export', () => {
      nfsExport.editExport(rgwPseudo, editPseudo);

      nfsExport.existTableCell(editPseudo);
    });

    it('should delete exports and bucket', () => {
      nfsExport.delete(editPseudo);

      buckets.navigateTo();
      buckets.delete(bucketName);
    });
  });
});