]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix orchestrator/02-hosts-inventory.e2e failed. 44467/head
authorNizamudeen A <nia@redhat.com>
Thu, 23 Dec 2021 10:53:31 +0000 (16:23 +0530)
committerNizamudeen A <nia@redhat.com>
Wed, 5 Jan 2022 14:12:05 +0000 (19:42 +0530)
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 <nia@redhat.com>
(cherry picked from commit 7b9fb258c46f4a93ca53a5864a8eb4363147bcdc)

qa/workunits/cephadm/test_dashboard_e2e.sh
src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/inventory.po.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts [deleted file]

index e0f542e0f07e71df5aaedbacb95a337e107f8a2b..7ec5a70742900256ff05e7f49fe11d0e308f2cf8 100755 (executable)
@@ -98,6 +98,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
index ee8e43f7ef7c1296f47b244d5d5986937f13eaf8..5a9abdc036c915d2cd651f2e7adf127c3abb25a4 100644 (file)
@@ -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}`);
   }
 }
index 38bee09edea90e2b3ec121689b2e4283b823567e..aca36ade192198a7faef4396c5f47d5b4103da50 100644 (file)
@@ -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 (file)
index f262285..0000000
+++ /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);
-        });
-      }
-    });
-  });
-});