]>
Commit | Line | Data |
---|---|---|
e306af50 TL |
1 | import { PageHelper } from '../page-helper.po'; |
2 | ||
3 | const pages = { | |
4 | index: { url: '#/block/mirroring', id: 'cd-mirroring' } | |
5 | }; | |
6 | ||
7 | export class MirroringPageHelper extends PageHelper { | |
8 | pages = pages; | |
9 | ||
10 | /** | |
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) | |
13 | */ | |
14 | @PageHelper.restrictTo(pages.index.url) | |
15 | editMirror(name: string, option: string) { | |
33c7a0ef | 16 | // Select the pool in the table |
e306af50 TL |
17 | this.getFirstTableCell(name).click(); |
18 | ||
19 | // Clicks the Edit Mode button | |
20 | cy.contains('button', 'Edit Mode').click(); | |
21 | ||
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); | |
25 | ||
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'); | |
33c7a0ef TL |
31 | |
32 | // unselect the pool in the table | |
33 | this.getFirstTableCell(name).click(); | |
e306af50 TL |
34 | } |
35 | } |