]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix orchestrator/02-hosts-inventory.e2e failed.
authorNizamudeen A <nia@redhat.com>
Thu, 23 Dec 2021 10:53:31 +0000 (16:23 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 31 Dec 2021 07:26:12 +0000 (12:56 +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>
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 60719aa4ed56f83b7e2a3082950a56bf6665a4f6..9d8e90cebc2915b40f39e8ea80a098395516d5a5 100755 (executable)
@@ -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
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);
-        });
-      }
-    });
-  });
-});