From 225e3473bf4c681d725c7959d1b260b50ef15048 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 2 Aug 2019 14:53:31 -0400 Subject: [PATCH] mgr/dashboard: Daemons Page Tables Test Selects first daemon from list and checks details table is displayed Clicks performance counters tab and checks performance counters table is displayed Fixes: https://tracker.ceph.com/issues/41063 Signed-off-by: Adam King Signed-off-by: Rafael Quintero --- .../frontend/e2e/rgw/daemons.e2e-spec.ts | 10 ++++++ .../dashboard/frontend/e2e/rgw/daemons.po.ts | 36 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts index b8e00e41c926..b2c4c5eed483 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts @@ -32,4 +32,14 @@ describe('RGW daemons page', () => { expect(daemons.getTabText(1)).toEqual('Overall Performance'); }); }); + + describe('details and performance counters table tests', () => { + beforeAll(() => { + daemons.navigateTo(); + }); + + it('should check that details/performance tables are visible when daemon is selected', () => { + daemons.checkTables(); + }); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts index fa44c0875c8a..65f4c863ca8c 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts @@ -1,5 +1,41 @@ +import { $$, by, element } from 'protractor'; import { PageHelper } from '../page-helper.po'; export class DaemonsPageHelper extends PageHelper { pages = { index: '/#/rgw/daemon' }; + + checkTables() { + this.navigateTo(); + + // click on a daemon so details table appears + $$('.datatable-body-cell-label') + .first() + .click(); + + const tab_container = $$('.tab-container').last(); + const details_table = tab_container.all(by.css('cd-table')).get(0); + const performance_counters_table = tab_container.all(by.css('cd-table')).get(1); + + // check details table is visible + expect(details_table.isDisplayed()).toBe(true); + // check at least one field is present + expect(details_table.getText()).toMatch('ceph_version'); + // check performance counters table is not currently visible + expect(performance_counters_table.isDisplayed()).toBe(false); + + // click on performance counters tab and check table is loaded + element(by.cssContainingText('.nav-link', 'Performance Counters')).click(); + expect(performance_counters_table.isDisplayed()).toBe(true); + // check at least one field is present + expect(performance_counters_table.getText()).toMatch('objecter.op_r'); + // check details table is not currently visible + expect(details_table.isDisplayed()).toBe(false); + + // click on performance details tab + element(by.cssContainingText('.nav-link', 'Performance Details')).click(); + // checks the other tabs' content isn't visible + expect(details_table.isDisplayed()).toBe(false); + expect(performance_counters_table.isDisplayed()).toBe(false); + // TODO: Expect Grafana iFrame + } } -- 2.47.3