From: Rafael Quintero Date: Thu, 1 Aug 2019 12:57:01 +0000 (-0400) Subject: mgr/dashboard: Verify fields on OSDs page X-Git-Tag: v15.1.0~1288^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad8de6b5202f282fcbe8ac1ddf4695d972f915c0;p=ceph.git mgr/dashboard: Verify fields on OSDs page Fixes: https://tracker.ceph.com/issues/41041 Signed-off-by: Adam King Signed-off-by: Rafael Quintero --- 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 2f3a79aa0c4b..cbccc435a477 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 @@ -1,3 +1,4 @@ +import { by, element } from 'protractor'; import { OSDsPageHelper } from './osds.po'; describe('OSDs page', () => { @@ -32,4 +33,40 @@ describe('OSDs page', () => { await expect(osds.getTabText(1)).toEqual('Overall Performance'); }); }); + + describe('check existence of fields on OSD page', () => { + it('should check that number of rows and count in footer match', async () => { + await osds.navigateTo(); + await expect(osds.getTableTotalCount()).toEqual(osds.getTableRows().count()); + }); + + it('should verify that selected footer increases when an entry is clicked', async () => { + await osds.navigateTo(); + await osds.getFirstCell().click(); // clicks first osd + await expect(osds.getTableSelectedCount()).toEqual(1); + }); + + it('should verify that buttons exist', async () => { + await osds.navigateTo(); + await expect(element(by.cssContainingText('button', 'Scrub')).isPresent()).toBe(true); + await expect( + element(by.cssContainingText('button', 'Cluster-wide configuration')).isPresent() + ).toBe(true); + }); + + it('should check the number of tabs when selecting an osd is correct', async () => { + await osds.navigateTo(); + await osds.getFirstCell().click(); // clicks first osd + await expect(osds.getTabsCount()).toEqual(8); // includes tabs at the top of the page + }); + + it('should show the correct text for the tab labels', async () => { + await expect(osds.getTabText(2)).toEqual('Attributes (OSD map)'); + await expect(osds.getTabText(3)).toEqual('Metadata'); + await expect(osds.getTabText(4)).toEqual('Device health'); + await expect(osds.getTabText(5)).toEqual('Performance counter'); + await expect(osds.getTabText(6)).toEqual('Histogram'); + await expect(osds.getTabText(7)).toEqual('Performance Details'); + }); + }); }); 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 392e2c52511e..c19aefaaa8b1 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts @@ -285,4 +285,8 @@ export abstract class PageHelper { // Waits for item to be removed from table return this.waitStaleness(this.getFirstTableCellWithText(name)); } + + getTableRows() { + return $$('datatable-row-wrapper'); + } }