]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/block/mirroring.po.ts
e24a3ebc037abbc8b1b2fd619fe89e57e86d3f54
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / block / mirroring.po.ts
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) {
16 // Select the pool in the table
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');
31
32 // unselect the pool in the table
33 this.getFirstTableCell(name).click();
34 }
35 }