]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Verify fields on OSDs page 29447/head
authorRafael Quintero <rafaelq@bu.edu>
Thu, 1 Aug 2019 12:57:01 +0000 (08:57 -0400)
committerAdam King <kingamk3@gmail.com>
Fri, 27 Sep 2019 14:22:38 +0000 (10:22 -0400)
Fixes: https://tracker.ceph.com/issues/41041
Signed-off-by: Adam King <adking@redhat.com>
Signed-off-by: Rafael Quintero <rquinter@redhat.com>
src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts

index 2f3a79aa0c4be57f1f2aa323a0c0dba46338bad4..cbccc435a4776d801aab2d2ce54ab3cfeb1ed1d9 100644 (file)
@@ -1,3 +1,4 @@
+import { by, element } from 'protractor';
 import { OSDsPageHelper } from './osds.po';
 
 describe('OSDs page', () => {
@@ -32,4 +33,40 @@ describe('OSDs page', () => {
       await expect(osds.getTabText(1)).toEqual('Overall Performance');
     });
   });
+
+  describe('check existence of fields on OSD page', () => {
+    it('should check that number of rows and count in footer match', async () => {
+      await osds.navigateTo();
+      await expect(osds.getTableTotalCount()).toEqual(osds.getTableRows().count());
+    });
+
+    it('should verify that selected footer increases when an entry is clicked', async () => {
+      await osds.navigateTo();
+      await osds.getFirstCell().click(); // clicks first osd
+      await expect(osds.getTableSelectedCount()).toEqual(1);
+    });
+
+    it('should verify that buttons exist', async () => {
+      await osds.navigateTo();
+      await expect(element(by.cssContainingText('button', 'Scrub')).isPresent()).toBe(true);
+      await expect(
+        element(by.cssContainingText('button', 'Cluster-wide configuration')).isPresent()
+      ).toBe(true);
+    });
+
+    it('should check the number of tabs when selecting an osd is correct', async () => {
+      await osds.navigateTo();
+      await osds.getFirstCell().click(); // clicks first osd
+      await expect(osds.getTabsCount()).toEqual(8); // includes tabs at the top of the page
+    });
+
+    it('should show the correct text for the tab labels', async () => {
+      await expect(osds.getTabText(2)).toEqual('Attributes (OSD map)');
+      await expect(osds.getTabText(3)).toEqual('Metadata');
+      await expect(osds.getTabText(4)).toEqual('Device health');
+      await expect(osds.getTabText(5)).toEqual('Performance counter');
+      await expect(osds.getTabText(6)).toEqual('Histogram');
+      await expect(osds.getTabText(7)).toEqual('Performance Details');
+    });
+  });
 });
index 392e2c52511e766bbcfda50af461c1b2011e8bad..c19aefaaa8b10e006bc2a32590baa93efe468fa2 100644 (file)
@@ -285,4 +285,8 @@ export abstract class PageHelper {
     // Waits for item to be removed from table
     return this.waitStaleness(this.getFirstTableCellWithText(name));
   }
+
+  getTableRows() {
+    return $$('datatable-row-wrapper');
+  }
 }