]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: prepend await before expect statements are used
authorPatrick Seidensal <pseidensal@suse.com>
Tue, 27 Aug 2019 12:53:41 +0000 (14:53 +0200)
committerPatrick Seidensal <pseidensal@suse.com>
Wed, 28 Aug 2019 07:38:49 +0000 (09:38 +0200)
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
28 files changed:
src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts
src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts
src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts
src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts

index f046966451aad7b40205f7e1c79e4afcbd9a9356..724a8963d359b2a7e7e700291eff03572943c2ab 100644 (file)
@@ -21,17 +21,17 @@ describe('Images page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await images.getBreadcrumbText()).toEqual('Images');
+      await expect(images.getBreadcrumbText()).toEqual('Images');
     });
 
     it('should show three tabs', async () => {
-      expect(await images.getTabsCount()).toEqual(3);
+      await expect(images.getTabsCount()).toEqual(3);
     });
 
     it('should show text for all tabs', async () => {
-      expect(await images.getTabText(0)).toEqual('Images');
-      expect(await images.getTabText(1)).toEqual('Trash');
-      expect(await images.getTabText(2)).toEqual('Overall Performance');
+      await expect(images.getTabText(0)).toEqual('Images');
+      await expect(images.getTabText(1)).toEqual('Trash');
+      await expect(images.getTabText(2)).toEqual('Overall Performance');
     });
   });
 
@@ -50,17 +50,17 @@ describe('Images page', () => {
 
     it('should create image', async () => {
       await images.createImage(imageName, poolName, '1');
-      expect(await images.getTableCell(imageName).isPresent()).toBe(true);
+      await expect(images.getTableCell(imageName).isPresent()).toBe(true);
     });
 
     it('should edit image', async () => {
       await images.editImage(imageName, poolName, newImageName, '2');
-      expect(await images.getTableCell(newImageName).isPresent()).toBe(true);
+      await expect(images.getTableCell(newImageName).isPresent()).toBe(true);
     });
 
     it('should delete image', async () => {
       await images.deleteImage(newImageName);
-      expect(await images.getTableCell(newImageName).isPresent()).toBe(false);
+      await expect(images.getTableCell(newImageName).isPresent()).toBe(false);
     });
 
     afterAll(async () => {
index b63fc929821bd6a683722b99e79e50d45e3a1ce4..97b4ab139d48201625106bf77af5005b4c99ae77 100644 (file)
@@ -22,7 +22,7 @@ export class ImagesPageHelper extends PageHelper {
     await element(by.id('pool')).click();
     await element(by.cssContainingText('select[name=pool] option', pool)).click();
     await $(getPoolName).click();
-    expect(await element(by.id('pool')).getAttribute('class')).toContain('ng-valid'); // check if selected
+    await expect(element(by.id('pool')).getAttribute('class')).toContain('ng-valid'); // check if selected
 
     // Enter in the size of the image
     await element(by.id('size')).click();
@@ -53,8 +53,8 @@ export class ImagesPageHelper extends PageHelper {
     await browser.wait(Helper.EC.elementToBeClickable(this.getTableCell(newName)), Helper.TIMEOUT);
     // click edit button and wait to make sure new owner is present in table
     await this.getTableCell(newName).click();
-    expect(
-      await element
+    await expect(
+      element
         .all(by.css('.table.table-striped.table-bordered'))
         .first()
         .getText()
index a061341e679463804c83ceabbaaf2d664f26964e..22ffb9261409393545d1b35d2ba3e5a4cd403dc6 100644 (file)
@@ -18,7 +18,7 @@ describe('Iscsi Page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await iscsi.getBreadcrumbText()).toEqual('Overview');
+      await expect(iscsi.getBreadcrumbText()).toEqual('Overview');
     });
   });
 
@@ -30,13 +30,13 @@ describe('Iscsi Page', () => {
     it('should check that tables are displayed and legends are correct', async () => {
       // Check tables are displayed
       const dataTables = iscsi.getDataTables();
-      expect(await dataTables.get(0).isDisplayed());
-      expect(await dataTables.get(1).isDisplayed());
+      await expect(dataTables.get(0).isDisplayed());
+      await expect(dataTables.get(1).isDisplayed());
 
       // Check that legends are correct
       const legends = iscsi.getLegends();
-      expect(await legends.get(0).getText()).toMatch('Gateways');
-      expect(await legends.get(1).getText()).toMatch('Images');
+      await expect(legends.get(0).getText()).toMatch('Gateways');
+      await expect(legends.get(1).getText()).toMatch('Images');
     });
   });
 });
index 8cbc45061fb8f1e6af5f1fe440e664177bcbaf35..0e59625365f979145bd9e921f00dd2fea937c5a8 100644 (file)
@@ -21,17 +21,17 @@ describe('Mirroring page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await mirroring.getBreadcrumbText()).toEqual('Mirroring');
+      await expect(mirroring.getBreadcrumbText()).toEqual('Mirroring');
     });
 
     it('should show three tabs', async () => {
-      expect(await mirroring.getTabsCount()).toEqual(3);
+      await expect(mirroring.getTabsCount()).toEqual(3);
     });
 
     it('should show text for all tabs', async () => {
-      expect(await mirroring.getTabText(0)).toEqual('Issues');
-      expect(await mirroring.getTabText(1)).toEqual('Syncing');
-      expect(await mirroring.getTabText(2)).toEqual('Ready');
+      await expect(mirroring.getTabText(0)).toEqual('Issues');
+      await expect(mirroring.getTabText(1)).toEqual('Syncing');
+      await expect(mirroring.getTabText(2)).toEqual('Ready');
     });
   });
 
