2 import { PageHelper } from '../../../page-helper.po';
6 index: { url: '#/nfs', id: 'cd-nfs-list' },
7 create: { url: '#/nfs/create', id: 'cd-nfs-form' }
10 export class NFSPageHelper extends PageHelper {
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');
21 cy.get('#security_label').click({ force: true });
23 cy.get('input[data-testid=rgw_path]').type(rgwPath);
26 cy.get('input[name=pseudo]').type(pseudo);
27 this.selectOption('squash', squash);
30 cy.get('button[name=add_client]').click({ force: true });
31 cy.get('input[name=addresses]').type(client['addresses']);
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']);
38 cy.get('cd-submit-button').click();
41 editExport(pseudo: string, editPseudo: string) {
42 this.navigateEdit(pseudo);
44 cy.get('input[name=pseudo]').clear().type(editPseudo);
46 cy.get('cd-submit-button').click();
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);