From 7b9fb258c46f4a93ca53a5864a8eb4363147bcdc Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 23 Dec 2021 16:23:31 +0530 Subject: [PATCH] mgr/dashboard: fix orchestrator/02-hosts-inventory.e2e failed. I removed the `02-hosts-inventory.e2e` file because it is a duplicate test of one of the test in the `01-hosts.e2e` file and fixed the error from that file. Also, in the inventory Identify test, we test for an element to be not visible. According to the latest cypress docs, this should be not.exist instead of not.visible since the cd-modal will not even be present in the DOM Fixes: https://tracker.ceph.com/issues/53499 Signed-off-by: Nizamudeen A --- qa/workunits/cephadm/test_dashboard_e2e.sh | 1 - .../integration/cluster/inventory.po.ts | 2 +- .../orchestrator/01-hosts.e2e-spec.ts | 2 +- .../02-hosts-inventory.e2e-spec.ts | 26 ------------------- 4 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts diff --git a/qa/workunits/cephadm/test_dashboard_e2e.sh b/qa/workunits/cephadm/test_dashboard_e2e.sh index 60719aa4ed56f..9d8e90cebc291 100755 --- a/qa/workunits/cephadm/test_dashboard_e2e.sh +++ b/qa/workunits/cephadm/test_dashboard_e2e.sh @@ -92,6 +92,5 @@ ceph orch device ls --refresh sleep 10 ceph orch device ls --format=json | tee cypress/fixtures/orchestrator/inventory.json -cypress_run "orchestrator/02-hosts-inventory.e2e-spec.ts" cypress_run "orchestrator/03-inventory.e2e-spec.ts" cypress_run "orchestrator/04-osds.e2e-spec.ts" 300000 diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/inventory.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/inventory.po.ts index ee8e43f7ef7c1..5a9abdc036c91 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/inventory.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/inventory.po.ts @@ -16,7 +16,7 @@ export class InventoryPageHelper extends PageHelper { cy.get('#duration').select('10 minutes'); cy.get('cd-back-button').click(); }); - cy.get('cd-modal').should('not.visible'); + cy.get('cd-modal').should('not.exist'); cy.get(`${this.pages.index.id}`); } } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts index 38bee09edea90..aca36ade19219 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts @@ -38,7 +38,7 @@ describe('Hosts page', () => { for (const host of this.hosts) { hosts.clickTab('cd-host-details', host.name, 'Physical Disks'); cy.get('cd-host-details').within(() => { - hosts.getTableCount('total').should('be.gte', 0); + hosts.expectTableCount('total', host.devices.length); }); } }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts deleted file mode 100644 index f26228510f5e9..0000000000000 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HostsPageHelper } from '../cluster/hosts.po'; - -describe('Hosts page', () => { - const hosts = new HostsPageHelper(); - - beforeEach(() => { - cy.login(); - Cypress.Cookies.preserveOnce('token'); - hosts.navigateTo(); - }); - - describe('when Orchestrator is available', () => { - beforeEach(function () { - cy.fixture('orchestrator/inventory.json').as('hosts'); - }); - - it('should display correct inventory', function () { - for (const host of this.hosts) { - hosts.clickTab('cd-host-details', host.name, 'Physical Disks'); - cy.get('cd-host-details').within(() => { - hosts.getTableCount('total').should('be.eq', host.devices.length); - }); - } - }); - }); -}); -- 2.39.5