]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix test_dashboard_e2e.sh errors
authorKiefer Chang <kiefer.chang@suse.com>
Wed, 2 Dec 2020 06:09:02 +0000 (14:09 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Wed, 2 Dec 2020 06:51:39 +0000 (14:51 +0800)
- Adapt changes in https://github.com/ceph/ceph/pull/35039.
- Tweak the way to get row by OSD ID.

Fixes: https://tracker.ceph.com/issues/48406
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.po.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/04-osds.e2e-spec.ts

index 7cd738b822e7f8c50123762f1f4a158ea28e23af..263dfd89ec1606b724ac1725bce7e526b6d821a0 100644 (file)
@@ -34,30 +34,23 @@ export class OSDsPageHelper extends PageHelper {
     cy.get(`cd-osd-creation-preview-modal .modal-footer .tc_submitButton`).click();
   }
 
-  getRowByID(id: number) {
-    return this.getTableCell(this.columnIndex.id, `${id}`).parent();
-  }
-
   @PageHelper.restrictTo(pages.index.url)
   checkStatus(id: number, status: string[]) {
-    this.getRowByID(id)
-      .find(`datatable-body-cell:nth-child(${this.columnIndex.status}) .badge`)
-      .should(($ele) => {
-        const allStatus = $ele.toArray().map((v) => v.innerText);
-        for (const s of status) {
-          expect(allStatus).to.include(s);
-        }
-      });
+    this.seachTable(`id:${id}`);
+    this.expectTableCount('found', 1);
+    cy.get(`datatable-body-cell:nth-child(${this.columnIndex.status}) .badge`).should(($ele) => {
+      const allStatus = $ele.toArray().map((v) => v.innerText);
+      for (const s of status) {
+        expect(allStatus).to.include(s);
+      }
+    });
   }
 
   @PageHelper.restrictTo(pages.index.url)
   ensureNoOsd(id: number) {
-    cy.get(`datatable-body-row datatable-body-cell:nth-child(${this.columnIndex.id})`).should(
-      ($ele) => {
-        const osdIds = $ele.toArray().map((v) => v.innerText);
-        expect(osdIds).to.not.include(`${id}`);
-      }
-    );
+    this.seachTable(`id:${id}`);
+    this.expectTableCount('found', 0);
+    this.clearTableSearchInput();
   }
 
   @PageHelper.restrictTo(pages.index.url)
index f1a66e0a9577d3f0df45fa14ee92cc0046a2a643..e80398d5a47208840168e9f86f2613866bf75b47 100644 (file)
@@ -29,6 +29,7 @@ describe('OSDs page', () => {
           dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} up`);
           dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} in`);
 
+          cy.wait(30000);
           expect(Number(newCount)).to.be.gte(2);
           // Delete the first OSD we created
           osds.navigateTo();
@@ -36,10 +37,10 @@ describe('OSDs page', () => {
           osds.deleteByIDs([deleteOsdId], false);
           osds.ensureNoOsd(deleteOsdId);
 
+          cy.wait(30000);
           // Replace the second OSD we created
           const replaceID = Number(oldCount) + 1;
           osds.deleteByIDs([replaceID], true);
-          // deleting OSDs doesn't work in cephadm right now, skip checking
           osds.checkStatus(replaceID, ['destroyed']);
         });
       });