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