From 0a70094535d90365e9d85fbb9f89b999e96cd2b0 Mon Sep 17 00:00:00 2001 From: Patrick Seidensal Date: Tue, 27 Aug 2019 14:53:41 +0200 Subject: [PATCH] mgr/dashboard: prepend await before expect statements are used Signed-off-by: Patrick Seidensal --- .../frontend/e2e/block/images.e2e-spec.ts | 16 ++--- .../dashboard/frontend/e2e/block/images.po.ts | 6 +- .../frontend/e2e/block/iscsi.e2e-spec.ts | 10 ++-- .../frontend/e2e/block/mirroring.e2e-spec.ts | 16 ++--- .../frontend/e2e/cluster/alerts.e2e-spec.ts | 2 +- .../e2e/cluster/configuration.e2e-spec.ts | 2 +- .../frontend/e2e/cluster/configuration.po.ts | 2 +- .../e2e/cluster/crush-map.e2e-spec.ts | 8 +-- .../frontend/e2e/cluster/hosts.e2e-spec.ts | 8 +-- .../frontend/e2e/cluster/hosts.po.ts | 10 ++-- .../frontend/e2e/cluster/logs.e2e-spec.ts | 8 +-- .../dashboard/frontend/e2e/cluster/logs.po.ts | 8 +-- .../e2e/cluster/mgr-modules.e2e-spec.ts | 2 +- .../frontend/e2e/cluster/monitors.e2e-spec.ts | 58 +++++++++---------- .../frontend/e2e/cluster/osds.e2e-spec.ts | 8 +-- .../frontend/e2e/dashboard.e2e-spec.ts | 16 ++--- .../e2e/filesystems/filesystems.e2e-spec.ts | 2 +- .../mgr/dashboard/frontend/e2e/helper.po.ts | 2 +- .../frontend/e2e/nfs/nfs.e2e-spec.ts | 2 +- .../frontend/e2e/pools/pools.e2e-spec.ts | 8 +-- .../dashboard/frontend/e2e/pools/pools.po.ts | 4 +- .../frontend/e2e/rgw/buckets.e2e-spec.ts | 8 +-- .../dashboard/frontend/e2e/rgw/buckets.po.ts | 32 +++++----- .../frontend/e2e/rgw/daemons.e2e-spec.ts | 10 ++-- .../dashboard/frontend/e2e/rgw/daemons.po.ts | 16 ++--- .../frontend/e2e/rgw/users.e2e-spec.ts | 6 +- .../dashboard/frontend/e2e/rgw/users.po.ts | 46 +++++++-------- .../frontend/e2e/user-mgmt.e2e-spec.ts | 8 +-- 28 files changed, 162 insertions(+), 162 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts index f046966451a..724a8963d35 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts @@ -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 () => { 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 b63fc929821..97b4ab139d4 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts @@ -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() diff --git a/src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts index a061341e679..22ffb926140 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts @@ -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'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts index 8cbc45061fb..0e59625365f 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts @@ -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 () => { diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts index d20a3f4f3e6..a45c8a15f73 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts @@ -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'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts index e25ea4ac460..527704c771b 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts @@ -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', () => { diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts index 0091e9be8d8..c489d9e9c26 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts @@ -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 diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts index 4df82e1d342..2ecfcd4c69a 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts @@ -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); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts index 9619c7878b5..9d3aa031cef 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts @@ -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'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts index 81037c279c7..bbc71207f74 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts @@ -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'); } } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts index 72aa8c895f0..d1b2dc81d78 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts @@ -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'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts index e478d0fff9b..2451e0dd20a 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts @@ -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); } } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts index 0a238d4e076..0790b127dfc 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts @@ -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'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts index f86fae2a613..d2f27793dba 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts @@ -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() diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts index 55c482a35ef..5ff7dd35d7e 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts @@ -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'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts index 711be73a0dd..ba302347765 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts @@ -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}` diff --git a/src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts index efbf9222ddb..344afcd3245 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts @@ -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'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts index 64e0cd1c3c8..aac6416e81a 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts @@ -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); } } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts index f53e30ff86d..d51aeaef7cf 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts @@ -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'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts index 1ec08b2865a..b747adf2295 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts @@ -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'); }); }); 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 95b437eff5a..cf9e94c073a 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts @@ -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`; diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.e2e-spec.ts index 1631b645f90..3930ea50756 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.e2e-spec.ts @@ -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', () => { diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts index e86ad1b2aa4..8db2b4fd409 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts @@ -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'); } } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts index ba8a2b46466..24b982d7cc7 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts @@ -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'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts index 6000b667a4b..c1cb9d7b3b5 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts @@ -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 } } diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts index bf6cf71726e..c36f16fb821 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts @@ -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); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts index a91e0679aea..96734b00740 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts @@ -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.' ); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts index bac2068de9f..3f72e3ce673 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts @@ -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'); }); }); -- 2.39.5