]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Verify fields on Monitors page
authorRafael Quintero <rafaelq@bu.edu>
Thu, 1 Aug 2019 14:49:53 +0000 (10:49 -0400)
committerRafael Quintero <rafaelq@bu.edu>
Fri, 2 Aug 2019 11:19:40 +0000 (07:19 -0400)
Fixes: https://tracker.ceph.com/issues/41048
Signed-off-by: Adam King <adking@redhat.com>
Signed-off-by: Rafael Quintero <rquinter@redhat.com>
src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts

index 9c7f9635f5d4fa9057be12357e609545e598bc57..e9b47bd16aba3bde9ee904d126e116d61a140891 100644 (file)
@@ -20,4 +20,96 @@ describe('Monitors page', () => {
       expect(monitors.getBreadcrumbText()).toEqual('Monitors');
     });
   });
+
+  describe('fields check', () => {
+    beforeAll(() => {
+      monitors.navigateTo();
+    });
+
+    it('should check status table is present', () => {
+      // check for table header 'Status'
+      expect(
+        monitors
+          .getLegends()
+          .get(0)
+          .getText()
+      ).toMatch('Status');
+
+      // check for fields in table
+      expect(monitors.getStatusTable().getText()).toMatch('Cluster ID');
+      expect(monitors.getStatusTable().getText()).toMatch('monmap modified');
+      expect(monitors.getStatusTable().getText()).toMatch('monmap epoch');
+      expect(monitors.getStatusTable().getText()).toMatch('quorum con');
+      expect(monitors.getStatusTable().getText()).toMatch('quorum mon');
+      expect(monitors.getStatusTable().getText()).toMatch('required con');
+      expect(monitors.getStatusTable().getText()).toMatch('required mon');
+    });
+
+    it('should check In Quorum and Not In Quorum tables are present', () => {
+      // check for there to be two tables
+      expect(monitors.getDataTable().count()).toEqual(2);
+
+      // check for table header 'In Quorum'
+      expect(
+        monitors
+          .getLegends()
+          .get(1)
+          .getText()
+      ).toMatch('In Quorum');
+
+      // check for table header 'Not In Quorum'
+      expect(
+        monitors
+          .getLegends()
+          .get(2)
+          .getText()
+      ).toMatch('Not In Quorum');
+
+      // verify correct columns on In Quorum table
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(0)
+          .getText()
+      ).toMatch('Name');
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(0)
+          .getText()
+      ).toMatch('Rank');
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(0)
+          .getText()
+      ).toMatch('Public Address');
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(0)
+          .getText()
+      ).toMatch('Open Sessions');
+
+      // verify correct columns on Not In Quorum table
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(1)
+          .getText()
+      ).toMatch('Name');
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(1)
+          .getText()
+      ).toMatch('Rank');
+      expect(
+        monitors
+          .getDataTableHeaders()
+          .get(1)
+          .getText()
+      ).toMatch('Public Address');
+    });
+  });
 });
index 37dbc9668cd113970a13dd58d77e282e6aafbdda..8f2207ee3f5a4655700646154d74460dbe4b90cb 100644 (file)
@@ -121,4 +121,23 @@ export abstract class PageHelper {
     const url = this.pages[page];
     return browser.get(url);
   }
+
+  getDataTable() {
+    return $$('cd-table');
+  }
+
+  getStatusTable() {
+    // Grabs striped tables
+    return $$('.table.table-striped');
+  }
+
+  getLegends() {
+    // Grabs legends above tables
+    return $$('legend');
+  }
+
+  getDataTableHeaders() {
+    // Gets column headers of table
+    return $$('.datatable-header');
+  }
 }