]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.po.ts
d/control: depend on python3-yaml for ceph-mgr
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / e2e / block / mirroring.po.ts
CommitLineData
9f95a23c
TL
1import { $, by, element } from 'protractor';
2import { PageHelper } from '../page-helper.po';
11fdf7f2 3
9f95a23c
TL
4const pages = { index: '/#/block/mirroring' };
5
6export class MirroringPageHelper extends PageHelper {
7 pages = pages;
8
9 /**
10 * Goes to the mirroring page and edits a pool in the Pool table. Clicks on the
11 * pool and chooses an option (either pool, image, or disabled)
12 */
13 @PageHelper.restrictTo(pages.index)
14 async editMirror(name: string, option: string) {
15 // Clicks the pool in the table
16 await this.waitClickableAndClick(this.getFirstTableCellWithText(name));
17
18 // Clicks the Edit Mode button
19 const editModeButton = element(by.cssContainingText('button', 'Edit Mode'));
20 await this.waitClickableAndClick(editModeButton);
21 // Clicks the drop down in the edit pop-up, then clicks the Update button
22 await this.waitVisibility($('.modal-content'));
23 await this.selectOption('mirrorMode', option);
24
25 // Clicks update button and checks if the mode has been changed
26 await element(by.cssContainingText('button', 'Update')).click();
27 await this.waitStaleness(
28 element(by.cssContainingText('.modal-dialog', 'Edit pool mirror mode'))
29 );
30 const val = option.toLowerCase(); // used since entries in table are lower case
31 await this.waitVisibility(this.getFirstTableCellWithText(val));
11fdf7f2
TL
32 }
33}