@@ -49,11 +49,11 @@ describe('Mirroring page', () => {
       await mirroring.navigateTo();
 
       await mirroring.editMirror(poolName, 'Pool');
-      expect(await mirroring.getFirstTableCellWithText('pool').isPresent()).toBe(true);
+      await expect(mirroring.getFirstTableCellWithText('pool').isPresent()).toBe(true);
       await mirroring.editMirror(poolName, 'Image');
-      expect(await mirroring.getFirstTableCellWithText('image').isPresent()).toBe(true);
+      await expect(mirroring.getFirstTableCellWithText('image').isPresent()).toBe(true);
       await mirroring.editMirror(poolName, 'Disabled');
-      expect(await mirroring.getFirstTableCellWithText('disabled').isPresent()).toBe(true);
+      await expect(mirroring.getFirstTableCellWithText('disabled').isPresent()).toBe(true);
     });
 
     afterAll(async () => {
index d20a3f4f3e6b5afd0a40f4a88fede0dfc4e42d4d..a45c8a15f7356dd8a5f5d4de8eec38256d5a5808 100644 (file)
@@ -18,7 +18,7 @@ describe('Alerts page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await alerts.getBreadcrumbText()).toEqual('Alerts');
+      await expect(alerts.getBreadcrumbText()).toEqual('Alerts');
     });
   });
 });
index e25ea4ac460cdbc6f6e042c7e2b184eac7b65718..527704c771b0ca159f48142bee380517b2571392 100644 (file)
@@ -18,7 +18,7 @@ describe('Configuration page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await configuration.getBreadcrumbText()).toEqual('Configuration');
+      await expect(configuration.getBreadcrumbText()).toEqual('Configuration');
     });
   });
   describe('edit configuration test', () => {
index 0091e9be8d89bf68dd5c08755d8691f30784284e..c489d9e9c26f99ab8be4d3068407e3d33386fdd7 100644 (file)
@@ -70,7 +70,7 @@ export class ConfigurationPageHelper extends PageHelper {
     await this.getTableCell(name).click(); // click on the config to edit
     await element(by.cssContainingText('button', 'Edit')).click(); // clicks button to edit
 
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
 
     for (let i = 0, valtuple; (valtuple = values[i]); i++) {
       // Finds desired value based off given list
index 4df82e1d3428f8d1dbeea442d15fac3656716abe..2ecfcd4c69a851274f2b4e9c45d265ee00b58a54 100644 (file)
@@ -19,7 +19,7 @@ describe('CRUSH map page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await crushmap.getBreadcrumbText()).toEqual('CRUSH map');
+      await expect(crushmap.getBreadcrumbText()).toEqual('CRUSH map');
     });
   });
   describe('fields check', () => {
@@ -29,17 +29,17 @@ describe('CRUSH map page', () => {
 
     it('should check that title & table appears', async () => {
       // Check that title (CRUSH map viewer) appears
-      expect(await crushmap.getPageTitle()).toMatch('CRUSH map viewer');
+      await expect(crushmap.getPageTitle()).toMatch('CRUSH map viewer');
 
       // Check that title appears once OSD is clicked
       await crushmap.getCrushNode(1).click();
 
       const label = await $('legend').getText(); // Get table label
-      expect(await crushmap.getCrushNode(1).getText()).toEqual(label);
+      await expect(crushmap.getCrushNode(1).getText()).toEqual(label);
 
       // Check that table appears once OSD is clicked
       await browser.wait(Helper.EC.visibilityOf($('.datatable-body')));
-      expect(await $('.datatable-body').isDisplayed()).toBe(true);
+      await expect($('.datatable-body').isDisplayed()).toBe(true);
     });
   });
 });
index 9619c7878b5d286846cd58aa19e07cf0dc634a35..9d3aa031cefb7d3ffa24033ad52939560c879826 100644 (file)
@@ -18,19 +18,19 @@ describe('Hosts page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await hosts.getBreadcrumbText()).toEqual('Hosts');
+      await expect(hosts.getBreadcrumbText()).toEqual('Hosts');
     });
 
     it('should show two tabs', async () => {
-      expect(await hosts.getTabsCount()).toEqual(2);
+      await expect(hosts.getTabsCount()).toEqual(2);
     });
 
     it('should show hosts list tab at first', async () => {
-      expect(await hosts.getTabText(0)).toEqual('Hosts List');
+      await expect(hosts.getTabText(0)).toEqual('Hosts List');
     });
 
     it('should show overall performance as a second tab', async () => {
-      expect(await hosts.getTabText(1)).toEqual('Overall Performance');
+      await expect(hosts.getTabText(1)).toEqual('Overall Performance');
     });
   });
 
