From 612c48d320a24f9df5876c41cfb2abdde82a556f Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 29 Aug 2019 15:50:51 +0000 Subject: [PATCH] mgr/dashboard: Improve clickCheckbox with some waits Signed-off-by: Tiago Melo --- src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts | 2 -- src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts | 2 ++ src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts index 3483972dae0..52cb7b497b8 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts @@ -71,8 +71,6 @@ export class ImagesPageHelper extends PageHelper { .first() .click(); // click toggle menu await $('li.delete.ng-star-inserted').click(); // click delete - // wait for pop-up to be visible (checks for title of pop-up) - await this.waitVisibility($('.modal-body')); await this.clickCheckbox($('.custom-control-label')); await element(by.cssContainingText('button', 'Delete RBD')).click(); await this.waitStaleness(this.getTableCell(name)); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts index ba16c848238..6ef40b3e80d 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts @@ -147,6 +147,7 @@ export abstract class PageHelper { const tagName = await elem.getTagName(); let label: ElementFinder = null; // Both types are clickable + await this.waitPresence(elem); if (tagName === 'input') { if ((await elem.getAttribute('type')) === 'checkbox') { label = elem.element(by.xpath('..')).$(`label[for="${await elem.getAttribute('id')}"]`); @@ -161,6 +162,7 @@ export abstract class PageHelper { ); } + await this.waitClickable(label); return label.click(); } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts index 5510bf21cd6..c5c59daac39 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts @@ -89,8 +89,6 @@ export class PoolPageHelper extends PageHelper { await this.getTableCell(name).click(); await $('.table-actions button.dropdown-toggle').click(); // open submenu await $('li.delete a').click(); // click on "delete" menu item - // wait for pop-up to be visible (checks for title of pop-up) - await this.waitVisibility($('.modal-body')); await this.clickCheckbox($('.custom-control-label')); await element(by.cssContainingText('button', 'Delete Pool')).click(); return this.waitStaleness(this.getTableCell(name)); -- 2.39.5