From: Nizamudeen A Date: Thu, 23 Dec 2021 10:53:31 +0000 (+0530) Subject: mgr/dashboard: fix orchestrator/02-hosts-inventory.e2e failed. X-Git-Tag: v17.1.0~135^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b9fb258c46f4a93ca53a5864a8eb4363147bcdc;p=ceph-ci.git 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 --- diff --git a/qa/workunits/cephadm/test_dashboard_e2e.sh b/qa/workunits/cephadm/test_dashboard_e2e.sh index 60719aa4ed5..9d8e90cebc2 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 ee8e43f7ef7..5a9abdc036c 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 38bee09edea..aca36ade192 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 f26228510f5..00000000000 --- 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); - }); - } - }); - }); -});