index 81037c279c735423b15dd5679218e9b630896947..bbc71207f74f28603cea1f54d5782b7815a30af1 100644 (file)
@@ -7,7 +7,7 @@ export class HostsPageHelper extends PageHelper {
   async check_for_host() {
     await this.navigateTo();
 
-    expect(await this.getTableTotalCount()).not.toBe(0);
+    await expect(this.getTableTotalCount()).not.toBe(0);
   }
 
   // function that checks all services links work for first
@@ -21,7 +21,7 @@ export class HostsPageHelper extends PageHelper {
     // check is any services links are present
     const txt = await services.getText();
     // check that text (links) is present in services box
-    expect(txt.length).toBeGreaterThan(0, 'No services links exist on first host');
+    await expect(txt.length).toBeGreaterThan(0, 'No services links exist on first host');
     if (txt.length === 0) {
       return;
     }
@@ -31,12 +31,12 @@ export class HostsPageHelper extends PageHelper {
       // click link, check it worked by looking for changed breadcrumb,
       // navigate back to hosts page, repeat until all links checked
       await links.get(i).click();
-      expect(await this.getBreadcrumbText()).toEqual('Performance Counters');
+      await expect(this.getBreadcrumbText()).toEqual('Performance Counters');
       await this.navigateTo();
-      expect(await this.getBreadcrumbText()).toEqual('Hosts');
+      await expect(this.getBreadcrumbText()).toEqual('Hosts');
       links_tested++;
     }
     // check if any links were actually tested
-    expect(links_tested > 0).toBe(true, 'No links were tested. Test failed');
+    await expect(links_tested > 0).toBe(true, 'No links were tested. Test failed');
   }
 }
index 72aa8c895f096eef9881235759c272776b957a47..d1b2dc81d78c470d9517ba1a5147d683be4a4dfe 100644 (file)
@@ -33,19 +33,19 @@ describe('Logs page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await logs.getBreadcrumbText()).toEqual('Logs');
+      await expect(logs.getBreadcrumbText()).toEqual('Logs');
     });
 
     it('should show two tabs', async () => {
-      expect(await logs.getTabsCount()).toEqual(2);
+      await expect(logs.getTabsCount()).toEqual(2);
     });
 
     it('should show cluster logs tab at first', async () => {
-      expect(await logs.getTabText(0)).toEqual('Cluster Logs');
+      await expect(logs.getTabText(0)).toEqual('Cluster Logs');
     });
 
     it('should show audit logs as a second tab', async () => {
-      expect(await logs.getTabText(1)).toEqual('Audit Logs');
+      await expect(logs.getTabText(1)).toEqual('Audit Logs');
     });
   });
 
index e478d0fff9b421c9e26082b7ac8f5623605dba66..2451e0dd20a51bda3c6c44b36c9d3afd8b5b419b 100644 (file)
@@ -66,8 +66,8 @@ export class LogsPageHelper extends PageHelper {
     const audit_logs_body = audit_logs_tab.element(by.css('.card-body'));
     const logs = audit_logs_body.all(by.cssContainingText('.ng-star-inserted', poolname));
 
-    expect(await logs.getText()).toMatch(poolname);
-    expect(await logs.getText()).toMatch(`pool ${poolfunction}`);
+    await expect(logs.getText()).toMatch(poolname);
+    await expect(logs.getText()).toMatch(`pool ${poolfunction}`);
   }
 
   async checkAuditForConfigChange(configname, setting, hour, minute) {
@@ -124,7 +124,7 @@ export class LogsPageHelper extends PageHelper {
 
     await browser.wait(Helper.EC.presenceOf(logs.first()), Helper.TIMEOUT);
 
-    expect(await logs.getText()).toMatch(configname);
-    expect(await logs.getText()).toMatch(setting);
+    await expect(logs.getText()).toMatch(configname);
+    await expect(logs.getText()).toMatch(setting);
   }
 }
index 0a238d4e076b765396ed4854805c62985e259e2c..0790b127dfc18870f947e6bc6379d89121be2bc5 100644 (file)
@@ -18,7 +18,7 @@ describe('Manager modules page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await mgrmodules.getBreadcrumbText()).toEqual('Manager modules');
+      await expect(mgrmodules.getBreadcrumbText()).toEqual('Manager modules');
     });
   });
 
index f86fae2a613614db13314918a7298b885ea23c10..d2f27793dbaa136646d52ade6d4f4c125db713ab 100644 (file)
@@ -18,7 +18,7 @@ describe('Monitors page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await monitors.getBreadcrumbText()).toEqual('Monitors');
+      await expect(monitors.getBreadcrumbText()).toEqual('Monitors');
     });
   });
 
