]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Verify fields on Crush map page
authorRafael Quintero <rafaelq@bu.edu>
Thu, 1 Aug 2019 18:47:29 +0000 (14:47 -0400)
committerRafael Quintero <rafaelq@bu.edu>
Thu, 1 Aug 2019 18:47:29 +0000 (14:47 -0400)
Fixes: https://tracker.ceph.com/issues/41050
Signed-off-by: Adam King <adking@redhat.com>
Signed-off-by: Rafael Quintero <rquinter@redhat.com>
src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.po.ts

index d58fa9bc6b31f01101a45b4b93aa2b3c82a73e57..0828e52c0ec2729d026f38b8207c2522aa12eafb 100644 (file)
@@ -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);
+      });
+    });
+  });
 });
index b1b3e8f4fc9fec9cbb01cd21c87cba88c043c733..6e447e15db00399de9f3e9322e46e25c2010bb69 100644 (file)
@@ -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);
+  }
 }