1 import { PageHelper } from '../page-helper.po';
4 index: { url: '#/block/mirroring', id: 'cd-mirroring' }
7 export class MirroringPageHelper extends PageHelper {
11 * Goes to the mirroring page and edits a pool in the Pool table. Clicks on the
12 * pool and chooses an option (either pool, image, or disabled)
14 @PageHelper.restrictTo(pages.index.url)
15 editMirror(name: string, option: string) {
16 // Select the pool in the table
17 this.getFirstTableCell(name).click();
19 // Clicks the Edit Mode button
20 cy.contains('button', 'Edit Mode').click();
22 // Clicks the drop down in the edit pop-up, then clicks the Update button
23 cy.get('.modal-content').should('be.visible');
24 this.selectOption('mirrorMode', option);
26 // Clicks update button and checks if the mode has been changed
27 cy.contains('button', 'Update').click();
28 cy.contains('.modal-dialog', 'Edit pool mirror mode').should('not.exist');
29 const val = option.toLowerCase(); // used since entries in table are lower case
30 this.getFirstTableCell(val).should('be.visible');
32 // unselect the pool in the table
33 this.getFirstTableCell(name).click();