@@ -29,84 +29,84 @@ describe('Monitors page', () => {
 
     it('should check status table is present', async () => {
       // check for table header 'Status'
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getLegends()
           .get(0)
           .getText()
       ).toMatch('Status');
 
       // check for fields in table
-      expect(await monitors.getStatusTables().getText()).toMatch('Cluster ID');
-      expect(await monitors.getStatusTables().getText()).toMatch('monmap modified');
-      expect(await monitors.getStatusTables().getText()).toMatch('monmap epoch');
-      expect(await monitors.getStatusTables().getText()).toMatch('quorum con');
-      expect(await monitors.getStatusTables().getText()).toMatch('quorum mon');
-      expect(await monitors.getStatusTables().getText()).toMatch('required con');
-      expect(await monitors.getStatusTables().getText()).toMatch('required mon');
+      await expect(monitors.getStatusTables().getText()).toMatch('Cluster ID');
+      await expect(monitors.getStatusTables().getText()).toMatch('monmap modified');
+      await expect(monitors.getStatusTables().getText()).toMatch('monmap epoch');
+      await expect(monitors.getStatusTables().getText()).toMatch('quorum con');
+      await expect(monitors.getStatusTables().getText()).toMatch('quorum mon');
+      await expect(monitors.getStatusTables().getText()).toMatch('required con');
+      await expect(monitors.getStatusTables().getText()).toMatch('required mon');
     });
 
     it('should check In Quorum and Not In Quorum tables are present', async () => {
       // check for there to be two tables
-      expect(await monitors.getDataTables().count()).toEqual(2);
+      await expect(monitors.getDataTables().count()).toEqual(2);
 
       // check for table header 'In Quorum'
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getLegends()
           .get(1)
           .getText()
       ).toMatch('In Quorum');
 
       // check for table header 'Not In Quorum'
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getLegends()
           .get(2)
           .getText()
       ).toMatch('Not In Quorum');
 
       // verify correct columns on In Quorum table
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(0)
           .getText()
       ).toMatch('Name');
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(0)
           .getText()
       ).toMatch('Rank');
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(0)
           .getText()
       ).toMatch('Public Address');
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(0)
           .getText()
       ).toMatch('Open Sessions');
 
       // verify correct columns on Not In Quorum table
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(1)
           .getText()
       ).toMatch('Name');
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(1)
           .getText()
       ).toMatch('Rank');
-      expect(
-        await monitors
+      await expect(
+        monitors
           .getDataTableHeaders()
           .get(1)
           .getText()
index 55c482a35efd90d2fd3bc9c485a6482fc93dbb58..5ff7dd35d7e4d6c100ae9609fb51f7ecd20e44fb 100644 (file)
@@ -18,19 +18,19 @@ describe('OSDs page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await osds.getBreadcrumbText()).toEqual('OSDs');
+      await expect(osds.getBreadcrumbText()).toEqual('OSDs');
     });
 
     it('should show two tabs', async () => {
-      expect(await osds.getTabsCount()).toEqual(2);
+      await expect(osds.getTabsCount()).toEqual(2);
     });
 
     it('should show OSDs list tab at first', async () => {
-      expect(await osds.getTabText(0)).toEqual('OSDs List');
+      await expect(osds.getTabText(0)).toEqual('OSDs List');
     });
 
     it('should show overall performance as a second tab', async () => {
-      expect(await osds.getTabText(1)).toEqual('Overall Performance');
+      await expect(osds.getTabText(1)).toEqual('Overall Performance');
     });
   });
 });
index 711be73a0ddb6061e72e22183bc396f8a4428928..ba30234776545e28f172e42769b6256efb20bc21 100644 (file)
@@ -48,9 +48,9 @@ describe('Dashboard Main Page', () => {
       };
 
       for (const [linkText, breadcrumbText] of Object.entries(expectationMap)) {
-        expect(await browser.getCurrentUrl()).toContain('/#/dashboard');
+        await expect(browser.getCurrentUrl()).toContain('/#/dashboard');
         await dashboard.clickInfoCardLink(linkText);
-        expect(await dashboard.getBreadcrumbText()).toEqual(breadcrumbText);
+        await expect(dashboard.getBreadcrumbText()).toEqual(breadcrumbText);
         await dashboard.navigateBack();
       }
     });
