From 0d12b96be924ae888fcb510cf7b8bf318269782f Mon Sep 17 00:00:00 2001 From: Rafael Quintero Date: Thu, 1 Aug 2019 14:47:29 -0400 Subject: [PATCH] mgr/dashboard: Verify fields on Crush map page Fixes: https://tracker.ceph.com/issues/41050 Signed-off-by: Adam King Signed-off-by: Rafael Quintero --- .../e2e/cluster/crush-map.e2e-spec.ts | 21 +++++++++++++++++++ .../frontend/e2e/cluster/crush-map.po.ts | 9 ++++++++ 2 files changed, 30 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts index d58fa9bc6b3..0828e52c0ec 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts @@ -1,3 +1,4 @@ +import { $, browser } from 'protractor'; import { Helper } from '../helper.po'; describe('CRUSH map page', () => { @@ -20,4 +21,24 @@ describe('CRUSH map page', () => { expect(crushmap.getBreadcrumbText()).toEqual('CRUSH map'); }); }); + describe('fields check', () => { + beforeAll(() => { + crushmap.navigateTo(); + }); + + it('should check that title & table appears', () => { + // Check that title (CRUSH map viewer) appears + expect(crushmap.getPageTitle()).toMatch('CRUSH map viewer'); + + // Check that title appears once OSD is clicked + crushmap.getCrushNode(1).click(); + const label = $('legend').getText(); // Get table label + expect(crushmap.getCrushNode(1).getText()).toEqual(label); + + // Check that table appears once OSD is clicked + browser.wait(Helper.EC.visibilityOf($('.datatable-body'))).then(() => { + expect($('.datatable-body').isDisplayed()).toBe(true); + }); + }); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.po.ts index b1b3e8f4fc9..6e447e15db0 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.po.ts @@ -1,5 +1,14 @@ +import { $, $$ } from 'protractor'; import { PageHelper } from '../page-helper.po'; export class CrushMapPageHelper extends PageHelper { pages = { index: '/#/crush-map' }; + + getPageTitle() { + return $('.card-header').getText(); + } + + getCrushNode(idx) { + return $$('.node-name.ng-star-inserted').get(idx); + } } -- 2.39.5