From 19cb6db93485203dc3cfee5d932720865c2546f6 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Thu, 7 Nov 2019 12:11:21 +0800 Subject: [PATCH] mgr/dashboard: fix e2e test failure for OSDs 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 --- .../frontend/e2e/cluster/osds.e2e-spec.ts | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts index 7ab4bf3268e..8671d5a5091 100644 --- a/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts @@ -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' + ]); + }); }); }); }); -- 2.39.5