@@ -80,7 +80,7 @@ describe('Dashboard Main Page', () => {
       ];
 
       for (let i = 0; i < order.length; i++) {
-        expect((await dashboard.infoCard(i)).getText()).toContain(
+        await expect((await dashboard.infoCard(i)).getText()).toContain(
           order[i],
           `Order of ${order[i]} seems to be wrong`
         );
@@ -88,10 +88,10 @@ describe('Dashboard Main Page', () => {
     });
 
     it('should verify that info card group titles are present and in the right order', async () => {
-      expect(await browser.getCurrentUrl()).toContain('/#/dashboard');
-      expect(await dashboard.infoGroupTitle(0)).toBe('Status');
-      expect(await dashboard.infoGroupTitle(1)).toBe('Performance');
-      expect(await dashboard.infoGroupTitle(2)).toBe('Capacity');
+      await expect(browser.getCurrentUrl()).toContain('/#/dashboard');
+      await expect(dashboard.infoGroupTitle(0)).toBe('Status');
+      await expect(dashboard.infoGroupTitle(1)).toBe('Performance');
+      await expect(dashboard.infoGroupTitle(2)).toBe('Capacity');
     });
   });
 
@@ -131,7 +131,7 @@ describe('Dashboard Main Page', () => {
       }
       await spec.pageObject.navigateTo();
       const tableCount = await spec.pageObject.getTableTotalCount();
-      expect(dashCount).toBe(
+      await expect(dashCount).toBe(
         tableCount,
         `Text of card ${spec.cardName} and regex ${spec.regexMatcher} resulted in ${dashCount} ` +
           `but did not match table count ${tableCount}`
index efbf9222ddb8999e1b9279e5133fed3252ab750f..344afcd32458187a8cf9f23f56a635ea14f744cb 100644 (file)
@@ -18,7 +18,7 @@ describe('Filesystems page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await filesystems.getBreadcrumbText()).toEqual('Filesystems');
+      await expect(filesystems.getBreadcrumbText()).toEqual('Filesystems');
     });
   });
 });
index 64e0cd1c3c8ff97ed3694b57ef215f77a280c04a..aac6416e81ae5fd92af2d415d564d5f5350b1c9f 100644 (file)
@@ -86,6 +86,6 @@ export class Helper {
       console.log('\n log: ' + require('util').inspect(browserLog));
     }
 
-    expect(browserLog.length).toEqual(0);
+    await expect(browserLog.length).toEqual(0);
   }
 }
index f53e30ff86d8d4f9edb2fda0d3b6ab6c4cccaeb4..d51aeaef7cf97661bf3afcbc61eeff7210b9b888 100644 (file)
@@ -18,7 +18,7 @@ describe('Nfs page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await nfs.getBreadcrumbText()).toEqual('NFS');
+      await expect(nfs.getBreadcrumbText()).toEqual('NFS');
     });
   });
 });
