Skip to content

Commit

Permalink
mgr/dashboard: refactoring Helper class to remove PageHelper instances
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Seidensal <[email protected]>
  • Loading branch information
p-se committed Aug 28, 2019
1 parent 74cc1f8 commit ac901bf
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ describe('Images page', () => {
let images: ImagesPageHelper;

beforeAll(() => {
images = new Helper().images;
pools = new Helper().pools;
images = new ImagesPageHelper();
pools = new PoolPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Iscsi Page', () => {
let iscsi: IscsiPageHelper;

beforeAll(() => {
iscsi = new Helper().iscsi;
iscsi = new IscsiPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ describe('Mirroring page', () => {
let mirroring: MirroringPageHelper;

beforeAll(() => {
mirroring = new Helper().mirroring;
pools = new Helper().pools;
mirroring = new MirroringPageHelper();
pools = new PoolPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Alerts page', () => {
let alerts: AlertsPageHelper;

beforeAll(() => {
alerts = new Helper().alerts;
alerts = new AlertsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Configuration page', () => {
let configuration: ConfigurationPageHelper;

beforeAll(() => {
configuration = new Helper().configuration;
configuration = new ConfigurationPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('CRUSH map page', () => {
let crushmap: CrushMapPageHelper;

beforeAll(() => {
crushmap = new Helper().crushMap;
crushmap = new CrushMapPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Hosts page', () => {
let hosts: HostsPageHelper;

beforeAll(() => {
hosts = new Helper().hosts;
hosts = new HostsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ describe('Logs page', () => {
const minute = today.getMinutes();

beforeAll(() => {
logs = new Helper().logs;
pools = new Helper().pools;
configuration = new Helper().configuration;
logs = new LogsPageHelper();
pools = new PoolPageHelper();
configuration = new ConfigurationPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Manager modules page', () => {
let mgrmodules: ManagerModulesPageHelper;

beforeAll(() => {
mgrmodules = new Helper().mgrModules;
mgrmodules = new ManagerModulesPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Monitors page', () => {
let monitors: MonitorsPageHelper;

beforeAll(() => {
monitors = new Helper().monitors;
monitors = new MonitorsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('OSDs page', () => {
let osds: OSDsPageHelper;

beforeAll(() => {
osds = new Helper().osds;
osds = new OSDsPageHelper();
});

afterEach(async () => {
Expand Down
15 changes: 7 additions & 8 deletions src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ describe('Dashboard Main Page', () => {
let iscsi: IscsiPageHelper;

beforeAll(() => {
const h = new Helper();
dashboard = h.dashboard;
daemons = h.daemons;
hosts = h.hosts;
osds = h.osds;
pools = h.pools;
monitors = h.monitors;
iscsi = h.iscsi;
dashboard = new DashboardPageHelper();
daemons = new DaemonsPageHelper();
hosts = new HostsPageHelper();
osds = new OSDsPageHelper();
pools = new PoolPageHelper();
monitors = new MonitorsPageHelper();
iscsi = new IscsiPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Filesystems page', () => {
let filesystems: FilesystemsPageHelper;

beforeAll(() => {
filesystems = new Helper().filesystems;
filesystems = new FilesystemsPageHelper();
});

afterEach(async () => {
Expand Down
3 changes: 0 additions & 3 deletions src/pybind/mgr/dashboard/frontend/e2e/helper.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class Helper {
pools: PoolPageHelper;
buckets: BucketsPageHelper;
images: ImagesPageHelper;
iscsi: IscsiPageHelper;
mirroring: MirroringPageHelper;
dashboard: DashboardPageHelper;
usermgmt: UserMgmtPageHelper;
Expand All @@ -42,9 +41,7 @@ export class Helper {
crushMap: CrushMapPageHelper;
configuration: ConfigurationPageHelper;
alerts: AlertsPageHelper;
mirroring: MirroringPageHelper;
iscsi: IscsiPageHelper;
dashboard: DashboardPageHelper;

constructor() {
this.pools = new PoolPageHelper();
Expand Down
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Nfs page', () => {
let nfs: NfsPageHelper;

beforeAll(() => {
nfs = new Helper().nfs;
nfs = new NfsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Pools page', () => {
const poolName = 'pool_e2e_pool_test';

beforeAll(async () => {
pools = new Helper().pools;
pools = new PoolPageHelper();
await pools.navigateTo();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ describe('RGW buckets page', () => {
let buckets: BucketsPageHelper;

beforeAll(async () => {
const helper = new Helper();
buckets = helper.buckets;
buckets = new BucketsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('RGW daemons page', () => {
let daemons: DaemonsPageHelper;

beforeAll(() => {
daemons = new Helper().daemons;
daemons = new DaemonsPageHelper();
});

afterEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('RGW users page', () => {
const user_name = '000user_create_edit_delete';

beforeAll(() => {
users = new Helper().users;
users = new UsersPageHelper();
});

afterEach(async () => {
Expand Down

0 comments on commit ac901bf

Please sign in to comment.