Skip to content

Commit

Permalink
Merge pull request ceph#29070 from adk3798/reformat
Browse files Browse the repository at this point in the history
mgr/dashboard: Update formatting of e2e test files

Reviewed-by: Tiago Melo <[email protected]>
  • Loading branch information
ricardoasmarques authored Jul 23, 2019
2 parents d0855cf + f9a40eb commit 8f46c4c
Show file tree
Hide file tree
Showing 36 changed files with 222 additions and 197 deletions.
17 changes: 8 additions & 9 deletions src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { ImagesPage } from './images.po';

describe('Images page', () => {
let page: ImagesPage;
let images;

beforeAll(() => {
page = new ImagesPage();
images = new Helper().images;
});

afterEach(() => {
Expand All @@ -14,21 +13,21 @@ describe('Images page', () => {

describe('breadcrumb and tab tests', () => {
beforeAll(() => {
page.navigateTo();
images.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(ImagesPage.getBreadcrumbText()).toEqual('Images');
expect(images.getBreadcrumbText()).toEqual('Images');
});

it('should show three tabs', () => {
expect(ImagesPage.getTabsCount()).toEqual(3);
expect(images.getTabsCount()).toEqual(3);
});

it('should show text for all tabs', () => {
expect(ImagesPage.getTabText(0)).toEqual('Images');
expect(ImagesPage.getTabText(1)).toEqual('Trash');
expect(ImagesPage.getTabText(2)).toEqual('Overall Performance');
expect(images.getTabText(0)).toEqual('Images');
expect(images.getTabText(1)).toEqual('Trash');
expect(images.getTabText(2)).toEqual('Overall Performance');
});
});
});
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/block/images.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class ImagesPage extends PageHelper {
export class ImagesPageHelper extends PageHelper {
pages = { index: '/#/block/rbd' };
}
9 changes: 4 additions & 5 deletions src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { IscsiPage } from './iscsi.po';

describe('Iscsi Page', () => {
let page: IscsiPage;
let iscsi;

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

afterEach(() => {
Expand All @@ -14,11 +13,11 @@ describe('Iscsi Page', () => {

describe('breadcrumb test', () => {
beforeAll(() => {
page.navigateTo();
iscsi.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(IscsiPage.getBreadcrumbText()).toEqual('Overview');
expect(iscsi.getBreadcrumbText()).toEqual('Overview');
});
});
});
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class IscsiPage extends PageHelper {
export class IscsiPageHelper extends PageHelper {
pages = { index: '/#/block/iscsi/overview' };
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { MirroringPage } from './mirroring.po';

describe('Mirroring page', () => {
let page: MirroringPage;
let mirroring;

beforeAll(() => {
page = new MirroringPage();
mirroring = new Helper().mirroring;
});

afterEach(() => {
Expand All @@ -14,21 +13,21 @@ describe('Mirroring page', () => {

describe('breadcrumb and tab tests', () => {
beforeAll(() => {
page.navigateTo();
mirroring.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(MirroringPage.getBreadcrumbText()).toEqual('Mirroring');
expect(mirroring.getBreadcrumbText()).toEqual('Mirroring');
});

it('should show three tabs', () => {
expect(MirroringPage.getTabsCount()).toEqual(3);
expect(mirroring.getTabsCount()).toEqual(3);
});

it('should show text for all tabs', () => {
expect(MirroringPage.getTabText(0)).toEqual('Issues');
expect(MirroringPage.getTabText(1)).toEqual('Syncing');
expect(MirroringPage.getTabText(2)).toEqual('Ready');
expect(mirroring.getTabText(0)).toEqual('Issues');
expect(mirroring.getTabText(1)).toEqual('Syncing');
expect(mirroring.getTabText(2)).toEqual('Ready');
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class MirroringPage extends PageHelper {
export class MirroringPageHelper extends PageHelper {
pages = { index: '/#/block/mirroring' };
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { AlertsPage } from './alerts.po';

describe('Alerts page', () => {
let page: AlertsPage;
let alerts;

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

afterEach(() => {
Expand All @@ -14,11 +13,11 @@ describe('Alerts page', () => {

describe('breadcrumb test', () => {
beforeAll(() => {
page.navigateTo();
alerts.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(AlertsPage.getBreadcrumbText()).toEqual('Alerts');
expect(alerts.getBreadcrumbText()).toEqual('Alerts');
});
});
});
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class AlertsPage extends PageHelper {
export class AlertsPageHelper extends PageHelper {
pages = { index: '/#/alerts' };
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { ConfigurationPage } from './configuration.po';

describe('Configuration page', () => {
let page: ConfigurationPage;
let configuration;

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

afterEach(() => {
Expand All @@ -14,11 +13,11 @@ describe('Configuration page', () => {

describe('breadcrumb test', () => {
beforeAll(() => {
page.navigateTo();
configuration.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(ConfigurationPage.getBreadcrumbText()).toEqual('Configuration');
expect(configuration.getBreadcrumbText()).toEqual('Configuration');
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class ConfigurationPage extends PageHelper {
export class ConfigurationPageHelper extends PageHelper {
pages = { index: '/#/configuration' };
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { CrushMapPage } from './crush-map.po';

describe('CRUSH map page', () => {
let page: CrushMapPage;
let crushmap;

beforeAll(() => {
page = new CrushMapPage();
crushmap = new Helper().crushmap;
});

afterEach(() => {
Expand All @@ -14,11 +13,11 @@ describe('CRUSH map page', () => {

describe('breadcrumb test', () => {
beforeAll(() => {
page.navigateTo();
crushmap.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(CrushMapPage.getBreadcrumbText()).toEqual('CRUSH map');
expect(crushmap.getBreadcrumbText()).toEqual('CRUSH map');
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class CrushMapPage extends PageHelper {
export class CrushMapPageHelper extends PageHelper {
pages = { index: '/#/crush-map' };
}
15 changes: 7 additions & 8 deletions src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { HostsPage } from './hosts.po';

describe('Hosts page', () => {
let page: HostsPage;
let hosts;

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

afterEach(() => {
Expand All @@ -14,23 +13,23 @@ describe('Hosts page', () => {

describe('breadcrumb and tab tests', () => {
beforeAll(() => {
page.navigateTo();
hosts.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(HostsPage.getBreadcrumbText()).toEqual('Hosts');
expect(hosts.getBreadcrumbText()).toEqual('Hosts');
});

it('should show two tabs', () => {
expect(HostsPage.getTabsCount()).toEqual(2);
expect(hosts.getTabsCount()).toEqual(2);
});

it('should show hosts list tab at first', () => {
expect(HostsPage.getTabText(0)).toEqual('Hosts List');
expect(hosts.getTabText(0)).toEqual('Hosts List');
});

it('should show overall performance as a second tab', () => {
expect(HostsPage.getTabText(1)).toEqual('Overall Performance');
expect(hosts.getTabText(1)).toEqual('Overall Performance');
});
});
});
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class HostsPage extends PageHelper {
export class HostsPageHelper extends PageHelper {
pages = { index: '/#/hosts' };
}
15 changes: 7 additions & 8 deletions src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { LogsPage } from './logs.po';

describe('Logs page', () => {
let page: LogsPage;
let logs;

beforeAll(() => {
page = new LogsPage();
logs = new Helper().logs;
});

afterEach(() => {
Expand All @@ -14,23 +13,23 @@ describe('Logs page', () => {

describe('breadcrumb and tab tests', () => {
beforeAll(() => {
page.navigateTo();
logs.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(LogsPage.getBreadcrumbText()).toEqual('Logs');
expect(logs.getBreadcrumbText()).toEqual('Logs');
});

it('should show two tabs', () => {
expect(LogsPage.getTabsCount()).toEqual(2);
expect(logs.getTabsCount()).toEqual(2);
});

it('should show cluster logs tab at first', () => {
expect(LogsPage.getTabText(0)).toEqual('Cluster Logs');
expect(logs.getTabText(0)).toEqual('Cluster Logs');
});

it('should show audit logs as a second tab', () => {
expect(LogsPage.getTabText(1)).toEqual('Audit Logs');
expect(logs.getTabText(1)).toEqual('Audit Logs');
});
});
});
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { PageHelper } from '../page-helper.po';

browser.ignoreSynchronization = true;

export class LogsPage extends PageHelper {
export class LogsPageHelper extends PageHelper {
pages = { index: '/#/logs' };
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Helper } from '../helper.po';
import { ManagerModulesPage } from './mgr-modules.po';

describe('Manager modules page', () => {
let page: ManagerModulesPage;
let mgrmodules;

beforeAll(() => {
page = new ManagerModulesPage();
mgrmodules = new Helper().mgrmodules;
});

afterEach(() => {
Expand All @@ -14,11 +13,11 @@ describe('Manager modules page', () => {

describe('breadcrumb test', () => {
beforeAll(() => {
page.navigateTo();
mgrmodules.navigateTo();
});

it('should open and show breadcrumb', () => {
expect(ManagerModulesPage.getBreadcrumbText()).toEqual('Manager modules');
expect(mgrmodules.getBreadcrumbText()).toEqual('Manager modules');
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageHelper } from '../page-helper.po';

export class ManagerModulesPage extends PageHelper {
export class ManagerModulesPageHelper extends PageHelper {
pages = { index: '/#/mgr-modules' };
}
Loading

0 comments on commit 8f46c4c

Please sign in to comment.