index 1ec08b2865a26496936747f958b1d44f74909c0b..b747adf2295d88b02834fa89609cbfb9c69e485d 100644 (file)
@@ -16,19 +16,19 @@ describe('Pools page', () => {
 
   describe('breadcrumb and tab tests', () => {
     it('should open and show breadcrumb', async () => {
-      expect(await pools.getBreadcrumbText()).toEqual('Pools');
+      await expect(pools.getBreadcrumbText()).toEqual('Pools');
     });
 
     it('should show two tabs', async () => {
-      expect(await pools.getTabsCount()).toEqual(2);
+      await expect(pools.getTabsCount()).toEqual(2);
     });
 
     it('should show pools list tab at first', async () => {
-      expect(await pools.getTabText(0)).toEqual('Pools List');
+      await expect(pools.getTabText(0)).toEqual('Pools List');
     });
 
     it('should show overall performance as a second tab', async () => {
-      expect(await pools.getTabText(1)).toEqual('Overall Performance');
+      await expect(pools.getTabText(1)).toEqual('Overall Performance');
     });
   });
 
index 95b437eff5a9a341c63321ddfe15be3ff6201ac2..cf9e94c073a04d960c288c011be996922638e9bf 100644 (file)
@@ -40,7 +40,7 @@ export class PoolPageHelper extends PageHelper {
     await nameInput.sendKeys(name);
     await element(by.cssContainingText('select[name=poolType] option', 'replicated')).click();
 
-    expect(await element(by.css('select[name=poolType] option:checked')).getText()).toBe(
+    await expect(element(by.css('select[name=poolType] option:checked')).getText()).toBe(
       ' replicated '
     );
     await $('input[name=pgNum]').sendKeys(
@@ -62,7 +62,7 @@ export class PoolPageHelper extends PageHelper {
     const elem = await this.getTableCellByContent(name);
     await elem.click(); // select pool from the table
     await element(by.cssContainingText('button', 'Edit')).click(); // click edit button
-    expect(await this.getBreadcrumbText()).toEqual('Edit'); // verify we are now on edit page
+    await expect(this.getBreadcrumbText()).toEqual('Edit'); // verify we are now on edit page
     await $('input[name=pgNum]').sendKeys(protractor.Key.CONTROL, 'a', protractor.Key.NULL, new_pg);
     await element(by.css('cd-submit-button')).click();
     const str = `${new_pg} active+clean`;
index 1631b645f9054db21471e74d618f02f05a7a3e14..3930ea50756aac13cc9acc4fb5c4b5fe64997234 100644 (file)
@@ -15,7 +15,7 @@ describe('RGW buckets page', () => {
 
   it('should open and show breadcrumb', async () => {
     await buckets.navigateTo();
-    expect(await $('.breadcrumb-item.active').getText()).toBe('Buckets');
+    await expect($('.breadcrumb-item.active').getText()).toBe('Buckets');
   });
 
   it('should create bucket', async () => {
@@ -25,19 +25,19 @@ describe('RGW buckets page', () => {
       '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
       'default-placement'
     );
-    expect(await buckets.getTableCell('000test').isPresent()).toBe(true);
+    await expect(buckets.getTableCell('000test').isPresent()).toBe(true);
   });
 
   it('should edit bucket', async () => {
     await buckets.navigateTo();
     await buckets.edit('000test', 'dev');
-    expect(await buckets.getTable().getText()).toMatch('dev');
+    await expect(buckets.getTable().getText()).toMatch('dev');
   });
 
   it('should delete bucket', async () => {
     await buckets.navigateTo();
     await buckets.delete('000test');
-    expect(buckets.getTableCell('000test').isPresent()).toBe(false);
+    await expect(buckets.getTableCell('000test').isPresent()).toBe(false);
   });
 
   describe('Invalid Input in Create and Edit tests', () => {
index e86ad1b2aa409fc9eec999d9e4133a5ff7f6e9ab..8db2b4fd4093b300cbf3f6885683c5b510973539 100644 (file)
@@ -22,14 +22,14 @@ export class BucketsPageHelper extends PageHelper {
     // Select bucket owner
     await element(by.id('owner')).click();
     await element(by.cssContainingText('select[name=owner] option', owner)).click();
-    expect(element(by.id('owner')).getAttribute('class')).toContain('ng-valid');
+    await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-valid');
 
     // Select bucket placement target:
     await element(by.id('owner')).click();
     await element(
       by.cssContainingText('select[name=placement-target] option', placementTarget)
     ).click();
-    expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-valid');
+    await expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-valid');
 
     // Click the create button and wait for bucket to be made
     const createButton = element(by.cssContainingText('button', 'Create Bucket'));
@@ -46,8 +46,8 @@ export class BucketsPageHelper extends PageHelper {
   async edit(name: string, new_owner: string) {
     await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
     await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
-    expect(element(by.css('input[name=placement-target]')).getAttribute('value')).toBe(
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
+    await expect(element(by.css('input[name=placement-target]')).getAttribute('value')).toBe(
       'default-placement'
     );
     await element(by.id('owner')).click(); // click owner dropdown menu
@@ -66,7 +66,7 @@ export class BucketsPageHelper extends PageHelper {
     const element_details_table = element
       .all(by.css('.table.table-striped.table-bordered'))
       .first();
-    expect(element_details_table.getText()).toMatch(new_owner);
+    await expect(element_details_table.getText()).toMatch(new_owner);
     return promise;
   }
 
@@ -111,10 +111,10 @@ export class BucketsPageHelper extends PageHelper {
     );
 
     // Check that name input field was marked invalid in the css
-    expect(await nameInputField.getAttribute('class')).toContain('ng-invalid');
+    await expect(nameInputField.getAttribute('class')).toContain('ng-invalid');
 
     // Check that error message was printed under name input field
-    expect(await element(by.css('#bid + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#bid + .invalid-feedback')).getText()).toMatch(
       'The value is not valid.'
     );
 
@@ -131,10 +131,10 @@ export class BucketsPageHelper extends PageHelper {
     await nameInputField.click();
 
     // Check that owner drop down field was marked invalid in the css
-    expect(await element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
 
     // Check that error message was printed under owner drop down field
-    expect(await element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
@@ -149,15 +149,15 @@ export class BucketsPageHelper extends PageHelper {
       by.cssContainingText('select[name=placement-target] option', 'Select a placement target')
     ).click();
     await nameInputField.click(); // Trigger validation
-    expect(await element(by.id('placement-target')).getAttribute('class')).toContain('ng-invalid');
-    expect(await element(by.css('#placement-target + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.css('#placement-target + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
     // Clicks the Create Bucket button but the page doesn't move. Done by testing
     // for the breadcrumb
     await element(by.cssContainingText('button', 'Create Bucket')).click(); // Clicks Create Bucket button
-    expect(await this.getBreadcrumbText()).toEqual('Create');
+    await expect(this.getBreadcrumbText()).toEqual('Create');
     // content in fields seems to subsist through tests if not cleared, so it is cleared
     await nameInputField.clear();
     return element(by.cssContainingText('button', 'Cancel')).click();
@@ -174,7 +174,7 @@ export class BucketsPageHelper extends PageHelper {
     await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
     await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
 
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
 
     // Chooses 'Select a user' rather than a valid owner on Edit Bucket page
     // and checks if it's an invalid input
@@ -190,13 +190,13 @@ export class BucketsPageHelper extends PageHelper {
     await element(by.cssContainingText('button', 'Edit Bucket')).click();
 
     // Check that owner drop down field was marked invalid in the css
-    expect(await element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
 
     // Check that error message was printed under owner drop down field
-    expect(await element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
   }
 }
index ba8a2b46466a3a54474e853f91a35cf05950a599..24b982d7cc7efa125f28e7b1211fa436f4e8d775 100644 (file)
@@ -18,19 +18,19 @@ describe('RGW daemons page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await daemons.getBreadcrumbText()).toEqual('Daemons');
+      await expect(daemons.getBreadcrumbText()).toEqual('Daemons');
     });
 
     it('should show two tabs', async () => {
-      expect(await daemons.getTabsCount()).toEqual(2);
+      await expect(daemons.getTabsCount()).toEqual(2);
     });
 
     it('should show daemons list tab at first', async () => {
-      expect(await daemons.getTabText(0)).toEqual('Daemons List');
+      await expect(daemons.getTabText(0)).toEqual('Daemons List');
     });
 
-    it('should show overall performance as a second tab', () => {
-      expect(daemons.getTabText(1)).toEqual('Overall Performance');
+    it('should show overall performance as a second tab', async () => {
+      await expect(daemons.getTabText(1)).toEqual('Overall Performance');
     });
   });
 
index 6000b667a4b584ca105868cb62266acb9c622f1e..c1cb9d7b3b53faca54cb8d21ed308a96071afe26 100644 (file)
@@ -17,25 +17,25 @@ export class DaemonsPageHelper extends PageHelper {
     const performance_counters_table = tab_container.all(by.css('cd-table')).get(1);
 
     // check details table is visible
-    expect(await details_table.isDisplayed()).toBe(true);
+    await expect(details_table.isDisplayed()).toBe(true);
     // check at least one field is present
-    expect(await details_table.getText()).toMatch('ceph_version');
+    await expect(details_table.getText()).toMatch('ceph_version');
     // check performance counters table is not currently visible
-    expect(await performance_counters_table.isDisplayed()).toBe(false);
+    await expect(performance_counters_table.isDisplayed()).toBe(false);
 
     // click on performance counters tab and check table is loaded
     await element(by.cssContainingText('.nav-link', 'Performance Counters')).click();
-    expect(await performance_counters_table.isDisplayed()).toBe(true);
+    await expect(performance_counters_table.isDisplayed()).toBe(true);
     // check at least one field is present
-    expect(await performance_counters_table.getText()).toMatch('objecter.op_r');
+    await expect(performance_counters_table.getText()).toMatch('objecter.op_r');
     // check details table is not currently visible
-    expect(await details_table.isDisplayed()).toBe(false);
+    await expect(details_table.isDisplayed()).toBe(false);
 
     // click on performance details tab
     await element(by.cssContainingText('.nav-link', 'Performance Details')).click();
     // checks the other tabs' content isn't visible
-    expect(await details_table.isDisplayed()).toBe(false);
-    expect(await performance_counters_table.isDisplayed()).toBe(false);
+    await expect(details_table.isDisplayed()).toBe(false);
+    await expect(performance_counters_table.isDisplayed()).toBe(false);
     // TODO: Expect Grafana iFrame
   }
 }
index bf6cf71726e91370e48113420cc4bb4a327deb1e..c36f16fb821205f1b47d189fba7c5056f193de78 100644 (file)
@@ -19,7 +19,7 @@ describe('RGW users page', () => {
     });
 
     it('should open and show breadcrumb', async () => {
-      expect(await users.getBreadcrumbText()).toEqual('Users');
+      await expect(users.getBreadcrumbText()).toEqual('Users');
     });
   });
 
@@ -30,7 +30,7 @@ describe('RGW users page', () => {
 
     it('should create user', async () => {
       await users.create(user_name, 'Some Name', 'original@website.com', '1200');
-      expect(await users.getTableCell(user_name).isPresent()).toBe(true);
+      await expect(users.getTableCell(user_name).isPresent()).toBe(true);
     });
 
     it('should edit users full name, email and max buckets', async () => {
@@ -40,7 +40,7 @@ describe('RGW users page', () => {
 
     it('should delete user', async () => {
       await users.delete(user_name);
-      expect(await users.getTableCell(user_name).isPresent()).toBe(false);
+      await expect(users.getTableCell(user_name).isPresent()).toBe(false);
     });
   });
 
index a91e0679aeafb0167b2e100a065f3b3b331fcd7b..96734b0074085666455169d947aa8f3bbdfb736a 100644 (file)
@@ -40,7 +40,7 @@ export class UsersPageHelper extends PageHelper {
     await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
     await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
 
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
 
     // Change the full name field
     await element(by.id('display_name')).click();
@@ -62,9 +62,9 @@ export class UsersPageHelper extends PageHelper {
     await browser.wait(Helper.EC.elementToBeClickable(this.getTableCell(name)), 10000);
     // Click the user and check its details table for updated content
     await this.getTableCell(name).click();
-    expect(await $('.active.tab-pane').getText()).toMatch(new_fullname); // check full name was changed
-    expect(await $('.active.tab-pane').getText()).toMatch(new_email); // check email was changed
-    expect(await $('.active.tab-pane').getText()).toMatch(new_maxbuckets); // check max buckets was changed
+    await expect($('.active.tab-pane').getText()).toMatch(new_fullname); // check full name was changed
+    await expect($('.active.tab-pane').getText()).toMatch(new_email); // check email was changed
+    await expect($('.active.tab-pane').getText()).toMatch(new_maxbuckets); // check max buckets was changed
   }
 
   async delete(name) {
@@ -99,7 +99,7 @@ export class UsersPageHelper extends PageHelper {
     const username_field = element(by.id('uid'));
 
     // No username had been entered. Field should be invalid
-    expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+    await expect(username_field.getAttribute('class')).toContain('ng-invalid');
 
     // Try to give user already taken name. Should make field invalid.
     await username_field.clear();
@@ -108,9 +108,9 @@ export class UsersPageHelper extends PageHelper {
       async () => !(await username_field.getAttribute('class')).includes('ng-pending'),
       6000
     );
-    expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+    await expect(username_field.getAttribute('class')).toContain('ng-invalid');
     await element(by.id('display_name')).click(); // trigger validation check
-    expect(await element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
       'The chosen user ID is already in use.'
     );
 
@@ -118,31 +118,31 @@ export class UsersPageHelper extends PageHelper {
     for (let i = 0; i < uname.length; i++) {
       await username_field.sendKeys(protractor.Key.BACK_SPACE);
     }
-    expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+    await expect(username_field.getAttribute('class')).toContain('ng-invalid');
     await element(by.id('display_name')).click(); // trigger validation check
-    expect(await element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
     // No display name has been given so field should be invalid
-    expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
 
     // display name field should also be marked invalid if given input then emptied
     await element(by.id('display_name')).click();
     await element(by.id('display_name')).sendKeys('a');
     await element(by.id('display_name')).sendKeys(protractor.Key.BACK_SPACE);
-    expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
     await username_field.click(); // trigger validation check
-    expect(await element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
     // put invalid email to make field invalid
     await element(by.id('email')).click();
     await element(by.id('email')).sendKeys('a');
-    expect(await element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
     await username_field.click(); // trigger validation check
-    expect(await element(by.css('#email + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#email + .invalid-feedback')).getText()).toMatch(
       'This is not a valid email address.'
     );
 
@@ -150,9 +150,9 @@ export class UsersPageHelper extends PageHelper {
     await element(by.id('max_buckets')).click();
     await element(by.id('max_buckets')).clear();
     await element(by.id('max_buckets')).sendKeys('-5');
-    expect(await element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
     await username_field.click(); // trigger validation check
-    expect(await element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
       'The entered value must be >= 0.'
     );
 
@@ -170,7 +170,7 @@ export class UsersPageHelper extends PageHelper {
     await this.getTableCell(uname).click(); // click on the bucket you want to edit in the table
     await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
 
-    expect(await this.getBreadcrumbText()).toEqual('Edit');
+    await expect(this.getBreadcrumbText()).toEqual('Edit');
 
     // put invalid email to make field invalid
     await element(by.id('email')).click();
@@ -180,9 +180,9 @@ export class UsersPageHelper extends PageHelper {
       async () => !(await element(by.id('email')).getAttribute('class')).includes('ng-pending'),
       6000
     );
-    expect(await element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
     await element(by.id('display_name')).click(); // trigger validation check
-    expect(await element(by.css('#email + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#email + .invalid-feedback')).getText()).toMatch(
       'This is not a valid email address.'
     );
 
@@ -191,9 +191,9 @@ export class UsersPageHelper extends PageHelper {
     for (let i = 0; i < 3; i++) {
       await element(by.id('display_name')).sendKeys(protractor.Key.BACK_SPACE);
     }
-    expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
     await element(by.id('email')).click(); // trigger validation check
-    expect(await element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
       'This field is required.'
     );
 
@@ -201,9 +201,9 @@ export class UsersPageHelper extends PageHelper {
     await element(by.id('max_buckets')).click();
     await element(by.id('max_buckets')).clear();
     await element(by.id('max_buckets')).sendKeys('-5');
-    expect(await element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
+    await expect(element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
     await element(by.id('email')).click(); // trigger validation check
-    expect(await element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
+    await expect(element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
       'The entered value must be >= 0.'
     );
 
index bac2068de9fa5af8e902a51d546b6b9a0a1bf492..3f72e3ce673677b47fee67bff5348616f32910b9 100644 (file)
@@ -17,22 +17,22 @@ describe('User Management page', () => {
   describe('breadcrumb tests', () => {
     it('should check breadcrumb on users tab of user management page', async () => {
       await userManagement.navigateTo('users');
-      expect(await userManagement.getBreadcrumbText()).toEqual('Users');
+      await expect(userManagement.getBreadcrumbText()).toEqual('Users');
     });
 
     it('should check breadcrumb on roles tab of user management page', async () => {
       await userManagement.navigateTo('roles');
-      expect(await userManagement.getBreadcrumbText()).toEqual('Roles');
+      await expect(userManagement.getBreadcrumbText()).toEqual('Roles');
     });
 
     it('should check breadcrumb on user creation page', async () => {
       await userManagement.navigateTo('userCreate');
-      expect(await userManagement.getBreadcrumbText()).toEqual('Create');
+      await expect(userManagement.getBreadcrumbText()).toEqual('Create');
     });
 
     it('should check breadcrumb on role creation page', async () => {
       await userManagement.navigateTo('roleCreate');
-      expect(await userManagement.getBreadcrumbText()).toEqual('Create');
+      await expect(userManagement.getBreadcrumbText()).toEqual('Create');
     });
   });