From: Rafael Quintero Date: Thu, 1 Aug 2019 14:49:53 +0000 (-0400) Subject: mgr/dashboard: Verify fields on Monitors page X-Git-Tag: v15.1.0~1940^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fcdce3589d380937e2e480d11dcae06793daf136;p=ceph-ci.git mgr/dashboard: Verify fields on Monitors page Fixes: https://tracker.ceph.com/issues/41048 Signed-off-by: Adam King Signed-off-by: Rafael Quintero --- 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 9c7f9635f5d..e9b47bd16ab 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 @@ -20,4 +20,96 @@ describe('Monitors page', () => { expect(monitors.getBreadcrumbText()).toEqual('Monitors'); }); }); + + describe('fields check', () => { + beforeAll(() => { + monitors.navigateTo(); + }); + + it('should check status table is present', () => { + // check for table header 'Status' + expect( + monitors + .getLegends() + .get(0) + .getText() + ).toMatch('Status'); + + // check for fields in table + expect(monitors.getStatusTable().getText()).toMatch('Cluster ID'); + expect(monitors.getStatusTable().getText()).toMatch('monmap modified'); + expect(monitors.getStatusTable().getText()).toMatch('monmap epoch'); + expect(monitors.getStatusTable().getText()).toMatch('quorum con'); + expect(monitors.getStatusTable().getText()).toMatch('quorum mon'); + expect(monitors.getStatusTable().getText()).toMatch('required con'); + expect(monitors.getStatusTable().getText()).toMatch('required mon'); + }); + + it('should check In Quorum and Not In Quorum tables are present', () => { + // check for there to be two tables + expect(monitors.getDataTable().count()).toEqual(2); + + // check for table header 'In Quorum' + expect( + monitors + .getLegends() + .get(1) + .getText() + ).toMatch('In Quorum'); + + // check for table header 'Not In Quorum' + expect( + monitors + .getLegends() + .get(2) + .getText() + ).toMatch('Not In Quorum'); + + // verify correct columns on In Quorum table + expect( + monitors + .getDataTableHeaders() + .get(0) + .getText() + ).toMatch('Name'); + expect( + monitors + .getDataTableHeaders() + .get(0) + .getText() + ).toMatch('Rank'); + expect( + monitors + .getDataTableHeaders() + .get(0) + .getText() + ).toMatch('Public Address'); + expect( + monitors + .getDataTableHeaders() + .get(0) + .getText() + ).toMatch('Open Sessions'); + + // verify correct columns on Not In Quorum table + expect( + monitors + .getDataTableHeaders() + .get(1) + .getText() + ).toMatch('Name'); + expect( + monitors + .getDataTableHeaders() + .get(1) + .getText() + ).toMatch('Rank'); + expect( + monitors + .getDataTableHeaders() + .get(1) + .getText() + ).toMatch('Public Address'); + }); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts index 37dbc9668cd..8f2207ee3f5 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts @@ -121,4 +121,23 @@ export abstract class PageHelper { const url = this.pages[page]; return browser.get(url); } + + getDataTable() { + return $$('cd-table'); + } + + getStatusTable() { + // Grabs striped tables + return $$('.table.table-striped'); + } + + getLegends() { + // Grabs legends above tables + return $$('legend'); + } + + getDataTableHeaders() { + // Gets column headers of table + return $$('.datatable-header'); + } }