1 import { PageHelper } from '../page-helper.po';
9 export class ManagerModulesPageHelper extends PageHelper {
10 pages = { index: { url: '#/mgr-modules', id: 'cd-mgr-module-list' } };
13 * Selects the Manager Module and then fills in the desired fields.
15 editMgrModule(name: string, inputs: Input[]) {
16 this.navigateEdit(name);
18 for (const input of inputs) {
19 // Clears fields and adds edits
20 cy.get(`#${input.id}`).clear().type(input.newValue);
23 cy.contains('button', 'Update').click();
24 // Checks if edits appear
25 this.getExpandCollapseElement(name).should('be.visible').click();
27 for (const input of inputs) {
28 cy.get('.datatable-body').last().contains(input.newValue);
31 // Clear mgr module of all edits made to it
32 this.navigateEdit(name);
34 // Clears the editable fields
35 for (const input of inputs) {
37 const id = `#${input.id}`;
40 cy.get(id).type(input.oldValue);
45 // Checks that clearing represents in details tab of module
46 cy.contains('button', 'Update').click();
47 this.getExpandCollapseElement(name).should('be.visible').click();
48 for (const input of inputs) {
50 cy.get('.datatable-body')
52 .should('contain', input.id)
53 .and('not.contain', input.newValue);