]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Improve clickCheckbox with some waits
authorTiago Melo <tmelo@suse.com>
Thu, 29 Aug 2019 15:50:51 +0000 (15:50 +0000)
committerTiago Melo <tmelo@suse.com>
Wed, 11 Sep 2019 11:00:41 +0000 (11:00 +0000)
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts
src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts
src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts

index 3483972dae022e60d294689a316fad161692d90d..52cb7b497b8cef23ca9feec48e9436e3b26f86a1 100644 (file)
@@ -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));
index ba16c8482388fd7341662ecef7eaef1dd0bbd71e..6ef40b3e80d0eb11a986c6f6c741685b45c89a75 100644 (file)
@@ -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();
   }
 
index 5510bf21cd66845f713eefa9957d4f147c802f5d..c5c59daac390caaa0bc2ea2f310020916c7f3436 100644 (file)
@@ -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));