]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix e2e test failure for OSDs 31451/head
authorKiefer Chang <kiefer.chang@suse.com>
Thu, 7 Nov 2019 04:11:21 +0000 (12:11 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Thu, 7 Nov 2019 04:34:08 +0000 (12:34 +0800)
When clicking a selected row, the row becomes unselected and the detail
component is hidden. Rearrange related tests by selecting the row only
once.

Fixes: https://tracker.ceph.com/issues/42671
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts

index 7ab4bf3268eac28cbdc7960c43463a3a73bd5319..8671d5a5091040467bf2489836b48e12cd4c83e0 100644 (file)
@@ -36,11 +36,6 @@ describe('OSDs page', () => {
       await expect(osds.getTableTotalCount()).toEqual(osds.getTableRows().count());
     });
 
-    it('should verify that selected footer increases when an entry is clicked', async () => {
-      await osds.getFirstCell().click();
-      await expect(osds.getTableSelectedCount()).toEqual(1);
-    });
-
     it('should verify that buttons exist', async () => {
       await expect(element(by.cssContainingText('button', 'Scrub')).isPresent()).toBe(true);
       await expect(
@@ -48,20 +43,29 @@ describe('OSDs page', () => {
       ).toBe(true);
     });
 
-    it('should show the correct text for the tab labels', async () => {
-      await osds.getFirstCell().click();
-      const tabHeadings = $$('#tabset-osd-details > div > tab').map((e) =>
-        e.getAttribute('heading')
-      );
-      await expect(tabHeadings).toEqual([
-        'Devices',
-        'Attributes (OSD map)',
-        'Metadata',
-        'Device health',
-        'Performance counter',
-        'Histogram',
-        'Performance Details'
-      ]);
+    describe('by selecting one row in OSDs List', () => {
+      beforeAll(async () => {
+        await osds.getFirstCell().click();
+      });
+
+      it('should verify that selected footer increases', async () => {
+        await expect(osds.getTableSelectedCount()).toEqual(1);
+      });
+
+      it('should show the correct text for the tab labels', async () => {
+        const tabHeadings = $$('#tabset-osd-details > div > tab').map((e) =>
+          e.getAttribute('heading')
+        );
+        await expect(tabHeadings).toEqual([
+          'Devices',
+          'Attributes (OSD map)',
+          'Metadata',
+          'Device health',
+          'Performance counter',
+          'Histogram',
+          'Performance Details'
+        ]);
+      });
     });
   });
 });