]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Daemons Page Tables Test 29469/head
authorAdam King <kingamk3@gmail.com>
Fri, 2 Aug 2019 18:53:31 +0000 (14:53 -0400)
committerAdam King <kingamk3@gmail.com>
Tue, 13 Aug 2019 12:49:02 +0000 (08:49 -0400)
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 <adking@redhat.com>
Signed-off-by: Rafael Quintero <rquinter@redhat.com>
src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.po.ts

index b8e00e41c92655d2f0b2de83a5c98bf88642ec3c..b2c4c5eed4833839ca3bf26e78cf66a7ce459e76 100644 (file)
@@ -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();
+    });
+  });
 });
index fa44c0875c8a412e4fd03ebf0c439bae7f0bfce2..65f4c863ca8cb9513ea22d3cf3e999768067b2b0 100644 (file)
@@ -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
+  }
 }