Skip to content

Commit

Permalink
mgr/dashboard: migrate E2E Helper to async/await
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/40693

Signed-off-by: Patrick Seidensal <[email protected]>
  • Loading branch information
p-se committed Aug 28, 2019
1 parent d0ad4df commit f1955d6
Showing 1 changed file with 11 additions and 51 deletions.
62 changes: 11 additions & 51 deletions src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
import { browser } from 'protractor';
import { ImagesPageHelper } from './block/images.po';
import { IscsiPageHelper } from './block/iscsi.po';
import { MirroringPageHelper } from './block/mirroring.po';
import { AlertsPageHelper } from './cluster/alerts.po';
import { ConfigurationPageHelper } from './cluster/configuration.po';
import { CrushMapPageHelper } from './cluster/crush-map.po';
import { HostsPageHelper } from './cluster/hosts.po';
import { LogsPageHelper } from './cluster/logs.po';
import { ManagerModulesPageHelper } from './cluster/mgr-modules.po';
import { MonitorsPageHelper } from './cluster/monitors.po';
import { OSDsPageHelper } from './cluster/osds.po';
import { DashboardPageHelper } from './dashboard.po';
import { FilesystemsPageHelper } from './filesystems/filesystems.po';
import { NfsPageHelper } from './nfs/nfs.po';
import { PoolPageHelper } from './pools/pools.po';
import { BucketsPageHelper } from './rgw/buckets.po';
import { DaemonsPageHelper } from './rgw/daemons.po';
Expand All @@ -23,41 +10,17 @@ export class Helper {
static EC = browser.ExpectedConditions;
static TIMEOUT = 10000;

buckets: BucketsPageHelper;
daemons: DaemonsPageHelper;
users: UsersPageHelper;
pools: PoolPageHelper;
nfs: NfsPageHelper;
filesystems: FilesystemsPageHelper;
alerts: AlertsPageHelper;
configuration: ConfigurationPageHelper;
crushmap: CrushMapPageHelper;
hosts: HostsPageHelper;
logs: LogsPageHelper;
mgrmodules: ManagerModulesPageHelper;
monitors: MonitorsPageHelper;
osds: OSDsPageHelper;
buckets: BucketsPageHelper;
images: ImagesPageHelper;
iscsi: IscsiPageHelper;
mirroring: MirroringPageHelper;
dashboard: DashboardPageHelper;
usermgmt: UserMgmtPageHelper;

constructor() {
this.buckets = new BucketsPageHelper();
this.daemons = new DaemonsPageHelper();
this.users = new UsersPageHelper();
this.pools = new PoolPageHelper();
this.nfs = new NfsPageHelper();
this.filesystems = new FilesystemsPageHelper();
this.alerts = new AlertsPageHelper();
this.configuration = new ConfigurationPageHelper();
this.crushmap = new CrushMapPageHelper();
this.hosts = new HostsPageHelper();
this.logs = new LogsPageHelper();
this.mgrmodules = new ManagerModulesPageHelper();
this.monitors = new MonitorsPageHelper();
this.osds = new OSDsPageHelper();
this.buckets = new BucketsPageHelper();
this.images = new ImagesPageHelper();
this.iscsi = new IscsiPageHelper();
this.mirroring = new MirroringPageHelper();
Expand All @@ -71,21 +34,18 @@ export class Helper {
* @static
* @memberof Helper
*/
static checkConsole() {
browser
static async checkConsole() {
let browserLog = await browser
.manage()
.logs()
.get('browser')
.then(function(browserLog) {
browserLog = browserLog.filter((log) => {
return log.level.value > 900; // SEVERE level
});
.get('browser');

browserLog = browserLog.filter((log) => log.level.value > 900);

if (browserLog.length > 0) {
console.log('\n log: ' + require('util').inspect(browserLog));
}
if (browserLog.length > 0) {
console.log('\n log: ' + require('util').inspect(browserLog));
}

expect(browserLog.length).toEqual(0);
});
expect(browserLog.length).toEqual(0);
}
}

0 comments on commit f1955d6

Please sign in to comment.