]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/nfs/nfs-export.po.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / orchestrator / workflow / nfs / nfs-export.po.ts
1 /* tslint:disable*/
2 import { PageHelper } from '../../../page-helper.po';
3 /* tslint:enable*/
4
5 const pages = {
6 index: { url: '#/nfs', id: 'cd-nfs-list' },
7 create: { url: '#/nfs/create', id: 'cd-nfs-form' }
8 };
9
10 export class NFSPageHelper extends PageHelper {
11 pages = pages;
12
13 @PageHelper.restrictTo(pages.create.url)
14 create(backend: string, squash: string, client: object, pseudo: string, rgwPath?: string) {
15 this.selectOption('cluster_id', 'testnfs');
16 // select a storage backend
17 this.selectOption('name', backend);
18 if (backend === 'CephFS') {
19 this.selectOption('fs_name', 'myfs');
20
21 cy.get('#security_label').click({ force: true });
22 } else {
23 cy.get('input[data-testid=rgw_path]').type(rgwPath);
24 }
25
26 cy.get('input[name=pseudo]').type(pseudo);
27 this.selectOption('squash', squash);
28
29 // Add clients
30 cy.get('button[name=add_client]').click({ force: true });
31 cy.get('input[name=addresses]').type(client['addresses']);
32
33 // Check if we can remove clients and add it again
34 cy.get('span[name=remove_client]').click({ force: true });
35 cy.get('button[name=add_client]').click({ force: true });
36 cy.get('input[name=addresses]').type(client['addresses']);
37
38 cy.get('cd-submit-button').click();
39 }
40
41 editExport(pseudo: string, editPseudo: string) {
42 this.navigateEdit(pseudo);
43
44 cy.get('input[name=pseudo]').clear().type(editPseudo);
45
46 cy.get('cd-submit-button').click();
47
48 // Click the export and check its details table for updated content
49 this.getExpandCollapseElement(editPseudo).click();
50 cy.get('.active.tab-pane').should('contain.text', editPseudo);
51 }
52 }